CrewAI Memory with Cognee
Introduction
Over the past month, I've been spending time in San Francisco, immersing myself in the tech scene through various events, demos, and presentations. While public events can be hit or miss, reputable ones often prove valuable. Our initial product announcement was made at a Weaviate event, and when I heard that Philipp from Weaviate was organizing a small hackathon, I knew I couldn't miss it.
After a long day at work, I headed to the GitHub office venue. While waiting for the event to start, I met Clovis, who works on fascinating projects exploring the post-AI labor market. We decided to pair up for the hackathon.
We needed to submit this project in just 2 hours, so what you see here was developed with speed in mind. Nevertheless, it opens up an interesting space for experimentation.
And we won!
The Project: Real Estate Research Agent with Agentic Memory
Problem Statement
When choosing a new place to live, we need to consider both the living space itself and its surroundings. The challenge is how to efficiently evaluate an area without wasting precious time.
Solution
We developed an AI Agent system with three main components:
- Planning Agent (Boss): Controls and coordinates the analysis
- Living Space Agent: Evaluates apartment features and personality profiles
- Area Vibes Agent: Analyzes neighborhood characteristics
Architecture Overview
Key Components
- Cognee Memory Layer: Creates a semantic layer using graph store and Weaviate vector database
- CrewAI Agents: Handle the analysis process
- Remote Execution: Runs on Phoenix platform
Data Structure
User Profile Example
Apartment Listing Example
Implementation
The complete code for this project is available at GitHub Repository.
Cognee Integration with CrewAI
First, we create a Cognee search tool:
Crew Definition
Task Definition
Crew Execution
How It Works
- Data Loading: Cognee loads and processes audio and text files from real estate listings
- Agent Coordination: The Planning Agent distributes relevant information to specialized agents
- Analysis: Each agent performs its specific analysis using Cognee's semantic search
- Decision Making: Agents make recommendations based on user preferences and available data
- Final Report: Results are compiled into a comprehensive analysis
Benefits of This Approach
- Efficient Information Processing: Cognee's semantic layer enables quick access to relevant information
- Specialized Analysis: Each agent focuses on specific aspects of the decision-making process
- Contextual Understanding: The system considers both explicit and implicit relationships in the data
- Scalable Architecture: The modular design allows for easy addition of new agents or analysis types
Future Improvements
- Enhanced Data Sources: Integration with more real estate data providers
- Advanced Analytics: Implementation of more sophisticated analysis algorithms
- User Interface: Development of a user-friendly interface for interaction
- Performance Optimization: Further optimization of the semantic search layer
Conclusion
This project demonstrates how Cognee can serve as an effective AI memory framework when combined with CrewAI. The system successfully processes complex real estate data while maintaining context and relationships, making it a powerful tool for decision-making in real estate research.
The combination of semantic search, graph storage, and specialized agents creates a robust foundation for building intelligent systems that can understand and process complex domain-specific information.
If you try implementing this approach, we'd love to hear about your experience! The full repo can be found here.