Skip to main content

engramedb

PyPI Version License: MIT

EngramDB is a high-performance, real-time, code-native graph database engine written in Rust with native PyO3 Python bindings.

Designed for AI agentic tools, MCP servers, code search engines, and static analysis tools, EngramDB compiles AST nodes, function calls, class inheritance, and file dependencies into an in-memory Compressed Sparse Row (CSR) graph for microsecond-latency impact analysis and graph querying.


Key Features

  • ⚡ Ultra-Fast CSR Graph Traversal: Bidirectional dual CSR (execution vs full-dependency) for sub-millisecond blast_radius / recursive_callees.
  • 🧵 Thread-Safe Architecture: Arc<RwLock<InnerEngineState>> with read()/write() and snapshot_loaded warm-start guard.
  • 🔍 Rich AST Metadata Indexing: Functions/classes/files/folders/routes with signatures, decorators, inherits, imports, line ranges + extra_json (python_import_bindings, python_receiver_types, python_shadowed_names for Python contextual calls v3).
  • 🛡️ Blast Radius & Impact Analysis: get_callers/get_callees = execution only; get_dependencies/get_dependents = full structural + execution.
  • 💾 Zero-Copy Persistence: Binary snapshot v3 (EGRM + typed resolved_call_edges/execution_edges/generated_execution_edges/structural_edges).
  • 🐍 Pre-compiled Python Wheels: Linux/macOS/Windows, CPython 3.10–3.13.

Installation

pip install engramedb

Quick Start

import engramdb

# 1. Initialize engine with workspace storage path
engine = engramdb.PyMetadataEngine("/path/to/workspace")

# 2. Index AST nodes (calls + extra metadata)
engine.add_node(
    "services.py:create_sale",
    "Function",
    "create_sale",
    "services.py",
    _extra={
        "signature": "def create_sale(user, item_id):",
        "docstring": "Creates a new sales transaction.",
        "decorators": ["transaction.atomic"],
        "lines_start": 10,
        "lines_end": 25,
    }
)
engine.add_node("inventory.py:deduct_stock", "Function", "deduct_stock", "inventory.py")

# 3. Wire edges — execution vs structural are typed (v3 snapshot)
engine.add_edge("services.py:create_sale", "inventory.py:deduct_stock")  # 2 args: execution/call edge
engine.add_structural_edge("services.py:create_sale", "services.py")      # containment / import / ORM

# 4. Build CSR (dual graphs: execution + full dependencies)
engine.build()

# 5. Typed traversal
print(engine.get_callees("services.py:create_sale"))      # execution only
print(engine.get_dependencies("services.py:create_sale"))  # execution + structural
print(engine.blast_radius("inventory.py:deduct_stock", 3))
print(engine.search("create_sale"))

License

Distributed under the MIT License.

Metadata

Release files for engramedb 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for engramedb 1.1.2
File Size Uploaded Provenance Actions
engramedb-1.1.2.tar.gz 31.1 kB Without provenance Details for engramedb-1.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for engramedb 1.1.2
File Interpreter ABI Platform Actions
engramedb-1.1.2-cp310-cp310-manylinux_2_34_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.34+ x86-64 Details for engramedb-1.1.2-cp310-cp310-manylinux_2_34_x86_64.whl

Total release size: 501.6 kB

Release files / engramedb-1.1.2.tar.gz

Download URL engramedb-1.1.2.tar.gz
Size 31.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b27ac540ac45b3c97f7728c2282466aaacdc1256b072314bfe94747d94ef3ee5
BLAKE2b-256 checksum
How to use checksums
8c44811adaaa185e40d015900b8d5c5bb0eeabd9b144c5b7f392c04be0fdebe8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.13.1

Release files / engramedb-1.1.2-cp310-cp310-manylinux_2_34_x86_64.whl

Download URL engramedb-1.1.2-cp310-cp310-manylinux_2_34_x86_64.whl
Size 470.5 kB
Tags CPython 3.10 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
499492f65483e8ee7a7fd7f06cdede4e828c45821d67db15407fb8ca4605b928
BLAKE2b-256 checksum
How to use checksums
7e28569061a1bb606e2e57cd65e26f4591241caca5ee101aecc0861b83f42f0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.13.1

Security for engramedb 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page