Observed since 20 Oct, 22:13 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Agentic Memory: Structural Code Graph with Neo4j and MCP
https://github.com/jarmen423/codememory
Active, Structural Memory System for AI Coding Agents
Agentic Memory is not just "RAG" for code. It is an active, structural memory layer that understands code relationships (dependencies, imports, inheritance), not just text similarity.
Core Value Prop: "Don't let your Agent code blind. Give it a map."
| Feature | Description |
|---|---|
| 📊 Structural Graph | Understands imports, dependencies, call graphs - not just text similarity |
| 🔍 Semantic Search | Vector embeddings with contextual prefixing for accurate results |
| ⚡ Real-time Sync | File watcher automatically updates the graph as you code |
| 🧬 Git Graph (Opt-in) | Adds commit/author/file-version history in the same Neo4j DB with separate labels |
| 🤖 MCP Protocol | Drop-in integration with Claude, Cursor, Windsurf, and any MCP-compatible AI |
| 💥 Impact Analysis | See the blast radius of changes before you make them |
# Recommended: Use pipx for isolated global installation
pipx install agentic-codememory
# Or with uv tooling
uv tool install agentic-codememory
uvx codememory --help
# Or use pip in a virtualenv
pip install agentic-codememory
cd /path/to/your/repo
codememory init
The interactive wizard will guide you through:
That's it! Your repository is now indexed and ready for AI agents.
# Show repository status and statistics
codememory status
# One-time full index (e.g., after major changes)
codememory index
# Watch for changes and continuously update
codememory watch
# Start MCP server for AI agents
codememory serve
# Test semantic search
codememory search "where is the auth logic?"
# Git graph (rollout build)
codememory git-init --repo /absolute/path/to/repo
codememory git-sync --repo /absolute/path/to/repo --full
codememory git-status --repo /absolute/path/to/repo --json
Git graph command details and rollout notes: docs/GIT_GRAPH.md
Agentic Memory now supports SQLite telemetry for MCP tool calls plus manual post-response labeling as prompted or unprompted.
codememory --prompted "check our auth"
codememory --unprompted "check our auth"
Full workflow and options: docs/TOOL_USE_ANNOTATION.md
┌─────────────────┐ Watches ┌──────────────────┐
│ User Repository│ ───────────────> │ Ingestion Service│
│ │ │ (Observer) │
└─────────────────┘ └────────┬─────────┘
│ Writes
▼
┌──────────────┐
│ Neo4j │
│ Cortex │
└──────┬───────┘
│ Reads
▼
┌─────────────────┐ MCP Protocol ┌──────────────────┐
│ AI Agent / │ <───────────────> │ MCP Server │
│ Claude │ │ (Interface) │
└─────────────────┘ └──────────────────┘
| Component | Role | Description |
|---|---|---|
Observer (watcher.py) | The "Writer" | Watches filesystem changes and keeps the graph in sync |
Graph Builder (graph.py) | The "Mapper" | Parses code with Tree-sitter, builds Neo4j graph with embeddings |
MCP Server (app.py) | The "Interface" | Exposes high-level skills to AI agents via MCP protocol |
| Tool | Description |
|---|---|
search_codebase(query, limit=5, domain="code") | Semantic search for code, git, or hybrid domain routing |
get_file_dependencies(file_path, domain="code") | Returns imports and dependents for a file |
identify_impact(file_path, max_depth=3, domain="code") | Blast radius analysis for changes |
get_file_info(file_path, domain="code") | File structure overview (classes, functions) |
create_memory_entities(entities) | Create or update agent-authored memory nodes in Neo4j |
create_memory_relations(relations) | Create typed relationships between memory nodes |
add_memory_observations(observations) | Append observation strings to existing memory nodes |
delete_memory_entities(entity_names) | Delete memory nodes by name |
delete_memory_relations(relations) | Delete typed relationships between memory nodes |
delete_memory_observations(observations) | Remove observation strings from memory nodes |
search_memory_nodes(query, limit=5) | Search memory nodes by name, type, and observations |
read_memory_graph() | Read a summary of the current memory graph |
get_git_file_history(file_path, limit=20, domain="git") | File-level commit history and ownership signals (git rollout) |
get_commit_context(sha, include_diff_stats=true) | Commit metadata and change statistics (git rollout) |
find_recent_risky_changes(path_or_symbol, window_days, domain="hybrid") | Recent high-risk changes using hybrid signals (git rollout) |
Note:
domainrouting and git-domain tools are part of the git graph rollout. If they are missing in your installed build, use code-domain tools only and upgrade to a git-enabled release.
Current recommendation policy is explicit:
mcp_native integration for production reliability.skill_adapter workflow for shell/script-driven operators.skill_adapter becomes first-class only after parity evidence
is captured versus mcp_native across success rate, latency, token cost, retries,
and operator steps.Reference docs and evaluation artifacts:
# Start Neo4j
docker-compose up -d neo4j
# Neo4j will be available at:
# HTTP: http://localhost:7474
# Bolt: bolt://localhost:7687
# Username: neo4j
# Password: password (change this in production!)
Get a free instance at neo4j.com/cloud/aura/
Per-repository configuration is stored in .codememory/config.json:
{
"neo4j": {
"uri": "bolt://localhost:7687",
"user": "neo4j",
"password": "password"
},
"openai": {
"api_key": "sk-..." // Optional - can use OPENAI_API_KEY env var
},
"indexing": {
"ignore_dirs": ["node_modules", "__pycache__", ".git"],
"extensions": [".py", ".js", ".ts", ".tsx", ".jsx"],
"include_paths": ["systemd/AGENTS.md", "docs/runbooks/*.md"]
}
}
include_paths is an explicit allowlist for files that should be indexed even when their
extension is not in indexing.extensions. This is useful for selectively indexing a few
high-value docs such as AGENTS.md, runbooks, or systemd unit companions without turning
on all Markdown files.
Note: .codememory/ is gitignored by default to prevent committing API keys.
# Clone the repository
git clone https://github.com/jarmen423/codememory.git
cd codememory
# Install in editable mode
pip install -e .
# Run the init wizard in any repo
codememory init
# Install in editable mode
pip install -e .
# Run type checking (when mypy is configured)
mypy src/codememory
# Run tests (when added)
pytest
| Entity | Description | Relationships |
|---|---|---|
| Files | Source code files | [:DEFINES]→ Functions/Classes, [:IMPORTS]→ Files |
| Functions | Function definitions | [:CALLS]→ Functions, [:HAS_METHOD]← Classes |
| Classes | Class definitions | [:HAS_METHOD]→ Methods |
| Chunks | Semantic embeddings | [:DESCRIBES]→ Functions/Classes |
{
"mcpServers": {
"agentic-memory": {
"command": "codememory",
"args": ["serve", "--repo", "/absolute/path/to/your/project"]
}
}
}
{
"mcpServers": {
"agentic-memory": {
"command": "codememory",
"args": ["serve", "--repo", "/absolute/path/to/your/project", "--port", "8000"]
}
}
}
Add to your MCP configuration file.
Note:
--reporequires the upcoming release that adds explicit repo targeting forserve. If your installed version does not support--repo, use your client'scwdsetting (if supported) or launch via a wrapper script that runscd /absolute/path/to/project && codememory serve.
MIT License - see LICENSE file for details.
Contributions welcome! Please see TODO.md for the roadmap.
pypistats · 47 observations shown. Missing days are unknown. Source category: overall: without mirrors.
| Date / source period | Value | Observed at |
|---|---|---|
| 2026-10-20 – 2026-10-20 | 2 | 2026-10-21T13:58:17.2329997Z |
| 2026-10-19 – 2026-10-19 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-10-18 – 2026-10-18 | 4 | 2026-10-21T13:58:17.2329997Z |
| 2026-10-17 – 2026-10-17 | 9 | 2026-10-21T13:58:17.2329997Z |
| 2026-10-16 – 2026-10-16 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-10-15 – 2026-10-15 | 4 | 2026-10-21T13:58:17.2329997Z |
| 2026-10-14 – 2026-10-14 | 7 | 2026-10-21T13:58:17.2329997Z |
| 2026-10-13 – 2026-10-13 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-10-12 – 2026-10-12 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-10-11 – 2026-10-11 | 3 | 2026-10-21T13:58:17.2329997Z |
| 2026-10-10 – 2026-10-10 | 9 | 2026-10-21T13:58:17.2329997Z |
| 2026-10-09 – 2026-10-09 | 2 | 2026-10-21T13:58:17.2329997Z |
| 2026-10-08 – 2026-10-08 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-10-06 – 2026-10-06 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-10-02 – 2026-10-02 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-30 – 2026-09-30 | 2 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-28 – 2026-09-28 | 2 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-27 – 2026-09-27 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-26 – 2026-09-26 | 3 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-25 – 2026-09-25 | 5 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-23 – 2026-09-23 | 5 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-22 – 2026-09-22 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-21 – 2026-09-21 | 2 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-20 – 2026-09-20 | 8 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-19 – 2026-09-19 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-17 – 2026-09-17 | 6 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-16 – 2026-09-16 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-10 – 2026-09-10 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-08 – 2026-09-08 | 3 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-07 – 2026-09-07 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-06 – 2026-09-06 | 4 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-04 – 2026-09-04 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-09-01 – 2026-09-01 | 3 | 2026-10-21T13:58:17.2329997Z |
| 2026-08-31 – 2026-08-31 | 2 | 2026-10-21T13:58:17.2329997Z |
| 2026-08-28 – 2026-08-28 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-08-26 – 2026-08-26 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-08-24 – 2026-08-24 | 6 | 2026-10-21T13:58:17.2329997Z |
| 2026-08-23 – 2026-08-23 | 3 | 2026-10-21T13:58:17.2329997Z |
| 2026-08-22 – 2026-08-22 | 2 | 2026-10-21T13:58:17.2329997Z |
| 2026-08-17 – 2026-08-17 | 2 | 2026-10-21T13:58:17.2329997Z |
| 2026-08-14 – 2026-08-14 | 4 | 2026-10-21T13:58:17.2329997Z |
| 2026-08-09 – 2026-08-09 | 3 | 2026-10-21T13:58:17.2329997Z |
| 2026-08-06 – 2026-08-06 | 3 | 2026-10-21T13:58:17.2329997Z |
| 2026-08-04 – 2026-08-04 | 2 | 2026-10-21T13:58:17.2329997Z |
| 2026-08-02 – 2026-08-02 | 1 | 2026-10-21T13:58:17.2329997Z |
| 2026-07-27 – 2026-07-27 | 2 | 2026-10-21T13:58:17.2329997Z |
| 2026-07-23 – 2026-07-23 | 5 | 2026-10-21T13:58:17.2329997Z |
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.2.1 | 8 Apr 2026 | 18 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 22:13 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:2a29a54a6a5c1a7ff4d9073b8b5e5b46ace91ff573e9d8cef2c12e4eda6165f2