forked from phoenix-oss/llama-stack-mirror
Added support for mongoDB KV store (#543)
Added the support for mongoDB as KV store validated in mongodb, it is able to store agent data, session data and turn data <img width="1332" alt="image" src="https://github.com/user-attachments/assets/867700a4-b9ee-4a3c-8278-f39074d39d56"> this is how run.yaml would look: ``` config: persistence_store: type: mongodb namespace: null host: localhost port: 27017 db: llamastack user: "" password: "" collection_name: llamastack_kvstore ``` --------- Co-authored-by: shrinitgoyal <shrinit.goyal@engati.com>
This commit is contained in:
parent
5966079770
commit
b74f25035c
4 changed files with 106 additions and 2 deletions
|
@ -11,7 +11,7 @@ from .config import KVStoreConfig, KVStoreType
|
|||
|
||||
|
||||
def kvstore_dependencies():
|
||||
return ["aiosqlite", "psycopg2-binary", "redis"]
|
||||
return ["aiosqlite", "psycopg2-binary", "redis", "pymongo"]
|
||||
|
||||
|
||||
class InmemoryKVStoreImpl(KVStore):
|
||||
|
@ -44,6 +44,10 @@ async def kvstore_impl(config: KVStoreConfig) -> KVStore:
|
|||
from .postgres import PostgresKVStoreImpl
|
||||
|
||||
impl = PostgresKVStoreImpl(config)
|
||||
elif config.type == KVStoreType.mongodb.value:
|
||||
from .mongodb import MongoDBKVStoreImpl
|
||||
|
||||
impl = MongoDBKVStoreImpl(config)
|
||||
else:
|
||||
raise ValueError(f"Unknown kvstore type {config.type}")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue