From adfa6305782c3c4b909e3d29bde9b8085b2f672c Mon Sep 17 00:00:00 2001 From: n1kt4r Date: Thu, 15 Oct 2026 17:40:37 +0500 Subject: [PATCH] Remove memory_research (depended on unreliable SearXNG); research now uses built-in web_search --- AGENTS.md | 2 +- ARCHITECTURE.md | 7 +++---- EXAMPLES.md | 6 +++--- README.md | 2 +- mcp_server.py | 23 ----------------------- 5 files changed, 8 insertions(+), 32 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5e824e5..7e2ec9e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -32,7 +32,7 @@ Read this file before answering any question about knowledge, memory, or researc | "What should you research next?" · "What gaps exist?" · "What is missing?" | `memory_list_gaps` | | "What do you know about X?" · "Find X in memory" | `memory_search` | | "Give me context about X" (before answering) | `memory_get_context` | -| "Research X on the internet" | `memory_research` | +| "Research X on the internet" | `web_search` → `web_fetch` → `memory_ingest` → `memory_verify` | | "Save/store this fact" | `memory_store` | | "Ingest this URL / file / text" | `memory_ingest` | | "Is X true?" · "Check this fact" | `memory_verify` | diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 3819816..c44f16a 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -1,7 +1,7 @@ # Pegas Memory — Architecture Pegas Memory is the long-term memory and knowledge base for the **Pegas** research agent. -It is a Python service exposed to the agent as an **MCP server** (14 tools). +It is a Python service exposed to the agent as an **MCP server** (13 tools). --- @@ -14,7 +14,7 @@ It is a Python service exposed to the agent as an **MCP server** (14 tools). └───────────────────┬──────────────────────┘ │ JSON-RPC 2.0 / stdio ┌───────────────────▼──────────────────────┐ - │ mcp_server.py (tool layer, 14 tools) │ + │ mcp_server.py (tool layer, 13 tools) │ └───────────────────┬──────────────────────┘ │ Python API ┌────────────────────────────┼────────────────────────────┐ @@ -153,7 +153,7 @@ Only single-token kinds (no spaces) are accepted — human-readable rules from d --- -## 6. MCP tools (14) +## 6. MCP tools (13) | Tool | Purpose | |---|---| @@ -165,7 +165,6 @@ Only single-token kinds (no spaces) are accepted — human-readable rules from d | `memory_verify` | self-critique + cross-confirmation | | `memory_add_gap` | register a research gap | | `memory_list_gaps` | list open gaps | -| `memory_research` | full research cycle for one question | | `memory_store_code` | extract + store code symbols | | `memory_search_code` | lexical search over code symbols | | `memory_code_graph` | build symbol + dependency graph | diff --git a/EXAMPLES.md b/EXAMPLES.md index d695701..cc7d6b1 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -91,9 +91,9 @@ If nothing is found → say "not in the knowledge base" and offer to research it 1. memory_search("HNSW") → [] # not known yet 2. memory_add_gap("How does HNSW work?", reason = "low_coverage", priority = 0.8) -3. memory_research("How does HNSW indexing work?") - → searches the web, ingests sources, - distills atoms, saves them +3. web_search(["How does HNSW indexing work?"]) # built-in search + web_fetch(chosen_url) → full page text + memory_ingest(url) → distills atoms, saves them 4. memory_verify() → cross-confirm the new atoms 5. memory_search("HNSW") → now returns verified hits ``` diff --git a/README.md b/README.md index e9c2d47..33e7db6 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ schema.sql — DDL PostgreSQL - **Сервер**: [mcp_server.py](./mcp_server.py) — чистый stdlib, JSON-RPC 2.0, stdio. - **Инструменты** (видны модели как `mcp__pegas-memory__*`): `memory_search`, `memory_store`, `memory_ingest`, `memory_add_gap`, - `memory_list_gaps`, `memory_research`, `memory_stats`, `memory_get_context`. + `memory_list_gaps`, `memory_stats`, `memory_get_context`. - **Регистрация**: в `~/.dsh/profiles/web/cordis.patch.yml` через `@deepseek-ai/dsh-mcp-client`. - **Live-reload**: профиль web имеет `patchReload: live` — изменения конфига подхватываются без рестарта (проверено: сервер спавнится автоматически). diff --git a/mcp_server.py b/mcp_server.py index bf8220a..e061dff 100644 --- a/mcp_server.py +++ b/mcp_server.py @@ -126,16 +126,6 @@ def _tool_list_gaps(args): return json.dumps({"gaps": gaps}, ensure_ascii=False, indent=2), False -def _tool_research(args): - from pegas_memory import research - question = str(args.get("question") or "").strip() - if not question: - return json.dumps({"error": "пустой question"}, ensure_ascii=False), True - result = research.research_question(_conn(), question) - _sync() - return json.dumps(result, ensure_ascii=False, indent=2), False - - def _tool_stats(args): c = _conn() with c.cursor() as cur: @@ -310,18 +300,6 @@ TOOLS = [ "отсортированный по приоритету. Вызывай, чтобы узнать, что ещё нужно исследовать.", "inputSchema": {"type": "object", "properties": {}, "required": []}, }, - { - "name": "memory_research", - "description": "Полный цикл исследования вопроса: веб-поиск, загрузка найденных источников, " - "дистилляция в атомы, сохранение. Для ручного поиска используй встроенный web_search.", - "inputSchema": { - "type": "object", - "properties": { - "question": {"type": "string", "description": "Исследовательский вопрос."}, - }, - "required": ["question"], - }, - }, { "name": "memory_stats", "description": "Сколько всего в твоей базе знаний: атомов, документов, открытых пробелов. " @@ -463,7 +441,6 @@ def handle(msg): "memory_ingest": _tool_ingest, "memory_add_gap": _tool_add_gap, "memory_list_gaps": _tool_list_gaps, - "memory_research": _tool_research, "memory_stats": _tool_stats, "memory_store_code": _tool_store_code, "memory_search_code": _tool_search_code,