I'm working on implementing CrewAI's short-term memory feature, but it's not behaving as expected.

embedder_config = {
    "provider": "openai", 
    "config": {
        "api_key": "XXXXXXX",
        "api_base": "https://xxxx.openai.azure.com/",
        "api_type": "azure",
        "api_version": "2024-02-01",
        "model_name": "xxxxx", 
        "deployment_id": "xxxx"  
    }
}

# Create ShortTermMemory with embedder
self.short_term_memory = ShortTermMemory(embedder_config=embedder_config)

# Create crew with custom short-term memory
self.crew = Crew(
    agents=[self.agent],
    tasks=[],
    memory=True,
    short_term_memory=self.short_term_memory,
    verbose=False
)

The memory system initializes without errors, but the agent doesn't seem to retain context from previous conversations as expected.

How can I successfully implemented CrewAI's short-term memory with Azure OpenAI embeddings?

Any guidance, documentation links, or working examples?

4 Replies 4

Could you log the short term memory contents right before you generate the response? That ought to help with debugging—see if it's similar to what you were expecting, or what's different.

"the agent doesn't seem to retain context" How did you get this impression? Could it be that it still does?

the agent is not able to remember previous context, but based on the CrewAi document it should able to remember previous context,

We don't need you to simply repeat that you perceive a problem—we understood that from your first post. We were asking for more details on what you see, and suggesting ways to debug it further.

Your Reply

By clicking “Post Your Reply”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.