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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mem_alive-0.1.1.tar.gz (124.7 kB view details)

Uploaded Source

Built Distribution

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

mem_alive-0.1.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file mem_alive-0.1.1.tar.gz.

File metadata

  • Download URL: mem_alive-0.1.1.tar.gz
  • Upload date:
  • Size: 124.7 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for mem_alive-0.1.1.tar.gz
Algorithm Hash digest
SHA256 116aa2fda8cfd7812d3fe70ac4169562519ba4f07ecc91a701c5fe23d8526121
MD5 5eb7fa86ee7332bea2d469ef141db7de
BLAKE2b-256 f1dbc187a0f884265a5a4137251d29ad656043eb20b939515d45a42f61c63a07

See more details on using hashes here.

File details

Details for the file mem_alive-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mem_alive-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for mem_alive-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b685ad17af8ac88e167e97a445a12f6a41d43231802f0e5a0d1081ba67fe458
MD5 728fe8b7d5495efff36bed67ad74a7ba
BLAKE2b-256 40297c0c0bb2fd358e2749f99e7e51629d0d78b2a93978f5bbbaf58d94e38071

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

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