Remove memory_research (depended on unreliable SearXNG); research now uses built-in web_search

This commit is contained in:
n1kt4r committed 2026-10-15 17:40:37 +05:00
1 parent d1c87572ee
commit adfa630578
5 files changed
+8 -32

No files matched your search

+1 -1
View File
@@ -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` |
+3 -4
View File
@@ -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 |
+3 -3
View File
@@ -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
```
+1 -1
View File
@@ -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` — изменения конфига
подхватываются без рестарта (проверено: сервер спавнится автоматически).
-23
View File
@@ -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,