SuperAPI AI Directory

alaya

Neuroscience-inspired local agent memory that stores episodes, consolidates knowledge over time and builds a personal knowledge graph with semantic recall.

Open website

About this tool

Alaya (Sanskrit alaya-vijnana, meaning "storehouse consciousness") is a memory engine for conversational AI agents, released as an embeddable Rust library. It uses only a single SQLite file and depends on no external services. Agents use it to store conversations, retrieve important content, and let the rest gradually fade; the graph is continually reshaped through use, similar to biological memory. The project describes its features as: the only memory engine with neuroscience-grounded memory dynamics, including Bjork dual-strength forgetting, retrieval-induced inhibition, and Hebbian co-activation, and a zero-dependency embeddable Rust library.

[Purpose and Positioning] Most AI agents treat memory as flat files, for example writing to MEMORY.md, Obsidian, or JSON/Markdown. This works at first, but as files grow the context window becomes filled, and the agent can only stuff everything into the prompt, hoping the LLM finds what matters. Data cited by the project says OpenClaw injects about 35,600 tokens of workspace files per message, of which 93.5% is irrelevant; heavy users report token costs of $3,600 per month. Community tools QMD and memsearch replace full-context injection with ranked retrieval, reducing waste by 70-96%. Structural problems further compound the cost: MEMORY.md lumps decisions, preferences, and knowledge together, and users each invent decision.md, working-context.md, and even 12-layer memory architectures to compensate; when "Alice manages the auth team" is mentioned on Monday and "who is responsible for auth permissions" is asked on Wednesday, the agent can only retrieve by text similarity separately and cannot establish a connection. Alaya is designed precisely to solve this kind of problem.

[Main Capabilities] Alaya adopts a three-store architecture (episodic memory/semantic memory/implicit memory) plus a Hebbian graph overlay, providing 7 lifecycle operations: consolidate, transform, forget, perfume, emergent ontology, RIF (retrieval-induced forgetting), purge. The retrieval pipeline is modular RAG: BM25 (based on FTS5) + vector + graph + RRF fusion + semantic/preference enhancement. The forgetting mechanism adopts Bjork dual-strength forgetting, distinguishing storage strength from retrieval strength, and includes retrieval-induced inhibition; LTD (long-term depression) weakens unused Hebbian links in each conversion cycle. Retrieval results come with semantic knowledge and preferences, not just episodic fragments. Categories form a tree structure via parent_id and are automatically split when too broad; MemberOf links support cross-domain bridging, and spreading activation can cross category boundaries. Provides an EmbeddingProvider trait (embed() + embed_batch() integrated into store_episode() and query()), an ExtractionProvider trait (extract() supports automatic consolidation), and an LlmExtractionProvider based on the llm feature, which can call any OpenAI-compatible API. The lifecycle runs automatically: automatic maintenance every 25 episodes, and automatic consolidation or prompting after 10 unconsolidated episodes. The project contains 442 tests, covering unit, integration, property tests (proptest), and documentation tests.

[Usage] It is recommended to connect to any MCP-compatible agent (Claude Desktop, Claude Code, Cursor, Cline, etc.) via the MCP server, providing 13 memory tools: remember, recall, learn, status, preferences, knowledge, maintain, purge, categories, neighbors, node_category, import_claude_mem, import_claude_code. Data is stored in ~/.alaya/memory.db, which can be overridden with the ALAYA_DB environment variable. ALAYA_LLM_* environment variables are optional; when not set, the server works in prompt mode (reminding the agent to call learn after 10 episodes), and when an API key is set and the llm feature is enabled, it consolidates automatically. It can also be embedded directly into applications as a Rust library, or used via Python bindings (see alaya-py/README.md). The project provides a demo with annotated output, covering all eleven capabilities with no external dependencies. Alaya is a library, not a framework: the conversation loop, LLM, and embedding model are controlled by the agent itself, and Alaya is only responsible for memory. Using NoOpProvider allows episodes to accumulate without an LLM and rely only on BM25 retrieval; after configuring ExtractionProvider, the MCP server automatically consolidates after 10 unconsolidated episodes.

[Design Principles] Memory is a process, not a database; each retrieval changes what is remembered; forgetting is a feature, not a defect; preferences are emergent rather than declared, and behavioral patterns crystallize from accumulated impressions through vasana (perfuming), without needing an LLM; the agent owns its identity, and Alaya only stores seeds; graceful degradation, using BM25 when there are no embeddings, accumulating episodes when there is no LLM, with each feature working independently.

[Research Foundations] The architecture is based on neuroscience, Buddhist psychology, and information retrieval. In neuroscience, it cites Hebbian LTP/LTD (Hebb 1949; Bliss & Lomo 1973), complementary learning systems (McClelland et al. 1995), spreading activation (Collins & Loftus 1975), encoding specificity (Tulving & Thomson 1973), dual-strength forgetting (Bjork & Bjork 1992), retrieval-induced forgetting (Anderson et al. 1994), and working memory limits (Cowan 2001). In Yogacara Buddhist psychology, it involves alaya-vijnana (storehouse consciousness), bija (seeds), vasana (perfuming), asraya-paravrtti (transformation of the basis), and vijnaptimatrata (representation-only). In information retrieval, it adopts Reciprocal Rank Fusion (Cormack et al. 2009), FTS5's BM25, and cosine similarity vector search.

[Comparison and Evaluation] The project claims that its difference from all other systems lies in: Bjork dual-strength forgetting (separating storage and retrieval strength), retrieval-induced inhibition (retrieving A inhibits competing B and C), Hebbian co-retrieval reinforcement (LTP/LTD), and implicit preference emergence without an LLM, all integrated into a single embeddable Rust + SQLite library. The closest counterparts are Vestige (Rust, FSRS-6, spreading activation) and SYNAPSE (unified episodic-semantic graph, lateral inhibition). The project also provides a complete comparison of 90+ systems, an interactive landscape diagram based on the CoALA taxonomy (Sumers et al. 2024), and theoretical foundation documentation. In terms of evaluation, on LoCoMo (1,540 questions), LongMemEval (500 questions), and MemoryOn AgentBench (734 questions, covering 4 capabilities), two baselines—full-context injection and naive vector RAG—were compared, with Gemini-2.0-Flash-001 as the generator and GPT-4o-mini as the judge. The results show that full context is superior in shorter conversations (LoCoMo, 16–26K tokens), while naive RAG wins on longer histories (LongMemEval, about 115K tokens), with both differences statistically significant (McNemar test, p < 0.001); the gap is largest in test-time learning (86% vs 44%, +42 percentage points), and RAG disrupts the sequential structure required for in-context learning; conflict resolution remains unresolved, with both baselines at about 50% on handling contradictions, indicating that both full context and retrieval lack a mechanism for resolving conflicting information, which is precisely the problem that lifecycle management must address.

[Limitations] The project materials do not provide information on fees, pricing, platform support scope, or commercial licensing, so it is not provided for now. Specific API details, performance numbers, deployment steps, and system prompt recommendations should be referenced in its documentation (docs/mcp-quickstart.md, etc.); this introduction does not supplement them on its behalf.