Troubleshooting Memory and Database: Empty Files After Crew Execution

After executing the crew, the database files are being created, but no data is being saved in them. Can anyone guide me on whether it is working as intended, or if I am making a mistake somewhere? I have not found any clear examples related to my use case, which involves managing multiple databases for multiple crews.

Here is piece of Code:

class CrewFactory:
    @staticmethod
    def create_crew(workflow, agents, tasks, process_type, output_log_file=None):
        crew_config = {
            'agents': agents,
            'tasks': tasks,
            'process': Process.hierarchical if process_type == 'hierarchical' else Process.sequential,
            'verbose': True,
            'output_log_file': output_log_file or ""
        }
        if workflow.memory == 1:
            crew_config.update(CrewFactory._get_memory_config(workflow))
        if process_type == 'hierarchical':
            crew_config.update(CrewFactory._get_hierarchical_config(workflow))
        return Crew(**crew_config)
    @staticmethod
    def _get_memory_config(workflow):
        return {
            'memory': True,
            'long_term_memory': LongTermMemory(
                storage=LTMSQLiteStorage(db_path=f"{workflow.long_term_memory}")
            ),
            'short_term_memory': ShortTermMemory(
                storage=RAGStorage(
                    type="short_term",
                    custom_dir=workflow.short_term_memory,
                ),
            ),
            'entity_memory': EntityMemory(
                storage=RAGStorage(
                    type="entities",
                    custom_dir=workflow.entity_memory,
                ),
            ),
        }
    @staticmethod
    def _get_hierarchical_config(workflow):
        if workflow.manager_agent:
            return {'manager_agent': CrewFactory._create_manager_agent(workflow)}
        else:
            return {'manager_llm': ChatOpenAI(temperature=0, model="gpt-4o-mini")}
    @staticmethod
    def _create_manager_agent(workflow):
        from home.serializers import ManagerAgentSerializer
        from home.models import ManagerAgent
        queryset = ManagerAgent.objects.filter(id=workflow.manager_agent_id).first()
        manager_llm_data = ManagerAgentSerializer(queryset).data
        return CrewAgent(
            role=manager_llm_data.get('name'),
            goal=manager_llm_data.get('goal'),
            backstory=manager_llm_data.get('backstory'),
            allow_delegation=True,
        )

Here is database which showing no data after excuting above code:

Please help us out we are stuck middle of somewhere, your help is really appreciated!

Anyone from the team please help me out we are stuck somewhere we need your help?

2 Likes