File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,10 +32,9 @@ def __init__(
3232 path : Optional [str | Path ] = None ,
3333 collection_name : str = "agent_memory" ,
3434 ) -> None :
35+ home_dir = os .path .expanduser ("~" )
3536 self .path = (
36- Path (path )
37- if path
38- else Path (__file__ ).resolve ().parent / "agent_memory_db"
37+ Path (path ) if path else Path (home_dir + "/.cache/ursa/rag/db/" )
3938 )
4039 self .collection_name = collection_name
4140 self .path .mkdir (parents = True , exist_ok = True )
@@ -165,8 +164,8 @@ def delete_database(path: Optional[str | Path] = None):
165164 Where the on-disk Chroma DB is for deleting. If *None*, a folder called
166165 ``agent_memory_db`` is created in the package’s base directory.
167166 """
168-
169- db_path = Path (path ) if path else Path ("~ /.cache/ursa/rag/db/" )
167+ home_dir = os . path . expanduser ( "~" )
168+ db_path = Path (path ) if path else Path (home_dir + " /.cache/ursa/rag/db/" )
170169 if os .path .exists (db_path ):
171170 shutil .rmtree (db_path )
172171 print (f"Database: { db_path } has been deleted." )
You can’t perform that action at this time.
0 commit comments