Engrava

RAG & Memory 💻 Python ⚖️ MIT 🟢 Actively maintained
5 stars

Engrava is a standalone embedded database for AI agent memory, built on SQLite. It provides thought CRUD, edge-based knowledge graphs, embedding-based similarity search, full-text search, and a declarative extension system, all in a single package with no external service dependencies. It is for developers building AI agents or applications that need persistent, searchable memory with graph relationships.

✨ Key features

  • Thought CRUD with lifecycle management and frozen Pydantic models.
  • Edge-based knowledge graph with typed, weighted edges.
  • Hybrid search combining vector similarity, FTS5/BM25, recency, priority, and graph connectivity.
  • Pluggable embedding providers: local, OpenAI-compatible, Ollama, HuggingFace, or custom callable.
  • MindQL query language for declarative graph queries.
  • Extension system via hooks; dreaming and memory hygiene for consolidation and forgetting.

🎯 Use cases

  • AI agent persistent memory
  • Personal knowledge base
  • Conversation storage with semantic search
  • Research notes with associative linking
  • Any application needing a thought-graph with embeddings

📦 Installation

🧰 Requirements: Python with asyncio and aiosqlite; optional extras for vector search and embedding providers; no external services required.

pip install engrava

Optional extras:

pip install 'engrava[vec]'                # sqlite-vec vector search backend
pip install 'engrava[embeddings-local]'   # sentence-transformers embeddings (local model)
pip install 'engrava[embeddings-openai]'  # OpenAI-compatible embeddings API
pip install 'engrava[embeddings-ollama]'  # Ollama local embeddings server
pip install 'engrava[embeddings-hf]'      # HuggingFace Inference API embeddings

🚀 Usage

import asyncio
import aiosqlite
from engrava import SqliteEngravaCore

async def main() -> None:
    async with aiosqlite.connect(":memory:") as conn:
        conn.row_factory = aiosqlite.Row
        store = SqliteEngravaCore(conn)
        await store.ensure_schema()

        await store.remember("Python is great for AI agents")
        await store.remember("SQLite needs no server")

        result = await store.recall("what language is good for agents?")
        for thought_id, score in result.results:
            thought = await store.get_thought(thought_id)
            if thought is not None:
                print(f"{thought.essence}  (score: {score:.3f})")

asyncio.run(main())

⚠️ Good to know

The tamper-evident journal is not a whole-database audit (embeddings and action creation are not covered); dreaming and memory hygiene are no-LLM but may not suit all use cases.

❓ FAQ

Does Engrava require an external database or service?

No, Engrava is a standalone embedded database built on SQLite with zero external service dependencies.

How do I enable vector search?

Install the optional extra with pip install 'engrava[vec]' to use the sqlite-vec backend.

Can I use Engrava with an LLM?

Engrava does not require an LLM; dreaming and memory hygiene are no-LLM. You can optionally use embedding providers that call external APIs.

Is there a CLI for Engrava?

Yes, Engrava provides a CLI for commands like info, query, snapshot, restore, gc, migrate, and export.

📊 Repository

Stars★ 5
Forks🍴 0
Open issues🐛 2
Last commit🕒 Sep 2, 2026
Created📅 Jun 2026
Language💻 Python
License⚖️ MIT
Websiteengrava.ai

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.