diff --git a/mcp_servers.json b/mcp_servers.json index be15b36..d890d95 100644 --- a/mcp_servers.json +++ b/mcp_servers.json @@ -26,6 +26,8 @@ "list_pending_changes" ] }, - "instructions": "MANDATORY: Before answering ANY question about infrastructure, servers, services, networks, documentation, or system inventory — you MUST call gnexus-book tools first.\n\nQuery mapping:\n- 'server X not working / status' → search_docs, get_inventory_item\n- 'what services run where' → list_inventory, get_relationships\n- 'update docs / fix documentation' → read_doc, propose_doc_change, commit_changes\n- 'is X up to date / freshness' → check_freshness\n- 'validate repository / repo state' → validate_repository, git_status\n\nDo NOT rely on memory or NAVI.md for infrastructure facts — they may be stale. Always pull current state from gnexus-book.\n\nAlways validate the repository before making changes. Do not store raw secrets in documentation." + "instructions": "MANDATORY: Before answering ANY question about infrastructure, servers, services, networks, documentation, or system inventory — you MUST call gnexus-book tools first.\n\nQuery mapping:\n- 'server X not working / status' → search_docs, get_inventory_item\n- 'what services run where' → list_inventory, get_relationships\n- 'update docs / fix documentation' → read_doc, propose_doc_change, commit_changes\n- 'is X up to date / freshness' → check_freshness\n- 'validate repository / repo state' → validate_repository, git_status\n\nDo NOT rely on memory or NAVI.md for infrastructure facts — they may be stale. Always pull current state from gnexus-book.\n\nAlways validate the repository before making changes. Do not store raw secrets in documentation. + +When you discover new infrastructure facts, service configurations, or relationships during tool execution, consider whether they should be persisted. For stable facts about servers, services, or network topology, use gnexus-book write tools (propose_doc_change, propose_inventory_item_change). For user-specific facts, use the memory tool instead. Choose the target based on scope, not habit."} } } diff --git a/navi/core/planning.py b/navi/core/planning.py index fd000f5..2c74b45 100644 --- a/navi/core/planning.py +++ b/navi/core/planning.py @@ -114,6 +114,11 @@ "- Domain: [user personal facts / infrastructure / own capabilities / external web]\n" "- Primary source: [memory / connected knowledge servers / NAVI.md / docs / web]\n" "- Fallback: [alternative source if primary is unavailable]\n" + "KNOWLEDGE CAPTURE:\n" + "- New information to save: [specific facts, conventions, or discoveries that should persist beyond this session]\n" + "- Target: [memory / NAVI.md / docs / gnexus-book / none — choose the best persistent store]\n" + "- Duplication check: [search memory first for: ]\n" + "- Rationale: [why this knowledge is stable and reusable]\n" "COMPLEXITY: simple | medium | complex — choose based on ambiguity, number of files/systems, risk, and autonomy needed.\n" "SUBTASKS:\n" "1. [discrete unit of work]\n" @@ -294,7 +299,10 @@ "- hard maximum: 15 steps\n" "Use enough steps to make execution unambiguous. Do not compress unrelated actions into one step.\n\n" "For every non-trivial task, include steps for information gathering from project notes/docs/files/tool schemas, " - "implementation or analysis, verification, final synthesis, and NAVI.md updates when stable reusable project facts are discovered.\n\n" + "implementation or analysis, verification, final synthesis, and knowledge persistence when stable reusable facts are discovered. " + "Choose the persistence target based on the fact's scope: memory tool for user-scoped facts, NAVI.md for project/directory conventions, " + "docs/ or manuals/ for project-wide documentation, gnexus-book for infrastructure inventory, or filesystem for standalone files. " + "Always search the target first to avoid duplicates.\n\n" "AGENT scoping rules (critical):\n" "- Each AGENT step is one focused, independently verifiable unit of work.\n" "- One AGENT step = one spawn_agent call later. Do NOT bundle multiple concerns.\n" diff --git a/persona.txt b/persona.txt index e00472c..9dfc293 100644 --- a/persona.txt +++ b/persona.txt @@ -163,6 +163,8 @@ Use the `memory` tool with action `save` BEFORE finishing your response whenever you learned something stable: personal facts (name, location, devices, server IPs), preferences and habits, ongoing projects, corrections. Key naming: short, stable, snake_case. Save overwrites by key. +Before calling `memory save`, always call `memory search` with the key or a related query to verify the fact does not already exist. If it exists, do not save a duplicate — skip or update if the value changed. + Do NOT save temporary states, one-off tasks, or anything session-specific. Use the `memory` tool with action `forget` only when the user explicitly asks to remove something that cannot simply be overwritten.