This guide covers installing and configuring Agentic Memory for local development or production use.
- Prerequisites
- Installation Methods
- Neo4j Setup
- Environment Configuration
- Initial Setup
- Troubleshooting
| Software | Minimum Version | Recommended | Purpose |
|---|---|---|---|
| Python | 3.10 | 3.11+ | Runtime environment |
| Neo4j | 5.18 | 5.25+ | Graph database with vector search |
| OpenAI API Key | - | - | For semantic embeddings |
| Git | 2.0+ | Latest | For version control (optional) |
- RAM: 4GB minimum (8GB recommended for larger codebases)
- Disk Space: 500MB for Neo4j + additional space for graph data
- OS: Linux, macOS, or Windows 10+
- OpenAI API Key - Required for semantic search (embeddings)
- Get yours at: https://platform.openai.com/api-keys
- Pricing: ~$0.13 per 1M tokens (text-embedding-3-large)
- Typical cost: $0.50-2.00 for a medium codebase (10K-50K LOC)
pipx installs packages in isolated environments, ideal for CLI tools:
# Install pipx (if not already installed)
python -m pip install --user pipx
# Add pipx to PATH (Linux/macOS)
# Add this to your ~/.bashrc or ~/.zshrc:
export PATH="$PATH:$HOME/.local/bin"
# Install Agentic Memory
pipx install codememory
# Verify installation
codememory --versionAdvantages:
- Isolated from system Python
- No dependency conflicts
- Easy to uninstall:
pipx uninstall codememory
# Install globally as a Python tool
uv tool install codememory
# Run without installing globally
uvx codememory --helpAdvantages:
- Fast dependency resolution and installs
- Great for ephemeral tool usage via
uvx
# Install directly
pip install codememory
# Or with user-only installation
pip install --user codememoryNote: This may conflict with other packages requiring different versions of dependencies.
# Clone the repository
git clone https://github.com/jarmen423/agentic-memory.git
cd agentic-memory
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install in editable mode
pip install -e .
# Verify installation
codememory --helpAdvantages:
- Can modify source code directly
- Changes take effect immediately
- Ideal for contributors
Agentic Memory requires Neo4j 5.18+ with vector search support. Choose one of the following methods:
# Using the project's docker-compose.yml
docker-compose up -d neo4j
# Check logs
docker-compose logs -f neo4j
# Stop when done
docker-compose downThis starts Neo4j with:
- HTTP UI: http://localhost:7474
- Bolt Protocol: bolt://localhost:7687
- Default credentials: neo4j / password
docker run -d \
--name agentic-memory-neo4j \
-p 7474:7474 \
-p 7687:7687 \
-e NEO4J_AUTH=neo4j/your_secure_password \
-e NEO4J_dbms_memory_heap_max__size=2G \
-e NEO4J_dbms_memory_pagecache_size=1G \
-v neo4j_data:/data \
neo4j:5.25-communityEnvironment Variables:
NEO4J_AUTH- Set username/password (format:username/password)NEO4J_dbms_memory_heap_max__size- Max JVM heap sizeNEO4J_dbms_memory_pagecache_size- Page cache for graph data
Change the default password:
# Connect to Neo4j container
docker exec -it agentic-memory-neo4j cypher-shell -u neo4j -p password
# Change password
CALL dbms.security.changePassword('new_secure_password');Neo4j offers a free AuraDB instance (limited to 200K nodes):
- Sign up: https://neo4j.com/cloud/aura/
- Create free instance:
- Select "AuraDB Free"
- Choose a region closest to you
- Get connection details:
- Copy the connection URL (format:
neo4j+s://...) - Save the password
- Copy the connection URL (format:
Limitations:
- 200K nodes limit
- No data persistence after 3 days of inactivity
- May be slow for large codebases
Use case: Great for testing, small projects, or quick demos.
# Import Neo4j GPG key
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
# Add Neo4j repository
echo 'deb https://debian.neo4j.com stable latest' | sudo tee /etc/apt/sources.list.d/neo4j.list
# Install
sudo apt update
sudo apt install neo4j
# Start service
sudo systemctl start neo4j
sudo systemctl enable neo4j# Using Homebrew
brew install neo4j
# Start service
brew services start neo4j
# Or run manually
neo4j start- Download from: https://neo4j.com/download/
- Extract to a directory (e.g.,
C:\neo4j) - Run as Administrator:
bin\neo4j.bat install-service - Start:
bin\neo4j.bat start
# Check if Neo4j is running
curl http://localhost:7474
# Or using cypher-shell
cypher-shell -u neo4j -p password "RETURN 1"
# Expected output:
# 1Run the init wizard in your project directory:
cd /path/to/your/project
codememory initThe wizard will guide you through:
- Neo4j connection setup
- OpenAI API key configuration
- File extension selection
- Initial indexing
Create a .env file in your project root:
# Neo4j Configuration
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=password
# OpenAI Configuration
OPENAI_API_KEY=sk-your-api-key-here
# Optional: Logging
LOG_LEVEL=INFOSecurity: Never commit .env to version control. Add .env to your .gitignore:
echo ".env" >> .gitignoreThe init wizard creates .codememory/config.json:
{
"neo4j": {
"uri": "bolt://localhost:7687",
"user": "neo4j",
"password": "password"
},
"openai": {
"api_key": null
},
"indexing": {
"ignore_dirs": [
"node_modules",
"__pycache__",
".git",
"dist",
"build",
".venv",
"venv",
".pytest_cache",
".mypy_cache",
"target",
"bin",
"obj"
],
"ignore_files": [],
"extensions": [".py", ".js", ".ts", ".tsx", ".jsx"]
}
}Note: .codememory/ is automatically gitignored to prevent committing API keys.
cd /path/to/your/repository
codememory initFollow the interactive prompts:
- Choose Neo4j setup (Docker, Aura, or custom)
- Enter OpenAI API key (or use environment variable)
- Select file extensions to index
- Run initial indexing
# Check status
codememory status
# Expected output:
# 📊 Agentic Memory Status
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Repository: /path/to/your/repo
# Config: /path/to/your/repo/.codememory/config.json
#
# 📈 Graph Statistics:
# Files: 42
# Functions: 156
# Classes: 23
# Chunks: 179
# Last sync: 2025-02-09 14:32:15codememory search "where is the auth logic?"
# Expected output:
# Found 3 result(s):
#
# 1. **authenticate** [`src/auth.py:authenticate`] - Score: 0.89
# def authenticate(username, password):
# """Verify user credentials and return session token"""...
#
# 2. **login** [`src/controllers/user.py:login`] - Score: 0.82
# async def login(request):
# """Handle user login requests"""...codememory serve
# Output: 🧠 Starting MCP Interface on port 8000See MCP_INTEGRATION.md for client configuration.
Symptom:
ModuleNotFoundError: No module named 'codememory'
Solution:
# Reinstall the package
pip install --force-reinstall codememory
# Or if installing from source
pip install -e .Symptom:
ServiceUnavailable: Unable to connect to bolt://localhost:7687
Solutions:
- Check if Neo4j is running:
# Docker
docker ps | grep neo4j
# System service
systemctl status neo4j # Linux
brew services list # macOS- Start Neo4j:
# Docker
docker-compose up -d neo4j
# Manual
docker start agentic-memory-neo4j- Verify ports:
# Check if port 7687 is listening
netstat -an | grep 7687 # Linux/macOS
netstat -an | findstr 7687 # Windows- Check firewall:
- Ensure port 7687 (Bolt) and 7474 (HTTP) are not blocked
Symptom:
Error: The OPENAI_API_KEY environment variable is not set
Solutions:
- Set environment variable:
# Linux/macOS
export OPENAI_API_KEY="sk-your-key-here"
# Windows (Command Prompt)
set OPENAI_API_KEY=sk-your-key-here
# Windows (PowerShell)
$env:OPENAI_API_KEY="sk-your-key-here"- Add to
.envfile:
echo "OPENAI_API_KEY=sk-your-key-here" >> .env- Verify API key is valid:
curl https://api.openai.com/v1/models \
-H "Authorization: Bearer $OPENAI_API_KEY"Symptom:
Java heap space error during Neo4j operations
Solutions:
- Increase Neo4j heap size:
# Docker: Add to docker-compose.yml
environment:
- NEO4J_dbms_memory_heap_max__size=4G
# Manual: Edit conf/neo4j.conf
dbms.memory.heap.max_size=4G- Index in batches:
# Use --watch for incremental indexing instead of full re-index
codememory watchSymptom:
No parser found for .go files
Current Support:
- Python (.py)
- JavaScript (.js, .jsx)
- TypeScript (.ts, .tsx)
Solutions:
- Only index supported file types (configure in
.codememory/config.json) - Contribute language support (see CONTRIBUTING.md)
Symptoms:
- Indexing takes >10 minutes
- High CPU/memory usage
Solutions:
- Reduce file extensions:
{
"indexing": {
"extensions": [".py"] // Only Python files
}
}- Increase ignore_dirs:
{
"indexing": {
"ignore_dirs": [
"node_modules",
"__pycache__",
".git",
"dist",
"build",
".venv",
"venv",
"tests", // Add test directories
"migrations" // Add migration files
]
}
}- Use incremental updates:
# Instead of full re-index
codememory watch # Only processes changed filesSymptom:
Permission denied: /data/neo4j
Solution:
# Fix volume permissions
sudo chown -R 7474:7474 /var/lib/docker/volumes/neo4j_data
# Or recreate volumes
docker-compose down -v
docker-compose up -dSymptom: Claude Desktop/Cursor can't connect to the MCP server.
Solutions:
- Check server is running:
codememory serve
# Should see: 🧠 Starting MCP Interface on port 8000- Verify port is not in use:
# Linux/macOS
lsof -i :8000
# Windows
netstat -an | findstr 8000- Check client configuration:
- See MCP_INTEGRATION.md for proper setup
If none of these solutions work:
- Check logs:
# Neo4j logs
docker-compose logs neo4j
# Agentic Memory logs
codememory --verbose- Enable debug logging:
export LOG_LEVEL=DEBUG
codememory index- Report issues:
- GitHub Issues: https://github.com/jarmen423/agentic-memory/issues
- Include: OS, Python version, Neo4j version, error messages
After successful installation:
- Read MCP_INTEGRATION.md - Connect to AI clients
- Read ARCHITECTURE.md - Understand the system design
- See examples/ - Usage examples and prompts
- Join the community - Share feedback and contribute
# Install
pipx install codememory
# Initialize
codememory init
# Status
codememory status
# Index
codememory index
# Watch
codememory watch
# Search
codememory search "query"
# MCP Server
codememory serveFor CLI command details, see API.md.