Graph-based long-term memory framework for AI agents (SQLite default, Neo4j optional)
Project description
Engrama
Graph-based long-term memory framework for AI agents.
Engrama gives any AI agent persistent, structured memory backed by a knowledge graph. Instead of flat key-value stores or opaque vector databases, Engrama stores entities, observations, and relationships — and lets agents traverse that graph to reason about their accumulated knowledge.
Two backends are first-class:
- SQLite +
sqlite-vec(default since 0.9) — single file, zero external services,git clone+uv syncand you're running (Engrama is not yet on PyPI; install from source). - Neo4j 5.26 LTS (opt-in) — for multi-process production setups, large-scale vector search, or teams that already use Cypher.
The data model is identical on both. See docs/backends.md for a full decision guide; the rest of this README assumes the SQLite default.
Inspired by Karpathy's second-brain concept, but built for agents instead of humans — and with graphs instead of wikis.
Why graphs?
| Flat JSON / KV | Vector DB | Engrama (Graph) | |
|---|---|---|---|
| Relationship queries | ❌ | ❌ | ✅ native |
| Scales to 10k+ memories | ❌ slow | ✅ | ✅ |
| Works without embeddings | ✅ | ❌ | ✅ (optional) |
| Local-first / private | ✅ | depends | ✅ |
| Zero external services | ✅ | ❌ | ✅ (SQLite) |
| "What projects use FastMCP?" | full scan | approximate | 1-hop traversal |
Prerequisites
You need two things to run on the default SQLite backend. Docker is not required unless you opt into Neo4j.
| Requirement | Version | How to check | Install guide |
|---|---|---|---|
| Python | 3.11 or newer | python --version |
python.org/downloads |
| uv (Python package manager) | any recent | uv --version |
docs.astral.sh/uv |
Windows users: after installing Python, make sure "Add Python to PATH" is checked. After installing uv, you may need to restart your terminal.
Optional:
- Obsidian — for vault sync features.
- A local embedder for semantic search.
- Docker Desktop — only if you opt into the Neo4j backend.
Quick start (SQLite, zero-dep)
Step 1: Clone and install
git clone https://github.com/scops/engrama
cd engrama
uv sync
Step 2: Initialise the schema
uv run engrama init --profile developer
Step 3: Verify
uv run engrama verify
Step 4: Use it
A) From Python:
from engrama import Engrama
with Engrama() as eng:
eng.remember("Technology", "FastAPI", "High-performance async framework")
eng.associate("MyProject", "Project", "USES", "FastAPI", "Technology")
results = eng.search("microservices")
B) From the command line:
uv run engrama search "FastAPI"
uv run engrama reflect
Quick start (Neo4j, opt-in)
If you need multi-process writes, very large vector indexes, or an existing Cypher toolchain, install with the Neo4j extra:
git clone https://github.com/scops/engrama
cd engrama
uv sync --extra neo4j
Configure your credentials by copying .env.example to .env and setting GRAPH_BACKEND=neo4j. Start Neo4j with docker compose up -d, and then initialize the schema:
uv run engrama init --profile developer
uv run engrama verify
📚 Full Documentation
All further details, including MCP integration (Claude Desktop), Obsidian sync, Architecture, and the complete API Reference, are available in the official documentation.
Project details
Release history Release notifications | RSS feed
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 engrama-0.13.0.tar.gz.
File metadata
- Download URL: engrama-0.13.0.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d2aa70a6f21fba98fa8a05237fadceed2129a9833e835b39d00f74552b1cb12
|
|
| MD5 |
dd304de9da35c6477759cf09da710225
|
|
| BLAKE2b-256 |
ce13e786c9a51f7a0c06edd0210802cfc36e6f9c3d2f4a7e8232c69a3e4e37ff
|
Provenance
The following attestation bundles were made for engrama-0.13.0.tar.gz:
Publisher:
release.yml on scops/engrama
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
engrama-0.13.0.tar.gz -
Subject digest:
5d2aa70a6f21fba98fa8a05237fadceed2129a9833e835b39d00f74552b1cb12 - Sigstore transparency entry: 1660384180
- Sigstore integration time:
-
Permalink:
scops/engrama@a906b0d74492b155efad213d8b7bdc3df75d1ac1 -
Branch / Tag:
refs/tags/v0.13.0 - Owner: https://github.com/scops
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a906b0d74492b155efad213d8b7bdc3df75d1ac1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file engrama-0.13.0-py3-none-any.whl.
File metadata
- Download URL: engrama-0.13.0-py3-none-any.whl
- Upload date:
- Size: 223.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d306591b308b8bea54e4f722e1b19f9a48ef193e7f07b126b5662ea0117ca2c9
|
|
| MD5 |
5fa2a93a2d894a74c7efcd39dd7023f6
|
|
| BLAKE2b-256 |
28b6ebfd9410278e3e17efba05214ff3bc8d63a41278f5364854265e7569883f
|
Provenance
The following attestation bundles were made for engrama-0.13.0-py3-none-any.whl:
Publisher:
release.yml on scops/engrama
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
engrama-0.13.0-py3-none-any.whl -
Subject digest:
d306591b308b8bea54e4f722e1b19f9a48ef193e7f07b126b5662ea0117ca2c9 - Sigstore transparency entry: 1660384415
- Sigstore integration time:
-
Permalink:
scops/engrama@a906b0d74492b155efad213d8b7bdc3df75d1ac1 -
Branch / Tag:
refs/tags/v0.13.0 - Owner: https://github.com/scops
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a906b0d74492b155efad213d8b7bdc3df75d1ac1 -
Trigger Event:
push
-
Statement type: