Skip to main content

EverMem — md-first memory extraction framework (lightweight; single-user or small-team)

Project description

EverMem

md-first memory extraction framework for AI agents — lightweight, single-user or small-team.

License: Apache 2.0 Python 3.12+


What is EverMem

EverMem is an open-source Python framework that turns conversations / workflows / files into structured, retrievable, evolving long-term memory for AI agents. Designed for lightweight local deployments (personal agents, small teams, individual developers), with three core principles:

  1. Markdown as Source of Truth — All memory persists as plain .md files. Open, edit, grep, version with Git, view in Obsidian. No black-box database lock-in.
  2. Lightweight three-piece storageMarkdown files (truth) + SQLite (state/queue) + LanceDB (vector + BM25 + scalar). No MongoDB / Elasticsearch / Milvus / Redis / Kafka required.
  3. EverCore as pure algorithm library — Memory extraction algorithms are decoupled into a separate library; this project orchestrates and persists.

Architecture at a glance

┌───────────────────────────────────────────────┐
│  entrypoints/  (CLI + HTTP API)                │  presentation
├───────────────────────────────────────────────┤
│  service/      (use cases: memorize/retrieve)  │  application
├───────────────────────────────────────────────┤
│  memory/       (extract + search + cascade)    │  domain
├───────────────────────────────────────────────┤
│  infra/        (markdown / sqlite / lancedb)   │  infrastructure
└───────────────────────────────────────────────┘
        ↑                    ↑
   component/            core/
   (LLM/Embedding)       (observability/lifespan)

DDD 5 layers, single-direction dependency. See docs/architecture.md.

Quick start

Install as a package

uv pip install evermem               # or: pip install evermem

# Drop a .env in your working directory.
# OpenAI-protocol compatible — works with OpenAI, OpenRouter, vLLM, Ollama, ...
cat > .env <<'EOF'
# LLM
EVERMEM_LLM__MODEL=gpt-4o-mini
EVERMEM_LLM__API_KEY=sk-...
EVERMEM_LLM__BASE_URL=https://api.openai.com/v1

# Embedding
EVERMEM_EMBEDDING__MODEL=Qwen/Qwen3-Embedding-4B
EVERMEM_EMBEDDING__API_KEY=...
EVERMEM_EMBEDDING__BASE_URL=https://api.deepinfra.com/v1/openai

# Rerank
EVERMEM_RERANK__MODEL=Qwen/Qwen3-Reranker-4B
EVERMEM_RERANK__API_KEY=...
EVERMEM_RERANK__BASE_URL=https://api.deepinfra.com/v1/inference
EOF

evermem --help
evermem server start

For a step-by-step walkthrough (add a conversation → flush → search → read the markdown), see QUICKSTART.md.

Develop locally

git clone <repo>
cd evermem
uv sync                              # creates ./.venv and installs deps
source .venv/bin/activate            # — or skip activation and prefix every command with `uv run`
cp env.template .env                 # fill in EVERMEM_LLM__API_KEY

evermem --help
make test

Storage layout

~/.evermem/
├── memory/                    # Markdown — Single Source of Truth
│   ├── users/<user_id>/
│   │   ├── user.md           # profile
│   │   ├── memcells/         # day-level append logs
│   │   ├── episodic/
│   │   └── ...
│   └── agents/<agent_id>/
│       ├── agent.md
│       ├── cases/
│       └── skills/
├── .index/                    # LanceDB derived indexes (rebuildable)
└── .system.db                 # SQLite: state + audit + queue + metadata

Open the memory/ folder in Obsidian — your agent's brain is just files.

Features

  • Hybrid retrieval: BM25 + vector (HNSW/IVF-PQ) + scalar filter, single-query in LanceDB
  • Cascade index sync: edit a .md → file watcher → entry-level diff → LanceDB sync, sub-second
  • Multi-source extraction: conversations / workflows / agent traces / file knowledge
  • Dual-track memory: user-track (Episodes / Profiles) + agent-track (Cases / Skills)
  • Async-first: full asyncio, single event loop
  • Multi-modal: text + small image / audio inline; large media via S3/OSS reference

Project structure

evermem/                        # repo root
├── src/evermem/                # main package (src layout)
│   ├── entrypoints/           # cli + api
│   ├── service/               # use case orchestration
│   ├── memory/                # domain: extract + search + cascade + prompt_slots
│   ├── infra/                 # storage: markdown + lancedb + sqlite
│   ├── component/             # cross-cutting: llm / embedding / config / utils
│   ├── core/                  # runtime: observability / lifespan / context
│   └── config/                # configuration data + Settings schema
├── tests/                     # unit / integration / golden / fixtures
├── docs/                      # design docs
├── examples/                  # quickstart + chat_agent + obsidian_demo
└── .claude/                   # team-shared rules + skills (auto-loaded by Claude Code)

Documentation

Status

Alpha (v0.1.0) — Active development. Core API may change before v1.0.

License

Apache License 2.0 — see NOTICE for third-party attributions.

Citation

If you use EverMem in research, see CITATION.md.


Acknowledgments: This project builds on prior research and tooling — see ACKNOWLEDGMENTS.md.

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

evermem-0.1.0rc5.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

evermem-0.1.0rc5-py3-none-any.whl (388.3 kB view details)

Uploaded Python 3

File details

Details for the file evermem-0.1.0rc5.tar.gz.

File metadata

  • Download URL: evermem-0.1.0rc5.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for evermem-0.1.0rc5.tar.gz
Algorithm Hash digest
SHA256 d93116a1cc9e3fac91ed80f3101fa67dba8ba6b2785c995a9e70cf46d840c8d4
MD5 42044682570b82d49d6c3f76d8c3b215
BLAKE2b-256 6f95047165f88085382a1838746998758925b0e622a2b9c31430e392e4083905

See more details on using hashes here.

File details

Details for the file evermem-0.1.0rc5-py3-none-any.whl.

File metadata

  • Download URL: evermem-0.1.0rc5-py3-none-any.whl
  • Upload date:
  • Size: 388.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for evermem-0.1.0rc5-py3-none-any.whl
Algorithm Hash digest
SHA256 7c7d611a38283f44d64f7b8a6f36152d13742a2d8dc3d771fbd17c0cd12ece98
MD5 e8333321ae93861d9b734176de3e746f
BLAKE2b-256 5df93d06f4a89b056bd8d26afa70fe089b1f792f2b2f5c50138b4b9a659f7ad3

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