Inspiration

AI agents lose all contextual data upon session termination. The conventional method of logging every message only exacerbates this issue. This approach clutters the storage with raw, redundant, and contradictory records, ultimately overwhelming the data retrieval process with noise.

Tenax is engineered to resolve this by operating more like a cognitive process than a static transcript. The system autonomously evaluates which information to retain, updates established records when facts change, and filters out trivial data. This core capability embodies the exact concept of memoria tenax. In Latin, the term translates to a tenacious memory that naturally holds fast to what truly matters.

What it does

Tenax is a self-managing, persistent memory layer that any MCP-compatible agent can plug into. It ships as both an MCP server (5 tools: remember / recall / forget / reflect / list_memories) and a REST API. Under the hood it runs five moves:

  • Extract — distills raw conversation into self-contained facts, not raw turns.
  • Revise — belief revision at write time: when a new fact contradicts an old one ("moved to Singapore" vs "lives in Jakarta"), the stale belief is archived with a superseded_by pointer, so recall serves the current truth.
  • Retrieve — hybrid search (dense embeddings + Postgres full-text + recency + importance), then budget-aware packing that fits the highest-value memories into a strict token budget.
  • Forget — an Ebbinghaus-style decay score sweeps low-value memories; access reinforces retention.
  • Consolidate — clusters near-duplicates and distills them into canonical facts.

How we built it

The engine is Python 3.12: an MCP server on FastMCP and a FastAPI REST API, both sitting on top of app/memory/. Storage is PostgreSQL + pgvector via SQLAlchemy paired with vectors, metadata, and full-text search in one place. All intelligence runs on Qwen Cloud through an OpenAI-compatible client pointed at DashScope-International: qwen-turbo for extraction, belief revision, and consolidation, and text-embedding-v4 for embeddings. Token budgeting uses tiktoken. There are two front-ends on purpose: a Streamlit dashboard to try it live, and a Next.js + Tailwind product site that explains it. Everything is containerized with Docker Compose and deployed on Alibaba Cloud ECS.

Challenges we ran into

The primary technical challenge was not data storage, but determining which information to discard. The decay curve required precise tuning to ensure valuable facts are retained while irrelevant noise is filtered out. The belief revision mechanism was carefully engineered to update specific records without erasing legitimate historical data. To guarantee the absolute reliability of performance metrics, the product website operates without a live backend. All benchmark figures are generated directly from actual run artifacts. This architecture ensures that every published number remains strictly tethered to its source execution.

Accomplishments & what's next

The resulting system is a highly selective memory layer capable of autonomous belief revision, strict token budget management, and intentional data deletion. This architecture is currently deployed as a drop-in MCP server paired with a REST API. Every technical claim is supported by a rigorously measured benchmark harness. Future development phases will focus on implementing richer data consolidation, per-agent memory namespaces, and expanded benchmark coverage.

Built With

Share this project:

Updates

Submission history