This is a personal learning project designed to "deconstruct" the logic of Multi-Agent Systems. The goal was to move beyond simple chatbot interactions and build a system where specialized AI agents collaborate, share a memory of a database, and solve a specific business logic problem, in this case being for Automated Customer Data Retrieval and Support.
The focus of this project is on:
- Agent Specialization: Defining unique roles, goals, and backstories.
- Tool Integration: Bridging the gap between LLMs and real-world data (MongoDB).
- Dependency Orchestration: Navigating the complex "Dependency Hell" of modern AI libraries.
The system is built on the "Sequential Process" model:
- Retrieval: A specialized agent identifies a need for data and triggers the
DatabaseRetrivalTool. - Processing: The LLM receives raw JSON from MongoDB, "reads" it, and extracts relevant insights.
- Resolution: A secondary agent uses that insight to formulate a human-like response.
One of the core challenges was running CrewAI on Python 3.12, where the legacy pkg_resources module was removed.
- Solution: Implemented a "Mocking" strategy at the runtime level to bypass telemetry crashes without downgrading the entire system.
Building the DatabaseRetrivalTool required a deep dive into Pydantic's Private Attributes.
- Insight: LLM tools are essentially Pydantic models. To prevent the system from trying to "validate" a live MongoDB Client object, I utilized
PrivateAttrto encapsulate the connection logic safely.
Navigating conflicts between langchain, crewai, and langchain-huggingface taught me the importance of Semantic Versioning.
- The Fix: Manually aligned the versions to ensure the
pydantic_v1bridge remained intact for legacy tool support.
- Framework: CrewAI
- LLM: Hugging Face
zephyr-7b-beta - Database: MongoDB Atlas (Cloud)
- Environment: VS Code + Virtual Environments (.venv)
To replicate this environment, ensure you use the specific versioning discovered during development:
# Initialize Environment
python3 -m venv .venv
source .venv/bin/activate
# Install Dependencies
pip install setuptools \
"langchain==0.1.20" \
"langchain-core==0.1.53" \
"langchain-community==0.0.38" \
"langchain-huggingface==0.0.3" \
crewai pymongo python-dotenv
**This project was built as part of a personal roadmap to comprehend multi-agentic systems better.**