-
-
Tenax — self-managing persistent memory for AI agents. Built for the Global AI Hackathon with Qwen Cloud, Track 1: MemoryAgent.
-
Persistent memory for AI agents that manages itself. An MCP server on Qwen Cloud: keeps what matters, recalls it inside a token budget.
-
An agent that forgets makes you repeat yourself. Recency-only buries the old-but-important fact under noise; hybrid retrieval surfaces it.
-
Five skills, one self-managing loop: extract, revise beliefs, retrieve to budget, let memories decay, consolidate — with no one curating it.
-
A real engine session replayed step by step. Every response shown is real Qwen Cloud output, not a mock — and identical on every viewing.
-
Every number comes from a reproducible run. Evaluated on LongMemEval with Qwen Cloud: 100% retrieval hit rate, raw records live in the repo.
-
The live console: remember, recall, forget and reflect against a running backend — degrades to sample data when the API is offline.
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_bypointer, 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
- alibaba
- dashscope
- docker
- fastapi
- fastmcp
- mcp
- next.js
- pgvector
- postgresql
- pydantic
- python
- qwen
- react
- sqlalchemy
- tiktoken
- typescript
- uvicorn
Log in or sign up for Devpost to join the conversation.