TenseMem icon

TenseMem

TenseMem is an embedded Python memory system for AI agents that maintains current and historical typed facts in a SQLite-backed store. It uses model-proposed operations with deterministic resolution, freshness-aware reads, and persistent corrections.

TenseMem

Embedded, time-aware memory for AI agents

TenseMem is an embedded Python memory system for AI agents that need more than similarity-based recall. It stores episodes and derives typed facts from them, maintaining current state alongside historical values so an agent can distinguish what is true now from what was true earlier.

The default store is a single SQLite file used within the application process, with no separate server required for the core workflow. An extractor proposes operations from user messages, while deterministic rules resolve and apply those operations. Reads such as `state()`, `history()`, `context()`, and `search()` expose freshness information so applications can tell whether returned memory reflects the latest input.

Key features

Episode log and rebuildable facts

Episodes are kept as an append-only log, while facts provide a rebuildable projection. Calling `rebuild()` can replay the same episodes through an updated extraction pipeline.

Temporal cardinality

ONE predicates maintain at most one active value, superseding older values without deleting their history. MANY predicates support multiple active values until they are replaced or removed.

Freshness-aware reads

State, history, context, and search reads report the episode watermark, pending work, and failure status. `context()` can wait for a requested sequence before returning.

Contamination controls

Recalled `context()` text is fenced and fenced spans are removed before extraction. Proposed operations also require a verbatim quote from the remaining user text, helping prevent self-echo.

Persistent corrections

`correct(fact_id)` marks a fact as never true, restores the value it displaced, and preserves the correction across rebuilds while allowing later genuine changes.

Practical use cases

  • User profile state

    Track facts such as a user's current city while retaining superseded values for questions about previous locations. The state model avoids forcing the agent to choose between current and historical matches returned by similarity search.

  • Fresh conversational context

    Use freshness watermarks and pending-message information when an agent needs to know whether a response is based on the latest user message. A caller can wait for a minimum episode sequence before reading context.

  • Reliable correction workflows

    Represent corrections to remembered facts with `correct(fact_id)`, restoring the displaced value and keeping the correction during a later rebuild. This supports workflows where an agent must recover from an incorrectly extracted claim.

  • Local agent development

    Run the memory engine locally through its Python API, CLI, REST service, MCP interface, or local Studio inspector. This suits developers testing agent memory on a single SQLite database before connecting a real extractor.

Pros and Cons

Pros

  • Embedded operation uses one SQLite file and does not require a separate memory service.
  • Deterministic resolution separates model-proposed operations from state mutations.
  • Current values, historical facts, freshness status, and corrections are represented explicitly.
  • The core test workflow can run without API keys or hosted model calls.

Cons

  • The project is identified as version 0.1.0 alpha, so APIs and behavior may still change.
  • The documented default storage is SQLite; a second SQL dialect and hosted multi-tenant Studio are not shipped in the repository.
  • Real-model extraction requires configuring a supported provider and its credentials; the no-key FakeExtractor is rule-based.

FAQ

How do you get started with TenseMem?

TenseMem is a Python package. A minimal setup creates a Memory instance with an extractor, registers a predicate such as `lives_in`, adds a user message, and reads the resulting context. `FakeExtractor` can be used without an API key; provider extras are available for OpenAI, Anthropic, Ollama, LiteLLM, and Gemini workflows.

Does the language model directly control memory changes?

The extractor proposes typed operations from episodes, but deterministic resolver rules decide which mutations are allowed and apply them to the SQLite-backed state. The model does not directly decide the final state.

How does TenseMem handle changing or multiple values?

Yes. Predicates can be cardinality ONE or MANY. With a ONE predicate, a newer value supersedes the previous active value while the earlier fact remains available through history. A MANY predicate can retain several active values until values are replaced or removed.

What happens when extraction is still processing?

Reads expose freshness information, including the episode sequence reflected, pending messages, and whether processing has failed. `context()` can wait for a minimum sequence, while still exposing whether the returned state is current if extraction has not completed.

Quick Facts

Category
Developer Tool
Primary users
AI agent developers
Platform
Python package
Default storage
SQLite file
Status
0.1.0 alpha
Interfaces
Python API, CLI, REST, MCP, and local Studio

Alternativas a TenseMem

Goldfish icon

Goldfish

Goldfish is an AI memory app for macOS that helps you reply, write, summarize, and continue using the context already on your Mac. It stores memory locally and writes in your tone.

Lasso icon

Lasso

Lasso is an ecommerce product data platform for enriching catalog records, processing supplier files, generating product content, and monitoring competitors. It combines a web app with a REST API, SDK, and MCP server for teams and developers.

CreateOS Sandbox icon

CreateOS Sandbox

CreateOS Sandbox is an isolated compute environment for running code and agent workloads inside Firecracker micro-VMs. It is designed for workflows that need machine-level isolation, private networking between sandboxes, and programmatic control through SDK, CLI, or MCP.

ArtDeck icon

ArtDeck

ArtDeck is a visual reference board app for iPhone, iPad, and Mac that lets artists collect mixed reference material on one canvas and study it with ToolBox lenses. It works offline, supports optional iCloud sync, and is sold as a one-time purchase with no account required.

GitBot icon

GitBot

GitBot is a local browser-based workspace for creating reusable coding bots powered by Claude Code, Codex, or OpenCode. It helps developers run those agents across repository folders with persistent threads and configurable permissions.

Codex Plugins icon

Codex Plugins

Codex Plugins bundle reusable skills, app integrations, and MCP servers into workflows you can install in the Codex app or use from Codex CLI. They help extend Codex with connected-service tasks, reusable instructions, and shared team workflows.