Hey there,
I wanted to start using the memory feature, but couldn’t get it to work. I am on a windows pc and as soon as I am setting memory=true for my crew, I get the following error:
OSError: [WinError 123] The syntax for the file name, directory name, or volume label is incorrect: 'C:\\Users\\{user_name}\\AppData\\Local\\CrewAI\\data_enrichment_crew/short_term/{a 840 char long name with all my agents...}'
I guess it’s because I have quite a complex use case with a couple of agents involved. If I am right, the folder name for the short term memory is generated by joining the agent names (crewAI/src/crewai/memory/storage/rag_storage.py at 02718e291b6cf2b4cedb2f2d923ce7ffc5aa9963 · crewAIInc/crewAI · GitHub). That leads to a folder name that is 840 chars long - windows has a 240 char max.
[class RAGStorage(Storage)](https://github.com/crewAIInc/crewAI/blob/02718e291b6cf2b4cedb2f2d923ce7ffc5aa9963/src/crewai/memory/storage/rag_storage.py#L27):
"""
Extends Storage to handle embeddings for memory entries, improving
search efficiency.
"""
def __init__(self, type, allow_reset=True, embedder_config=None, crew=None):
super().__init__()
if (
not os.getenv("OPENAI_API_KEY")
and not os.getenv("OPENAI_BASE_URL") == "https://api.openai.com/v1"
):
os.environ["OPENAI_API_KEY"] = "fake"
agents = crew.agents if crew else []
agents = [self._sanitize_role(agent.role) for agent in agents]
**agents = "_".join(agents)**
config = {
"app": {
"config": {"name": type, "collect_metrics": False, "log_level": "ERROR"}
},
"chunker": {
"chunk_size": 5000,
"chunk_overlap": 100,
"length_function": "len",
"min_chunk_size": 150,
},
"vectordb": {
"provider": "chroma",
"config": {
"collection_name": type,
**"dir": f"{db_storage_path()}/{type}/{agents}",**
"allow_reset": allow_reset,
},
},
}
if embedder_config:
config["embedder"] = embedder_config
self.type = type
self.config = config
self.allow_reset = allow_reset
Are there any workarounds? I tried setting a CustomRAG as provided in the documentation, but couldn’t get it to work either…