MCP Integration
Coding Agent Integration
Integrate Hebbrix with your coding agent using MCP (Model Context Protocol) or direct API calls.
MCP Integration (Recommended)
The fastest way to add memory to Claude, Cline, or any MCP-compatible agent:
Setup
# Install Hebbrix MCP Server
cd mcp
./quick_setup.sh
# Add to your Claude Desktop config
{
"mcpServers": {
"hebbrix": {
"command": "python",
"args": ["/path/to/hebbrix/mcp/server.py"],
"env": {
"HEBBRIX_API_KEY": "your_api_key"
}
}
}
}Available MCP Tools
hebbrix_rememberStore a new memory from the conversation
hebbrix_searchSearch for relevant memories
hebbrix_recallGet context for the current conversation
hebbrix_forgetDelete specific memories
Direct API Integration
For custom agents, use the direct API:
Python
from hebbrix import Hebbrix
# Initialize
client = Hebbrix()
# Store conversation context
await client.memories.create(
content="User asked about API authentication",
importance=0.7
)
# Retrieve context for next response
results = await client.search(
query="How do I authenticate?",
limit=5
)
# Use results to enhance your agent's response
context = "\n".join([r["content"] for r in results["results"]])
response = your_llm.generate(context + user_message)LangChain Integration
LangChain
from langchain.memory import HebbrixMemory
from langchain.chains import ConversationChain
from langchain.llms import OpenAI
# Initialize with Hebbrix memory
memory = HebbrixMemory(
api_key="your_hebbrix_key",
collection_id="my_agent"
)
# Create conversation chain
chain = ConversationChain(
llm=OpenAI(),
memory=memory,
verbose=True
)
# Conversations now have persistent memory!
response = chain.predict(input="My name is Alice")
# Later...
response = chain.predict(input="What's my name?")
# Returns: "Your name is Alice"Example Projects
Check out the /examples folder for:
- LangChain integration
- Automatic memory chatbot (3 lines of code!)
- Custom coding agent setup
