Push your codebase to a graph DB and query it with natural language
Project description
memory-neo/docs/README.md
Path: docs/README.md
Purpose: User-facing documentation โ install, usage, deployment
๐ง memory-neo
Push your codebase to a graph database. Query it with natural language.
pip install memory-neo
cd your-project/
memory-neo push
memory-neo query "show all auth functions"
memory-neo context parse_directory
How it works
- Push โ
memory-neo pushscans your project, extracts files and Python functions via AST, and sends the structure to a hosted Memgraph graph database. - Query โ
memory-neo query "..."converts your question to Cypher via Claude, runs it against your graph, and prints results with code highlighting. - Context โ
memory-neo context <name>fetches a function or file as prompt-ready code you can paste into any LLM.
Install
pip install memory-neo
Python 3.9+ required.
Authentication
Get an API key at memory-neo.dev, then:
memory-neo login
# Paste your API key when prompted
# Saved to ~/.memoryneo/config.json
Commands
memory-neo push
Scan the current directory and push its structure to Memgraph.
memory-neo push # use directory name as project name
memory-neo push my-project # explicit project name
memory-neo push --dir ./src # scan a subdirectory
memory-neo push --dry-run # scan only, don't push
What gets indexed:
- Files:
.py.js.jsx.ts.tsx.html.md.txt - Python: full AST extraction โ function names, line numbers, args, docstrings, code
- Other: file name, path, content, line count
Ignored by default (via memIgnore):
.venv/,node_modules/,__pycache__/,.git/,*.pyc,.env, and more
Custom ignore: place a memIgnore file in your project root (same syntax as .gitignore).
memory-neo query
Ask a natural language question about your indexed codebase.
memory-neo query "show all auth functions"
memory-neo query "which files import httpx"
memory-neo query "list all Python files"
memory-neo query "how many functions are in each file"
memory-neo query "show the parse_directory function"
memory-neo query --project my-project "show all classes"
memory-neo query --raw "..." # print raw JSON
memory-neo query --context "..." # dump results as prompt-ready context block
memory-neo query # interactive mode
memory-neo context
Fetch the raw code of a function or file โ ready to paste into a prompt.
memory-neo context parse_directory # fetch function by name
memory-neo context memory_neo/main.py # fetch file by path
memory-neo context login --type function # force function lookup
memory-neo context main.py --copy # copy to clipboard
Ignore patterns (memIgnore)
Place a memIgnore file in your project root to control what gets scanned.
Uses the same syntax as .gitignore:
# Folders
.venv/
node_modules/
dist/
# Wildcards
*.log
*.tmp
*.pyc
# Files
.env
secrets.json
If no memIgnore is found in your project, the package default is used (covers most common cases).
Self-hosting
You can run the entire backend yourself.
Requirements
- Fly.io account
- Supabase (or any PostgreSQL) account
- Anthropic API key
Deploy
# 1. Deploy Memgraph
fly deploy --config deploy/fly.memgraph.toml
# 2. Create persistent volume
fly volumes create memgraph_data --size 20 --region cdg --app memory-neo-graph
# 3. Init Memgraph schema
fly ssh console --app memory-neo-graph
# Inside pod:
cat /init.cypher | mgconsole
# 4. Set API secrets
fly secrets set \
ANTHROPIC_API_KEY=sk-ant-... \
DATABASE_URL=postgresql://... \
API_SECRET_SALT=$(openssl rand -base64 32) \
--app memory-neo-api
# 5. Deploy API
fly deploy --config deploy/fly.api.toml
# 6. Run Prisma migrations
fly ssh console --app memory-neo-api
# Inside pod:
prisma migrate deploy --schema=schema.prisma
Point CLI to your instance
memory-neo login --api-url https://your-api.fly.dev
Project structure
memory-neo/
โโโ memory_neo/ โ Python package (pip install memory-neo)
โ โโโ cli/ โ push, query, context, login commands
โ โโโ core/ โ scanner, AST extractor, ignore patterns
โ โโโ graph/ โ HTTP client to backend
โ โโโ nlp/ โ result formatter
โ โโโ utils/ โ config, display helpers
โโโ api/ โ FastAPI backend (Fly.io)
โ โโโ routes/ โ push, query, context, auth endpoints
โ โโโ services/ โ graph (Memgraph), nlp (Claude), auth
โ โโโ db/ โ schema.prisma (PostgreSQL)
โโโ deploy/ โ Dockerfiles, fly.toml configs, init.cypher
โโโ docs/ โ this file
Tech stack
| Layer | Technology |
|---|---|
| CLI package | Python + Click + Rich |
| Backend | FastAPI on Fly.io |
| Graph DB | Memgraph on Fly.io (Bolt protocol) |
| Postgres | Supabase |
| NLP engine | Claude API (claude-sonnet) |
| Auth | API key (SHA-256 hashed) |
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file memory_neo-0.1.3.tar.gz.
File metadata
- Download URL: memory_neo-0.1.3.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3941e6791b4b00f1a0c56f4a555ae71ad39a44cace75fab4cdabd6ad0a7fc95a
|
|
| MD5 |
2a0e6bbb78cfde719587d1f5fed6cfdf
|
|
| BLAKE2b-256 |
68b301273bb77b499e9d322aa43929b06cc49128829fc4ad24cd44e4372c3f99
|
File details
Details for the file memory_neo-0.1.3-py3-none-any.whl.
File metadata
- Download URL: memory_neo-0.1.3-py3-none-any.whl
- Upload date:
- Size: 23.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfc231275f3a32b544195c8f910a6d1f485bdd54a9fa3ea22dc436b7912a2526
|
|
| MD5 |
df8ad6e68306cb2794bbcce43a709194
|
|
| BLAKE2b-256 |
e3736745f0fa513c63b8aa3240c48c6fefd26412c50a04fcdc5aab72c7a6ac59
|