Clarify memory_query_graph: kind is an EDGE type, not an atom type

This commit is contained in:
n1kt4r committed 2026-10-15 16:03:27 +05:00
1 parent 3b5cd2e771
commit 16c843966e
2 files changed
+16 -8

No files matched your search

+4 -1
View File
@@ -37,7 +37,7 @@ Read this file before answering any question about knowledge, memory, or researc
| "Is X true?" · "Check this fact" | `memory_verify` | | "Is X true?" · "Check this fact" | `memory_verify` |
| "Analyze this code / build a code graph" | `memory_code_graph` | | "Analyze this code / build a code graph" | `memory_code_graph` |
| "Find a function/class named X" | `memory_search_code` | | "Find a function/class named X" | `memory_search_code` |
| "Show relations / graph edges" | `memory_query_graph` | | "Show relations / graph edges" | `memory_query_graph` — `kind` is an **edge** type (`imports`/`depends_on`/`calls`/`inherits`/`related`), not an atom type |
| "Remember to research X later" | `memory_add_gap` | | "Remember to research X later" | `memory_add_gap` |
| "Run logical inference" | `memory_infer` | | "Run logical inference" | `memory_infer` |
@@ -84,6 +84,9 @@ Every atom needs a **claim** (one short sentence) and, where possible, provenanc
Searching the web for your own base wastes calls and returns nothing useful. Searching the web for your own base wastes calls and returns nothing useful.
- **Reading a directory.** `read` expects a *file*. Use `bash` (`ls`) or the fs-search tool - **Reading a directory.** `read` expects a *file*. Use `bash` (`ls`) or the fs-search tool
for directories. `read /some/dir` fails with "not a regular file". for directories. `read /some/dir` fails with "not a regular file".
- **`memory_query_graph` with an atom type.** Its `kind` is an **edge** type
(`imports`, `depends_on`, `calls`, `inherits`, `related`) — never `text`/`fact` (those are atom
types). Omit `kind` entirely to get all edges.
- **Storing raw text.** Do not `memory_store` whole articles. Distill first - **Storing raw text.** Do not `memory_store` whole articles. Distill first
(`memory_ingest`) or write one atomic claim. (`memory_ingest`) or write one atomic claim.
- **Skipping verification.** An unverified atom stays `candidate`. Cross-confirm it. - **Skipping verification.** An unverified atom stays `candidate`. Cross-confirm it.
+12 -7
View File
@@ -244,7 +244,7 @@ def _tool_verify(args):
TOOLS = [ TOOLS = [
{ {
"name": "memory_search", "name": "memory_search",
"description": "Семантический поиск по базе знаний Pegas Memory (Qdrant, EmbeddingGemma 2). " "description": "Семантический поиск ВНУТРИ твоей базы знаний Pegas Memory (не в интернете!). "
"Возвращает типизированные атомы (text/definition/logical_rule/code/table/fact) " "Возвращает типизированные атомы (text/definition/logical_rule/code/table/fact) "
"с оценкой сходства. Фильтры: type, status (candidate/verified/stale/contested).", "с оценкой сходства. Фильтры: type, status (candidate/verified/stale/contested).",
"inputSchema": { "inputSchema": {
@@ -306,7 +306,8 @@ TOOLS = [
}, },
{ {
"name": "memory_list_gaps", "name": "memory_list_gaps",
"description": "Список открытых пробелов в базе знаний (по приоритету).", "description": "Список открытых пробелов (вопросов, на которые пока нет ответа) в базе, "
"отсортированный по приоритету. Вызывай, чтобы узнать, что ещё нужно исследовать.",
"inputSchema": {"type": "object", "properties": {}, "required": []}, "inputSchema": {"type": "object", "properties": {}, "required": []},
}, },
{ {
@@ -323,7 +324,8 @@ TOOLS = [
}, },
{ {
"name": "memory_stats", "name": "memory_stats",
"description": "Статистика базы знаний: число атомов, документов, открытых пробелов.", "description": "Сколько всего в твоей базе знаний: атомов, документов, открытых пробелов. "
"Вызывай, когда пользователь спрашивает, ЧТО хранится в базе или её состояние.",
"inputSchema": {"type": "object", "properties": {}, "required": []}, "inputSchema": {"type": "object", "properties": {}, "required": []},
}, },
{ {
@@ -384,12 +386,14 @@ TOOLS = [
}, },
{ {
"name": "memory_query_graph", "name": "memory_query_graph",
"description": "Запросить граф: список рёбер (по kind или все), счётчики узлов.", "description": "Запросить граф связей: рёбра между знаниями/кодом и счётчики узлов. "
"ВАЖНО: kind — это тип РЕБРА (связи), НЕ тип атома (text/fact/...) и НЕ поисковый запрос. "
"Если не уверен в типе ребра — оставь kind пустым, вернутся все рёбра.",
"inputSchema": { "inputSchema": {
"type": "object", "type": "object",
"properties": { "properties": {
"kind": {"type": "string", "description": "Фильтр по kind ребра (опционально)."}, "kind": {"type": "string", "description": "Тип РЕБРА (не тип атома!): imports | depends_on | calls | inherits | related. Оставь пустым — вернутся все рёбра."},
"top_k": {"type": "integer", "default": 50, "description": "Число рёбер."}, "top_k": {"type": "integer", "default": 50, "description": "Сколько рёбер вернуть (1-200)."},
}, },
"required": [], "required": [],
}, },
@@ -412,7 +416,8 @@ TOOLS = [
{ {
"name": "memory_get_context", "name": "memory_get_context",
"description": "Собрать релевантный контекст для агента по запросу (поиск + форматирование).", "description": "Собрать релевантный контекст из твоей базы для ответа (поиск по атомам + форматирование). "
"Используй перед ответом на вопрос, чтобы опереться на уже известные факты.",
"inputSchema": { "inputSchema": {
"type": "object", "type": "object",
"properties": { "properties": {