adaptive-agent-mcp

adaptive-agent-mcp

A self-evolving RAG system that enables AI agents to autonomously read and write memory, continuously learning and adapting user preferences, daily logs, and knowledge graphs across applications.

Category
访问服务器

README

<div align="center">

<img src="https://raw.githubusercontent.com/justforever17/adaptive-agent-mcp/main/assets/logo.svg" alt="Adaptive Agent MCP" width="500">

Self-Evolving RAG for AI Agents

Agents don't just read memory — they write it.

License: MIT Python 3.10+ MCP PyPI

中文 | English

</div>


Core Concept

<table> <tr> <td width="50%">

Traditional RAG

User Input → Retrieve KB → Generate
               ↑
            Read-only
        (Human-maintained)

</td> <td width="50%">

Self-Evolving RAG

User Input → Retrieve Memory → Generate
               ↑↓
           Read + Write
    Agent autonomously evolves

</td> </tr> </table>

Key Differences:

Traditional RAG Adaptive Agent MCP
Read Retrieves pre-indexed documents Dynamically accumulates at runtime
Write Human-maintained knowledge base Agent writes autonomously
Scope Generic knowledge User-specific memory
State Static data Continuously evolves

How It Works

In Claude Code: "Remember, I prefer TypeScript"
         ↓
    Agent automatically calls:
    • append_daily_log() → Record to daily log
    • update_preference() → Update preferences
    • extract_knowledge() → Extract knowledge graph
         ↓
In Antigravity: "What are my coding preferences?"
         ↓
    AI: "You prefer TypeScript"

Teach once, remember forever. Share across apps, never forget.


Getting Started

Prerequisites

  1. Python 3.10+
  2. Ripgrep (rg): REQUIRED for full-text search. (Windows: choco install ripgrep, macOS: brew install ripgrep)
  3. SQLite: Handled automatically by Python.

Configuration (v0.6.0)

Configuration is managed via Environment Variables.

1. mcp.json Structure

{
  "mcpServers": {
    "adaptive-agent-mcp": {
      "command": "uvx",
      "args": ["adaptive-agent-mcp"],
      "env": {
        "ADAPTIVE_EMBEDDING_BASE_URL": "https://api.xxx.cn/v1",
        "ADAPTIVE_EMBEDDING_API_KEY": "sk-your-xxx-key",
        "ADAPTIVE_EMBEDDING_MODEL": "Qwen/Qwen2.5-Coder-7B-Instruct",
        "ADAPTIVE_RERANK_BASE_URL": "https://api.xxx.cn/v1",
        "ADAPTIVE_RERANK_API_KEY": "sk-your-xxx-key",
        "ADAPTIVE_RERANK_MODEL": "BAAI/bge-reranker-v2-m3"
      }
    }
  }
}

Local Models:

  • Ollama: Set ADAPTIVE_EMBEDDING_PROVIDER to ollama.
  • LM Studio/vLLM: Set ADAPTIVE_EMBEDDING_PROVIDER to openai_compatible.
  • Base URL: Set to your local endpoint (e.g., http://localhost:11434/v1 or http://localhost:1234/v1).
  • API Key: Any string.

2. Environment Variables

All variables are prefixed with ADAPTIVE_.

Variable Description Default
ADAPTIVE_STORAGE_PATH Storage location ~/.adaptive-agent/memory
ADAPTIVE_RIPGREP_PATH Path to rg executable Auto-detect
ADAPTIVE_EMBEDDING_PROVIDER Embedding provider (openai_compatible) openai_compatible
ADAPTIVE_EMBEDDING_BASE_URL API Endpoint None
ADAPTIVE_EMBEDDING_API_KEY API Key None
ADAPTIVE_EMBEDDING_MODEL Embedding Model Qwen/Qwen3-Embedding-8B
ADAPTIVE_RERANK_PROVIDER Rerank provider (cohere_compatible) cohere_compatible
ADAPTIVE_RERANK_BASE_URL API Endpoint None
ADAPTIVE_RERANK_API_KEY API Key None
ADAPTIVE_RERANK_MODEL Reranker Model Qwen/Qwen3-Reranker-8B

Default storage path: ~/.adaptive-agent/memory. All apps share the same memory.

Enhance Agent Memory Behavior (Optional)

If your AI doesn't actively read/write memory, add this to your system prompt or user rules:

## Memory System Instructions

- At the start of each conversation, call `initialize_session` to load user preferences.
- When user says "remember", "save", or expresses preferences, call `update_preference` or `append_daily_log`.
- After completing tasks, briefly record progress using `append_daily_log`.
- When user asks about past conversations, use `query_memory_headers` or `search_memory_content`.

Features

Feature Description Version
Three-Layer Memory MEMORY.md + Daily Logs + Knowledge Items v0.1.0
Scope Isolation project:xxx, app:xxx, global v0.2.0
Concurrent Safety Cross-process file locking + async locks v0.3.0
Incremental Indexing mtime-based smart updates v0.3.0
Hybrid Search Vector + FTS5 with RRF fusion v0.6.0
Rerank Service Cohere-compatible re-ranking for higher precision v0.6.1
Area Partitioning Scope-based knowledge routing v0.6.0
Knowledge Graph NetworkX-based entity relations v0.5.0
Async Foundation Non-blocking I/O throughout v0.6.0

Available Tools (14 tools)

Session & Retrieval

Tool Description
initialize_session Initialize session with user profile and recent context
query_memory_headers Index scan — browse memory file metadata
read_memory_content Read complete memory file content
search_memory_content Full-text search using ripgrep

Memory & Knowledge

Tool Description
update_preference Intelligently update user preferences
append_daily_log Append content to daily log or knowledge items
query_knowledge Hybrid search (Vector + FTS5 + RRF fusion) with browse fallback
delete_knowledge Soft-delete knowledge items
get_period_context Aggregate weekly/monthly logs for summaries
archive_period Save period summaries

Knowledge Graph

Tool Description
extract_knowledge Extract entity relations from text
add_knowledge_relation Manually add relations
query_knowledge_graph Query entities, relations, or stats
multi_hop_query Multi-hop reasoning queries

Storage Structure

~/.adaptive-agent/memory/
├── MEMORY.md                          # User preferences (scope-based)
├── knowledge/
│   └── areas/
│       ├── general/items.json         # Global knowledge
│       ├── chat/items.json            # Chat-scope knowledge
│       ├── coding/items.json          # Coding-scope knowledge
│       ├── writing/items.json         # Writing-scope knowledge
│       └── projects/{name}/items.json # Project-specific knowledge
├── .index/
│   ├── vectors.db                     # SQLite + sqlite-vec + FTS5
│   └── index.json                     # Indexer metadata
├── .graph/
│   └── knowledge.json                 # NetworkX graph
├── .locks/                            # File lock directory
└── memory/
    └── 2026/
        └── 02_february/
            └── week_07/
                └── 2026-02-10.md      # Daily logs

Data Safety

  • Isolated storage: Data stored in ~/.adaptive-agent/memory, independent of uvx installation
  • Concurrent safety: filelock prevents data corruption from multiple clients
  • Human-readable: All data in Markdown/JSON format, easy to backup and version control

License

MIT License - See LICENSE for details.


<div align="center">

Adaptive Agent MCPWhere agents learn, remember, and evolve.

</div>

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选