Amneshia

Amneshia

Unified, zero-external-database multi-agent long-term memory hub with SQLite FTS5 BM25 search, knowledge graph, sleep cycle consolidation, and a web dashboard.

Category
访问服务器

README

Amneshia

Release License CI Status Tests

Unified, zero-external-database, multi-agent long-term memory hub. Built on top of SQLite FTS5 + BM25 Search, incorporating a Universal MCP Bridge Manager, a local Sleep Cycle Memory Consolidation Engine, and an interactive Amneshia Web Dashboard.


Architecture Diagram

Amneshia coordinates Stdio and SSE/HTTP transports, managing underlying storage, background consolidation tasks, and MCP integrations:

flowchart TB
    %% Class Definitions for Styling
    classDef client fill:#1e1e2e,stroke:#a855f7,stroke-width:2px,color:#fff;
    classDef transport fill:#1e1e2e,stroke:#06b6d4,stroke-width:2px,color:#fff;
    classDef core fill:#181825,stroke:#3b82f6,stroke-width:2px,color:#fff;
    classDef bridge fill:#1e1e2e,stroke:#f59e0b,stroke-width:2px,color:#fff;
    classDef db fill:#11111b,stroke:#10b981,stroke-width:2px,color:#fff;

    subgraph Clients ["1. Clients & Agent IDEs"]
        Agent["🤖 AI Agents (Antigravity IDE / Cursor / Windsurf / Claude Code)"]:::client
        Browser["🌐 Amneshia Web Dashboard (React 18 + Vite)"]:::client
    end

    subgraph Transport ["2. Transport & Communication Layer"]
        Stdio["⚡ Stdio Transport (JSON-RPC 2.0)"]:::transport
        SSE["🌐 HTTP / SSE Server (Port 3457)"]:::transport
        REST["🔗 REST API Endpoints"]:::transport
    end

    subgraph Amneshia ["3. Amneshia v2 Core Knowledge Engine"]
        MCP["🛠️ 18 MCP Tools Surface"]:::core
        Graph["Knowledge Graph Engine"]:::core
        Sleep["🌙 Sleep Cycle Consolidation Engine"]:::core
        Exporter["📄 Markdown Auto-Exporter"]:::core
        DB[("💾 SQLite FTS5 Storage (~/.amneshia/memory.db)")]:::db
    end

    subgraph Bridges ["4. Universal MCP Bridge System"]
        Bridge["🔌 Bridge Client Manager"]:::bridge
        CM["💻 codebase-memory-mcp (Port 9749)"]:::bridge
        Other["🌐 External Custom MCP Servers"]:::bridge
    end

    %% Flow Connections
    Agent <-->|Stdio Stream / SSE| Transport
    Browser <-->|HTTP REST API| REST

    Stdio <-->|JSON-RPC| MCP
    SSE <-->|HTTP Events| REST
    REST <-->|API Handler| Graph

    MCP <-->|CRUD & FTS Queries| Graph
    Graph <-->|BM25 Search & SQL Triggers| DB
    Sleep <-->|Jaccard Pruning & Conflict Supersession| DB
    Graph -->|Sync Markdown Mirror| Exporter

    Graph <-->|Bridge Proxy Tools| Bridge
    Bridge <-->|Auto-Sync Projects| CM
    Bridge <-->|Proxy Tool Call| Other

Key Features

  • Semantic Knowledge Graph — Not a simple, flat key-value store. Entities are organized using structured, typed relationships and observations.
  • FTS5 BM25 Search — Integrates SQLite FTS5 extension with BM25 ranking for fast, typo-tolerant full-text query lookup.
  • Universal MCP Bridge — Interoperability with external MCP servers (such as codebase-memory-mcp) allowing synchronization of external facts and tools dynamically.
  • Sleep Cycle Memory Consolidation — Evaluates similarity metrics (Jaccard Similarity $\ge 0.8$) and LLM context analysis during sleep/idle states to deduplicate memories, resolve conflicts, track update histories, and purge expired ephemeral data.
  • Access Control Whitelisting — Visibility properties (public, restricted, private) and whitelisting arrays (allowedAgents) prevent unauthorized agent access.
  • Amneshia Web Dashboard — Rich visual interface built with TasteSkill anti-slop guidelines for exploring graphs, managing target exports, controlling bridge servers, and viewing memory statistics.

Quick Start

1. Direct Run via GitHub

You can run Amneshia instantly from GitHub without installing anything:

# Run HTTP Web Dashboard & REST API in background daemon mode
amneshia --http --port 3457 --daemon

# Or via npx directly from GitHub:
npx -y github:SabilMurti/Amneshia --http --port 3457 --daemon

Or install globally via GitHub:

npm install -g github:SabilMurti/Amneshia

# Run in background daemon mode anywhere:
amneshia --http --daemon

2. Stdio Mode (Standard IDE Integration)

To connect Amneshia to your editor/agent environment (e.g., Cursor, Antigravity IDE, Claude Code), add the server entry in your MCP config (mcp_config.json):

{
  "mcpServers": {
    "amneshia": {
      "command": "npx",
      "args": ["-y", "github:SabilMurti/Amneshia"]
    }
  }
}

Complete MCP Tools Reference (18 Tools)

Amneshia exposes 18 specialized tools to client agents for managing the memory cycle, querying data, and bridging other servers:

Category Tool Name Parameters Description
Entity create_entities entities (array of Entity Inputs) Creates new unique entities with type, domain, and access whitelists.
delete_entities names (string array of names) Removes entities and cascades deletes to their observations and relations.
Relation create_relations relations (array of Relation Inputs) Establishes typed connections (e.g., creator_of, works_on) between entities.
delete_relations ids (string array of relation IDs) Deletes specified relations by ID.
Observation add_observations observations (array of Obs Inputs) Attaches raw observations or LLM-synthesized facts to an entity.
delete_observations ids (string array of observation IDs) Deletes specified observations.
update_observation id (string), content (string), changedBy? Updates observation content while logging the change history.
Query & Graph search_memory query (string), limit? Performs FTS5 BM25 search across entity names, types, and observations.
read_graph domain?, entityType? Retreives the full or filtered knowledge graph snapshot.
open_nodes names (string array) Retrieves full attributes, observations, and relations of specific nodes.
Lifecycle cleanup_expired None Deletes ephemeral observations that have passed their expiration date.
consolidate_memory domain? Performs conflict resolution, near-duplicate Jaccard pruning, and synthesis.
get_stats None Returns storage metrics, entity domain breakdowns, and recent activity logs.
Exporter export_memory None Exports current graph snapshot to active Markdown targets.
manage_export_targets action, name?, path?, format?, id?, autoExport? Registers, removes, or toggles auto-export Markdown paths.
configure_ai provider (string) Changes default AI synthesis provider (none, 9router, ollama, openai).
Universal Bridge manage_bridge_servers action (string), name?, command?, args?, id? Adds, lists, or removes downstream bridged MCP servers in SQLite.
list_bridge_tools serverId (string), command?, args? Queries a bridged server to retrieve its exposed tools.
call_bridge_tool serverId (string), toolName (string), arguments? Executes a tool on a bridged server and returns the result.

Web Dashboard & Codebase Integration

Amneshia serves a web client on http://localhost:3457 when running in HTTP mode. The client provides:

  1. Interactive Graph Visualizer for looking at entity links and node clusters.
  2. Bridge Manager to register downstream MCP servers (e.g. codebase-memory-mcp) and configure commands/args.
  3. Settings Controls to switch LLM Providers (9router AG, Ollama, OpenAI, or None) and manage auto-export markdown logs.

Codebase Memory MCP Bridge Sync

codebase-memory-mcp is an advanced MCP server by DeusData that creates structural codebase knowledge graphs (AST analysis, function signatures, dependency trees, and git metadata) for AI agents.

When codebase-memory-mcp is configured as a bridge server in Amneshia and enabled, the system supports 1-click cross-graph synchronization via the /api/bridge/sync REST endpoint (or call_bridge_tool). This triggers an automated scan of the bridged server's active codebase indices, importing:

  • Workspace root paths.
  • Codebase nodes and edges metrics.
  • Active git branches and commit SHAs.

These synchronized details are stored directly under the project entity's observations prefixed with [Codebase Memory MCP].


Recommended Agent Directives / System Rules

To give your AI Agent (Cursor, Antigravity IDE, Claude Code, Windsurf, etc.) optimal long-term memory behavior, copy and paste the following prompt rules into your agent's custom instructions file (e.g. GEMINI.md, CLAUDE.md, .cursorrules, AGENTS.md):

### Long-Term Memory & Knowledge Graph Directives (Amneshia)
You are equipped with **Amneshia** (`amneshia`), a zero-external-database SQLite FTS5 long-term memory hub and Knowledge Graph.

1. **Session-Start Memory Retrieval**:
   - At the beginning of a conversation or session, call `search_memory` or `read_graph` to recall user context, active project preferences, entity relationships, and architectural decisions.
2. **Proactive Fact & Preference Persistence**:
   - Whenever the user shares a new preference, personal detail, workflow choice, or project update, proactively invoke `add_observations` or `create_entities` to store it permanently in Amneshia.
3. **Conflict Resolution & Consolidation**:
   - When user preferences change or old statements are updated, append the revision via `add_observations`, or call `consolidate_memory` ("Sleep Cycle") to track update histories and supersede outdated memories automatically.

License

MIT © Sabil Murti (Murtix)

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选