AI Agent Boilerplatewith Memory
Production-ready agent framework with 5-component memory system, built on MongoDB Atlas and LangGraph
Memory Architecture
5-component memory system based on cognitive science research, implemented with production-grade infrastructure
Episodic Memory
Conversation history, user interactions, temporal sequences
ConversationMemoryUnit
Semantic Memory
Domain knowledge, facts, concepts, relationships
KnowledgeBase + Vector Search
Procedural Memory
Learned workflows, step-by-step processes, patterns
Workflow execution patterns
Working Memory
Active context, current session state, temporary data
LangGraph state management
Semantic Cache
Query results, computed responses, performance optimization
Vector similarity caching
Implementation
Real code that actually works. No marketing fluff.
from src.core.agent_builder import AgentBuilderfrom langchain.agents import toolimport os# Define custom tools@tooldef analyze_sentiment(text: str) -> str:"""Analyze sentiment with memory context"""return f"Sentiment: {text} -> Positive"# Create agent with 5-component memoryagent = AgentBuilder.create_agent(agent_name="production_assistant",system_prompt="You are an AI with persistent memory.",user_tools=[analyze_sentiment],mongodb_uri=os.getenv("MONGODB_URI"),embedding_model="voyage-3-large")# Agent remembers across sessionsresponse = await agent.aexecute("Analyze: This framework is amazing!",thread_id="user_session_123")# Memory persists - ask follow-upresponse = await agent.aexecute("What was the sentiment of my last message?",thread_id="user_session_123")print(response) # Agent remembers the context
Production Stack
Built with battle-tested technologies, not experimental frameworks
LangGraph
Stateful, multi-actor applications with LLMs
- State management
- Checkpointing
- Multi-agent workflows
MongoDB Atlas
Vector search & document storage
- Vector search
- Atlas Search
- Flexible schema
Voyage AI
State-of-the-art embeddings
- voyage-3-large
- 1024 dimensions
- High accuracy
FastAPI
High-performance API framework
- Async/await
- Auto docs
- Type hints
Docker
Containerization & deployment
- Multi-stage builds
- Production ready
- K8s compatible
Observability
Monitoring & performance tracking
- Galileo AI
- Metrics
- Tracing
Ready to Build?
Clone the repository and have a production-ready agent with memory running in 5 minutes.