# Troubleshooting Memory and Database: Empty Files After Crew Execution

**URL:** <https://community.crewai.com/t/troubleshooting-memory-and-database-empty-files-after-crew-execution/834>\
**Category:** Crews\
**Tags:** crewai, memory\
**Created:** [October 16, 2024, 4:27pm UTC](https://community.crewai.com/t/troubleshooting-memory-and-database-empty-files-after-crew-execution/834 "2024-10-16T16:27:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_Waseem\_Panh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/muhammad_waseem_panh/32/584_2.png) [@Muhammad\_Waseem\_Panh](https://community.crewai.com/u/Muhammad_Waseem_Panh)\
**Post date:** [October 16, 2024, 4:27pm UTC](https://community.crewai.com/t/troubleshooting-memory-and-database-empty-files-after-crew-execution/834/1 "2024-10-16T16:27:01Z")

</div>

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:

```auto
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:

 ![Screenshot from 2024-10-16 21-16-09](https://us1.discourse-cdn.com/flex025/uploads/crewai/original/1X/985aab65c632050858326426411ae2a6e505f5cb.png)

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

---

<div class="post-metadata">

**Author:** ![Muhammad\_Waseem\_Panh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/muhammad_waseem_panh/32/584_2.png) [@Muhammad\_Waseem\_Panh](https://community.crewai.com/u/Muhammad_Waseem_Panh)\
**Post date:** [October 17, 2024, 7:40am UTC](https://community.crewai.com/t/troubleshooting-memory-and-database-empty-files-after-crew-execution/834/2 "2024-10-17T07:40:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Prof\_Hutchinson](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/prof_hutchinson/32/1890_2.png) [@Prof\_Hutchinson](https://community.crewai.com/u/Prof_Hutchinson)\
**Post date:** [January 10, 2025, 3:26am UTC](https://community.crewai.com/t/troubleshooting-memory-and-database-empty-files-after-crew-execution/834/3 "2025-01-10T03:26:32Z")

</div>

any responses to this one? I am about to try this and want to understand if this is buggy yet or if I can rely on it.

---

<div class="post-metadata">

**Author:** ![warlord918](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@warlord918](https://community.crewai.com/u/warlord918)\
**Post date:** [April 24, 2025, 6:53pm UTC](https://community.crewai.com/t/troubleshooting-memory-and-database-empty-files-after-crew-execution/834/4 "2025-04-24T18:53:01Z")

</div>

I have the same issue. After execution, there is nothing in the database.

Did you guys find the solution? Thanks!

---

<div class="post-metadata">

**Author:** ![Tony\_Wood](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/tony_wood/32/1876_2.png) [@Tony\_Wood](https://community.crewai.com/u/Tony_Wood)\
**Post date:** [April 25, 2025, 8:56pm UTC](https://community.crewai.com/t/troubleshooting-memory-and-database-empty-files-after-crew-execution/834/5 "2025-04-25T20:56:05Z")

</div>

Hi .. could you help explain what you are trying to achieve here?

Is it to use a tool that store information in a database or store memory during crew execution?
