Skip to main content

mem-alive

A memory layer for AI agents. Semantic, episodic, and procedural memory, built as a Python package.

Why

Coding agents re-read the whole codebase every time they start a task. That burns tokens and adds round trips between the cloud model and the local harness. This library exists to fix that by giving agents actual memory instead of a blank slate every session.

That said, it's not built just for coding agents. It's a general memory layer that works with any agentic setup or a plain RAG app. The coding-agent problem is the flagship test case, not something baked into the core.

Architecture

architecture diagram

One Memory client fronts three stores, each backed by the same pluggable StorageBackend and EmbeddingProvider.

Three kinds of memory

  • Semantic - durable facts, no recency weighting. New facts can supersede old, similar ones.
  • Episodic - specific past events, timestamped, recency-weighted (exponential half-life decay), never merged.
  • Procedural - skills and workflows, retrieved by hybrid search (embedding similarity + keyword overlap).

Each type has its own store with its own retrieval logic, but all three share one schema and one memory_type tag, so a single federated recall() on the Memory client can query across all of them at once.

Scoping

  • namespace - hard partition, never crossed. Means whatever the caller wants (agent, repo, tenant).
  • metadata - flexible filters within a namespace (session id, tags, etc).

Contradictions

Semantic writes check for contradictions on every remember(): embed the new fact, search for similar existing facts in the same namespace, and if similarity crosses a threshold, mark the old fact as superseded. v0.1 uses a similarity threshold for this. A smarter LLM-arbiter version (duplicate vs contradiction vs refinement) is a future upgrade, not required for the first release.

Storage

The backend stays dumb: vector search, metadata filters, CRUD, nothing else. Recency decay, hybrid scoring, and contradiction logic all live above it, in the store layer, so any backend stays swappable.

v0.1 ships with InMemoryBackend, zero dependencies, good for development and testing. A LanceDB backend (embedded, no server required) is planned as an optional extra (pip install mem-alive[lancedb]) for anything that needs to persist across restarts.

Status

v0.1.0. Core is done: all three stores, the in-memory backend, a local embedding provider (Ollama), and the federated Memory client, all async, with a test suite covering each module plus the integration path. MIT licensed.

Still open: the LanceDB backend, a coding-agent app layer built on top, and eval/benchmark design.

Metadata

Release files for mem-alive 0.1.1

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

Source distribution (sdist)

Source distribution for mem-alive 0.1.1
File Size Uploaded
mem_alive-0.1.1.tar.gz 124.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mem-alive 0.1.1
File Interpreter ABI Platform
mem_alive-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 136.1 kB

Release files / mem_alive-0.1.1.tar.gz

Download URL mem_alive-0.1.1.tar.gz
Size 124.7 kB
Tags Source
SHA-256 checksum
How to use checksums
116aa2fda8cfd7812d3fe70ac4169562519ba4f07ecc91a701c5fe23d8526121
BLAKE2b-256 checksum
How to use checksums
f1dbc187a0f884265a5a4137251d29ad656043eb20b939515d45a42f61c63a07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mem_alive-0.1.1-py3-none-any.whl

Download URL mem_alive-0.1.1-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b685ad17af8ac88e167e97a445a12f6a41d43231802f0e5a0d1081ba67fe458
BLAKE2b-256 checksum
How to use checksums
40297c0c0bb2fd358e2749f99e7e51629d0d78b2a93978f5bbbaf58d94e38071
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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