Crew Memory is broken

This line of code memory =True breaks.
@crew
def crew(self) → Crew:
“”“Creates the CollegeEssayVersion2 crew”“”
return Crew(
agents=[self.essay_generator()],
tasks=self.tasks
process=Process.hierarchical,
manager_agent=self.critic_reviewer(),
memory=True,
verbose=True,
)

|   File "<frozen os>", line 225, in makedirs
| OSError: [Errno 36] File name too long: "/home/albert/.local/share/college_essay_version2/short_term/You_are_an_experienced_college_application_essay_writer.__Your_task_is_to_craft_a_400-word_essay_with_an_original_story_for_the_{program}_application,__using_only_the_information_provided_in_{file_content}.__Incorporate_creativity,_sincerity,_and_logic_into_the_essay,_and_feel_free_to_include_the_person_{student}_as_a_central_figure_in_the_narrative.__The_essay_should_have_a_clear_heading_(featuring_{student}'s_name)_and_a_well-rounded_conclusion._You_will_use_four_Personal_Insight_Questions_(PIQs)_from_the_{college}_that_you_deem_most_relevant_to_the_essay_using_the_{file_content}."

Hello, I am having the same issue. Did you solve this?
Thanks in advance

Hey @albert_pinto! Which version of CrewAI are you using?

We introduced a fix for this issue in early December.

1 Like

Hello, any news about this issue ?

Hey @kenpachi!

Could you give us a bit more context about the issue you’re running into with Memory?

Yes,
I wanted to add short term memory in my crew so i did all the config as explained in the doc but when I run it, I get this error : FileNotFoundError: [WinError 206] The filename or extension is too long. because it concat all the agent roles to make the file name. So my file name is too long.

this is my config :
short_term_memory=ShortTermMemory(
storage=RAGStorage(
embedder_config=EMBEDDER_CONFIG,
type=“short_term”,
path=“src/csc_flow_analyzer/data/”,
)
),

I saw that i could edit regedit by enabling long path but i’m working on a professional project and i don’t have admin rights. So if you find any solution it would be great

As a temporary and local workaround, try adjusting the MAX_FILE_NAME_LENGTH value in crewai/utilities/constants.py within your CrewAI installation.

Set it to a value that works for your operating system (but don’t make it too small).

I tried but still the same error.
does it matter if it’s a flow instead of a simple crew ?

this is the more complete log error

os.makedirs(os.path.dirname(self.db_file), exist_ok=True)
File “< frozen os >”, line 225, in makedirs
FileNotFoundError: [WinError 206] The filename or extension is too long: 'agent_role_1_agent_role_2
…’

I think I found something but by adding EntityMemory it worked.

in my crew config I only had this :

 short_term_memory=ShortTermMemory(
            storage=RAGStorage(
                embedder_config=EMBEDDER_CONFIG,
                type="short_term",
                path="src/csc_flow_analyzer/crews/analyzing_crew/",
            )
        ),

but by adding this :

entity_memory = EntityMemory(
            storage=RAGStorage(
                embedder_config=EMBEDDER_CONFIG,
                type="short_term",
                path="src/csc_flow_analyzer/crews/analyzing_crew/"
            )
        ),

my error gone.

Probably because RAGStorage uses EntityMemory with Short Memory idk.

1 Like