Skip to main content

Zero-server, in-process agentic memory system for LLM agents — Zvec + SQLite + LangGraph

Project description

Mimir — The Well of Knowledge, Rewritten

Mimir

The Well of Knowledge, Rewritten.

A zero-server, in-process agentic memory system for LLM agents.

📚 Prospectus | 🐍 PyPI | 📦 npm | 🏗️ Architecture | ⚡ Quickstart

Mimir is an open-source, in-process memory system for AI agents — combining dense vector search, bitemporal knowledge graphs, and autonomous tool-calling into a single Python process. Built on Zvec (Alibaba's battle-tested vector engine) and SQLite, it delivers production-grade semantic memory with temporal reasoning, zero infrastructure, and minimal setup.

💫 Features

  • Bitemporal Memory: Facts are never deleted. Old records are time-capped, preserving full history. Ask "Where does John live?" and "Where did John live last month?" from the same dataset.
  • In-Process Vector Search: Zvec runs as a C-extension inside your Python process. Sub-millisecond search, zero network hops.
  • Fully Local: Embeddings via HuggingFace BGE run on CPU. Storage is file-based. No cloud, no Docker, no external databases.
  • Agent-Ready: LangGraph state graph with archive_memory and search_memory tools, ready to bind to any OpenAI-compatible LLM.
  • REST API: Built-in FastAPI server for JS/TS and cross-language access via a single mimir-server command.
  • Runs Anywhere: As an in-process library, Mimir runs wherever your code runs — notebooks, servers, CLI tools, or edge devices.

📦 Installation

Python

pip install mimir-memory

With Zvec (requires Python 3.10–3.12):

pip install mimir-memory[zvec]

With REST server:

pip install mimir-memory[server]

Node.js

npm install mimir-memory

Note: The npm package is a TypeScript SDK that connects to the Mimir REST server. Start the server first with mimir-server.

✅ Supported Platforms

  • macOS (ARM64 — Apple Silicon optimized)
  • Linux (x86_64, ARM64)

⚡ One-Minute Example

Python (in-process)

from mimir import MimirStorage, create_agent
from langchain_core.messages import HumanMessage

# Initialize storage (creates ./mimir_data with Zvec + SQLite)
storage = MimirStorage()

# Create a LangGraph agent with memory tools bound
graph = create_agent(storage, api_key="sk-...", base_url="https://...")

# Chat — the agent autonomously archives and retrieves memories
result = graph.invoke({"messages": [
    HumanMessage(content="My name is John and I live in Chennai.")
]})
print(result["messages"][-1].content)

Node.js / TypeScript

import { Mimir } from "mimir-memory";

const mimir = new Mimir(); // connects to http://localhost:8484

await mimir.archive({
  content: "John lives in London",
  source: "user",
  relation: "lives_in",
  target: "London",
  scope: "user",
});

const result = await mimir.search({ query: "Where does John live?" });
console.log(result);

🏗️ Architecture

┌──────────────────────────────────────────────────┐
│  L1 & L2: Tools (archive_memory, search_memory)  │
├──────────┬───────────────────────────────────────┤
│          │  L3: Bitemporal Knowledge Engine       │
│  Zvec    │  ┌──────────────────────────────────┐  │
│  (dense  │  │  SQLite (bitemporal_graph)        │  │
│  vectors)│  │  valid_from / valid_to timestamps │  │
│          │  └──────────────────────────────────┘  │
├──────────┴───────────────────────────────────────┤
│  L4: Procedural Optimizer (trajectory learning)   │
└──────────────────────────────────────────────────┘
Layer Component Role
L1 & L2 Tools archive_memory and search_memory — the agent's interface to storage
L3 Storage Zvec (dense vectors) + SQLite (bitemporal graph edges)
L4 Optimizer Post-session trajectory analysis and rule extraction

📊 Stack

Component Technology
Vector Storage Zvec v0.2.0 (Alibaba Proxima)
Graph/Relational SQLite3 (Python stdlib)
Embeddings BAAI/bge-small-en-v1.5 (384-dim, local, CPU)
Agent Framework LangGraph + LangChain Core
REST Server FastAPI + Uvicorn
LLM Any OpenAI-compatible endpoint

🤝 Community

  • 📄 Full Prospectus — Architecture deep-dive, competitive analysis vs Letta/Mem0/Zep/LangMem, and Zvec integration details
  • 🐛 Issues — Bug reports and feature requests

❤️ Contributing

We welcome contributions! Whether you're fixing a bug, adding a feature, or improving documentation — your help makes Mimir better for everyone.

📜 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

mimir_memory-0.3.0.tar.gz (455.0 kB view details)

Uploaded Source

Built Distribution

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

mimir_memory-0.3.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file mimir_memory-0.3.0.tar.gz.

File metadata

  • Download URL: mimir_memory-0.3.0.tar.gz
  • Upload date:
  • Size: 455.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for mimir_memory-0.3.0.tar.gz
Algorithm Hash digest
SHA256 769a1cbf00351ec61440826aea807f3a45642fcd731f40015c78a585fa00ed70
MD5 5c63904f1a0812fea59c4fdc7194ee01
BLAKE2b-256 0cbc64ba7f61527321b8cdef5b1c859242be87d3316c15bb25f369cd2a46e64e

See more details on using hashes here.

File details

Details for the file mimir_memory-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mimir_memory-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for mimir_memory-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 986c5de8e7c29f3859b958f5cf0c44ce29d4d5ca2319754d7f9270a47fe3982d
MD5 75e27928444b17e64fb6843d9c74f32b
BLAKE2b-256 10efdcd95e3336ab686fe377a4810c2ea9ab1d91389390f1cbb27577ecce0ada

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