crewAIInc / crewAI

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
https://crewai.com
MIT License
19.11k stars 2.64k forks source link

Long-Term Memory Not Storing Data in Crew AI Agent #1222

Open pg179-krishna-innoway opened 3 weeks ago

pg179-krishna-innoway commented 3 weeks ago

Description

I'm currently working on a project where I'm using Crew AI agents with chunking and context retention. As part of this process, I'm attempting to implement long-term memory for the agents using SQLite to store previous context and embedding information. However, I’ve noticed that the long-term memory is not storing any data.

Steps to Reproduce

  1. Integrate Crew AI agents with the logic for chunking SQL queries.
  2. Implement the long-term memory storage using SQLite to retain context and embeddings across chunks.
  3. Run the agent to process multiple SQL queries.

Expected behavior

The long-term memory should store and retrieve context and embedding data for use in subsequent query processing.

Screenshots/Code snippets

Screenshot 2024-08-20 161832

Operating System

Windows 11

Python Version

3.12

crewAI Version

0.41.1

crewAI Tools Version

NA

Virtual Environment

Venv

Evidence

Screenshot 2024-08-20 161832

Possible Solution

None

Additional context

None

theCyberTech commented 3 weeks ago

Can you please provide more info / context on how you are setting this up in your crew I.E the code itself as you have only supplied a screenshot of the underlying crewai code for long term memory

pg179-krishna-innoway commented 3 weeks ago

agent1= Agent( role="...", goal=..., allow_delegation=False, verbose=True, memory=True, llm=llm ) agent2= Agent( role=..., goal=... allow_delegation=False, verbose=True, memory=True, tools = [web_tool], llm=llm )

crew = Crew(
    agents=[agent1, agent2],
    tasks=[task1, task2],
    memory=True,
    process=Process.sequential,
    verbose=True,
    embedder={
        "provider": "google",
        "config":{
            "model": 'models/embedding-001',
            "task_type": "retrieval_document",
            "title": "Embeddings for Embedchain"
        }
    }
)

This is my code where I am creating two agents and a crew. Other than this I have also used the way to store context in long term memory using theapproach as mentioned in the crewai documentation : https://docs.crewai.com/core-concepts/Memory/#how-memory-systems-empower-agents. 

It is creating a file long_term_memory.db but the file is empty.

crazypythonista commented 1 week ago

Any update on this? Encountering the same bug.