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.0.tar.gz (124.6 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.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mem_alive-0.1.0.tar.gz
  • Upload date:
  • Size: 124.6 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.0.tar.gz
Algorithm Hash digest
SHA256 fbb3c1ead37d87ee9e381e035c670720bdc5b869c0d1524af1585862be45dc82
MD5 167c8da56616476f923352be1752e77b
BLAKE2b-256 6c9894a6e9ccd4cf815e3c64b8487e96acbfcd047dd62351ad9ae489a0a797d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mem_alive-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 268e3a3c10e0329f4309ffcde03cb9f6967e9258dab7494cd3cf077ca31ab1fb
MD5 246174e0b0ac0d47ebbcb1329cb29862
BLAKE2b-256 406f5c00be8e9f5e9b29876ed37e1222352acc59fc2d94936e1887edc60bedd1

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

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