Skip to main content

High-performance memory database for LLMs

Project description

🧠 Engram: Fast, Local-First Memory for LLMs

Engram is a high-performance, local-first memory database designed specifically for AI agents and RAG (Retrieval-Augmented Generation) applications. It is built in Rust for speed and provides native Python bindings for ease of use.

Zero Config. Zero API Keys. Zero Latency.

✨ Features

  • 🚀 Blazing Fast: Core engine written in Rust with HNSW indexing for sub-10ms retrieval.
  • 🔒 Privacy First: Everything stays on your machine. No data is sent to external embedding providers.
  • 📦 All-in-One: Integrated vector storage, metadata management, and local embeddings (via FastEmbed).
  • 🔋 Battery Included: Auto-downloads and manages optimized ONNX embedding models locally.

🛠️ Installation

# Clone the repository
git clone https://github.com/yourusername/engram
cd engram

### Python
```bash
pip install maturin
maturin develop --features python

Node.js

npx napi build --release --features node

📖 Quick Start (RAG in 30 Seconds)

import engram

# 1. Initialize the database (Saves to a local folder)
db = engram.EngramDB("./my_knowledge_base")

# 2. Store documents with metadata
db.store(
    "Engram is a memory database written in Rust.", 
    {"source": "docs", "priority": "high"}
)

# 3. Recall based on semantic meaning
results = db.recall("How is Engram built?", limit=1)

for content, metadata in results:
    print(f"Retrieved: {content}")
    print(f"Metadata: {metadata}")

🏗️ Architecture

Engram uses a custom binary storage engine called Mnemo combined with HNSW (Hierarchical Navigable Small World) for ultra-fast vector search.

  1. Mnemo Engine: A low-level, append-only binary log that ensures your data is persisted safely to disk.
  2. HNSW Index: An in-memory graph structure rebuilt from disk on startup for lightning-fast nearest neighbor search.
  3. Local Embeddings: Uses fastembed-rs to run optimized ONNX models like all-MiniLM-L6-v2 locally on your CPU/GPU.

🤝 Contributing

We welcome contributions! Please feel free to submit a Pull Request.

📄 License

MIT License. See LICENSE for details.

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

engram_db-0.1.0.tar.gz (47.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

engram_db-0.1.0-cp313-cp313-win_amd64.whl (9.4 MB view details)

Uploaded CPython 3.13Windows x86-64

File details

Details for the file engram_db-0.1.0.tar.gz.

File metadata

  • Download URL: engram_db-0.1.0.tar.gz
  • Upload date:
  • Size: 47.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for engram_db-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3cc3dcad5ba4f771cc453fdc4b8699eb5e706976faa4e5fc979d3ae8bc9e202a
MD5 64d7ae5ff0711a5cd965d02e90b5c330
BLAKE2b-256 e2737ef12d98025b0f89baa3941e687d72a6a44eee088add933eec7182166e89

See more details on using hashes here.

File details

Details for the file engram_db-0.1.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for engram_db-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e13c71604d7eb81aed0fc92c527862bf4a080c12ae243fe6a9309b0b6fe6b678
MD5 2a0cf4121bb1b4349fb7d77b4e403e33
BLAKE2b-256 506cc35560bb61ae55d8c167a06f40f70cdef0c54e1bbeba44d4fef42db5fae7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page