Open-source memory engine for AI assistants.
Selection governed by applicability.
Every AI assistant with memory faces the same decision on each message: which stored information should influence this response.
Most systems answer through similarity search. The current message is compared against stored memories, and the closest matches are injected into context. This approach has improved significantly through hybrid search, knowledge graphs, and learned retrieval policies.
The failure mode is subtle. A preference from a coding session appears during emotional support. A belief that was accurate six months ago overrides current context. A compressed summary from a past project gets treated as established fact. In each case, the system retrieved a memory because it matched the words. Whether it improved the response was a separate question that was never asked.
Atagia introduces applicability as the governing criterion. Each candidate memory is scored across multiple dimensions: does it fit the current task, the active assistant mode, the project scope, the user's present state. Is it temporally valid. Is the evidence it rests on still reliable. Is the cost of using it wrongly acceptable given the stakes of this particular interaction.
Memory candidates are scored by estimated usefulness to the current interaction, considering the user, the task, the active assistant mode, the scope, and the cost of being wrong. Semantic similarity contributes to candidate generation but does not govern selection. A memory about the user's coding preferences may score high in similarity during a research conversation but low in applicability. The scorer catches what embeddings miss.
The system maintains four distinct layers. The evidence layer stores what actually happened: verbatim spans, extracted events, citations to source messages, timestamps. The belief layer stores interpretations of that evidence: revisable claims derived from observation. The interaction contract stores how the user collaborates: desired depth, correction style, tolerance for uncertainty. The state layer tracks current context. Each layer has different trust levels, update rules, and persistence behavior.
Memory is not a single global profile. What applies in coding mode should not appear in research mode or companion mode. Each assistant mode defines a memory policy manifest that controls which scopes are accessible, which memory types are preferred, how much cross-chat personalization is allowed, and how much context budget each memory category receives. The same user can have different collaborative relationships with the same system depending on the active mode.
Long conversations require summarization to fit within context budgets. Most systems treat summaries as the canonical representation of past interactions. Atagia treats summaries as views, never as replacements for the underlying evidence. When a decision depends on information that was previously summarized, the system can re-ground against the original. Summaries serve operational convenience. Evidence serves epistemic integrity.
When user preferences change, the system does not silently overwrite the old value. It creates a new version linked to the evidence that prompted the change, preserving the revision chain. A correction, a gradual shift, and a context-specific exception are treated as structurally different events. Consequence chains track the downstream effects of memory-influenced responses, allowing the system to learn from cases where a retrieved memory helped or harmed the interaction.
Named for autophagy, the cellular process where organisms dismantle what no longer serves and rebuild from the material.
The architecture draws from cross-domain research into memory systems that predate computation by billions of years.
In cellular biology, autophagy allows organisms to dismantle damaged or unnecessary components and rebuild from the material. The immune system stores memory through cells that are simultaneously the memory and the response mechanism. Slime molds solve optimization problems through physical networks that encode exploration history in their own structure.
In physics, gravitational waves leave permanent traces on spacetime. Phase transitions reorganize entire systems when accumulated pressure crosses a threshold, offering a model for how gradual evidence accumulation can trigger belief revision.
In neuroscience, the act of remembering a memory also rewrites it. What we call memories are patterns distributed across networks that change with each activation. The brain rebuilds function through alternative pathways when primary routes fail.
These domains share a property absent from current AI memory systems: the memory and the retrieval mechanism are integrated. In biology, the memory IS the response. In current AI systems, storage and retrieval are separate subsystems. Atagia explores what changes when that boundary softens. The full exploration is published as Beyond Human Memory, a companion research document.
Persist to the evidence layer.
Classify intent. Identify which memory types this interaction needs.
Generate candidates within the applicable scope for this mode and user.
Score by task fit, mode fit, temporal validity, epistemic quality, and risk relevance.
Assemble applicable memories under the token budget, ordered by utility.
Respond to the user. Then extract new evidence and revise beliefs post-hoc.
from atagia import Atagia memory = Atagia(db_path="memory.db") context = await memory.get_context( user_id="usr_123", conversation_id="conv_456", mode="research", message="What did we discuss about the migration?" ) # Returns: applicable beliefs, interaction contract, # relevant evidence, current user state
Most memory systems track what the user said. Preferences, facts, biographical details, project context. Atagia tracks an additional layer: how the user works.
The interaction contract is a learned model of the collaborative relationship between the user and the assistant. It captures working dimensions that shape response quality independently of content. These dimensions are scoped per assistant mode. A debugging session and a research conversation with the same user may have completely different optimal values.
Some users want exhaustive analysis. Others want the minimum viable answer. This varies by mode.
Some users want every caveat flagged. Others find excessive hedging frustrating and prefer direct statements.
Whether the user prefers evidence trails and references, or trusts the assistant to synthesize directly.
Some appreciate when the assistant challenges assumptions. Others interpret pushback as overstepping.
Iterative refinement through dialogue, or complete deliverables that need minimal revision.
The contract evolves through observation. Corrections and confirmations both serve as evidence for updating the model. Over time, it reflects how this specific user actually works, in each mode, without requiring manual configuration.
Research framing and thesis paper. Defines applicability-governed memory as a framework, positions against the 2026 state of the art, specifies the scoring model, proposes evaluation benchmarks, and identifies the strongest publication path.
Read the paper →Implementation specification. Covers database schemas, API design, worker architecture, assistant mode manifests, the retrieval and scoring pipeline, and a phased implementation roadmap.
Read the design →The exploratory research that inspired the architecture. Surveys memory mechanisms across micro-biology, macro-physics, neuroscience, and holistic traditions. Identifies cross-domain convergences and synthesizes novel computational concepts.
Read the exploration →Independent architecture and security review. Documents critical, high, medium, and low severity findings with proposed fixes. Published for transparency.
Read findings →Atagia is a Python library designed for single-machine to small-server deployment. The design prioritizes conceptual correctness over distributed scale. The primary risk at this stage is architectural failure, not cluster orchestration.
SQLite serves as the canonical data store. All durable state lives in SQLite: messages, memory objects, revisions, belief versions, retrieval logs, and evaluation traces. SQLite was chosen for portability, auditability, and zero-configuration deployment.
Redis is an optional acceleration layer for transient state: recent windows, hot rankings, job queues, deduplication locks. When Redis is not available, the library falls back to in-process data structures with no loss of correctness.
The library installs via pip with no required external dependencies beyond SQLite, which is bundled with Python.