Open Dev-Khant opened 1 month ago
Please upgrade to latest version 0.70.1 and see if it still occurs as your versions are quite far behind now
Hey @theCyberTech I tried with latest version and I'm facing with chromadb
now.
ValueError Traceback (most recent call last)
File ~/Desktop/crewAI/src/crewai/memory/storage/rag_storage.py:59, in RAGStorage._initialize_app(self)
[58](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/src/crewai/memory/storage/rag_storage.py:58) try:
---> [59](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/src/crewai/memory/storage/rag_storage.py:59) self.collection = self.app.get_collection(
[60](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/src/crewai/memory/storage/rag_storage.py:60) name=self.type, embedding_function=self.embedder_config
[61](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/src/crewai/memory/storage/rag_storage.py:61) )
[62](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/src/crewai/memory/storage/rag_storage.py:62) except Exception:
File ~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/api/client.py:218, in Client.get_collection(self, name, id, embedding_function, data_loader)
[208](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/api/client.py:208) @override
[209](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/api/client.py:209) def get_collection(
[210](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/api/client.py:210) self,
(...)
[216](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/api/client.py:216) data_loader: Optional[DataLoader[Loadable]] = None,
[217](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/api/client.py:217) ) -> Collection:
--> [218](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/api/client.py:218) return self._server.get_collection(
[219](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/api/client.py:219) id=id,
[220](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/api/client.py:220) name=name,
[221](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/api/client.py:221) embedding_function=embedding_function,
[222](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/api/client.py:222) data_loader=data_loader,
[223](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/api/client.py:223) tenant=self.tenant,
[224](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/api/client.py:224) database=self.database,
[225](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/api/client.py:225) )
...
(...)
[235](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/db/mixins/sysdb.py:235) database=database,
[236](https://file+.vscode-resource.vscode-cdn.net/Users/devkhant/Desktop/crewAI/~/Desktop/crewAI/.venv/lib/python3.12/site-packages/chromadb/db/mixins/sysdb.py:236) )
UniqueConstraintError: Collection short_term already exists
Seems issue is with get_collection
so it's switching to creating new one. Here: https://github.com/crewAIInc/crewAI/blob/main/src/crewai/memory/storage/rag_storage.py#L56
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Description
I was trying to use memory but found out that
save
function is not being called.Steps to Reproduce
Expected behavior
Here the
save
function of each memory i.e ShortTermMemory, LongTermMemory, EntityMemory should be called.Screenshots/Code snippets
I tried printing every function of the memory class but it can be seen that no
save
call is being made. Only search is done and it empty results and nothing is being added.Operating System
macOS Sonoma
Python Version
3.10
crewAI Version
0.51.1
crewAI Tools Version
0.8.3
Virtual Environment
Venv
Evidence
Possible Solution
Save function needs to be called properly.
Additional context
Nothing much