Files
mcp-memory/EFFECTIVE_DISCOURSE.md
T

132 lines
6.0 KiB
Markdown

# Effective Discourse: LLM Prompting Guide for MCP Memory
To get the most out of the Antigravity MCP Memory server and its advanced developer tools, use specific phrases that clearly state your intent. This guides the LLM to use the most efficient tools, reducing token consumption, speeding up time-to-resolve (T2R), and avoiding brute-force file reading.
---
## 1. Global Semantic Code Search & Navigation
Instead of having the LLM use brute-force text searches or `grep` to find abstract logic, instruct it to use local vector embeddings.
* **Don't say:** "Grep the codebase for database connection strings."
* **Do say:** "Perform a semantic code search for how database connections are established."
* **Tool Triggered:** `semantic_code_search`
---
## 2. Subgraph Expansion & Neighborhood Exploration
When inspecting complex system interactions or module dependencies around a target component.
* **Don't say:** "Tell me everything connected to the DatabaseTable node."
* **Do say:** "Get the subgraph expansion around 'DatabaseTable' up to 2 hops."
* **Tool Triggered:** `get_subgraph`
---
## 3. Automated Error Fix Suggestions
When encountering build failures, runtime crashes, or stack traces.
* **Don't say:** "Here is a stack trace, let's debug from scratch: [paste stack trace]"
* **Do say:** "Suggest an error fix for this stack trace before we start debugging."
* **Tool Triggered:** `suggest_error_fix`
---
## 4. Memory State Checkpointing & Safety Rollbacks
Before initiating risky refactors or running experimental multi-step subagents.
* **Don't say:** "Hope this refactor doesn't mess up our task board or memory graph."
* **Do say:** "Checkpoint the memory state under 'pre-refactor' before we begin."
* **Tool Triggered:** `checkpoint_state` / `restore_state`
---
## 5. Codebase Exploration & Token Efficiency
When entering a new file, avoid having the LLM read the entire contents blindly.
* **Don't say:** "Read server.rs and tell me what it does." *(Consumes massive tokens)*
* **Do say:** "Extract the AST skeleton of server.rs to understand its structure first."
* **Tool Triggered:** `read_file_skeleton`
---
## 6. Debugging & Log Parsing
Stop copy-pasting giant walls of logs into the chat interface.
* **Don't say:** "Here is the error: [paste 500 lines of logs]"
* **Do say:** "The daemon crashed. Fetch the recent logs from daemon.log." or "Watch the process logs for server.log."
* **Tool Triggered:** `get_recent_logs`, `watch_process_logs`
---
## 7. Git & Context Handoff
When you've been working independently and need to loop the LLM back in on your current state.
* **Don't say:** "I changed some files, here are the diffs..."
* **Do say:** "Get the active git worktree context to review my uncommitted changes before we continue."
* **Tool Triggered:** `get_active_worktree_context`
---
## 8. Clipboard Watch Mode (Research & Triage)
When you are doing intense debugging across StackOverflow, logs, and docs, use the clipboard watcher to auto-ingest your breadcrumbs.
* **Action:** Ask the LLM to turn it on: "Enable clipboard watch mode."
* **Do say:** "I'm going to reproduce the bug and copy some stack traces and IDs. Give me a minute, then read my latest sticky notes to catch up."
* **Tool Triggered:** `toggle_clipboard_watch_mode`, followed by internal Sticky Note reads.
---
## 9. Structural AST Editing
When asking the LLM to modify complex files, prevent indentation bugs and regex failures by guiding it to use tree-sitter.
* **Don't say:** "Search for `fn process()` and replace it with this string."
* **Do say:** "Use the AST node replacer to swap out the `process` function in `server.rs`."
* **Tool Triggered:** `replace_ast_node`
---
## 10. Bird's-Eye Repository Exploration
When the LLM is first analyzing a repository, don't let it run `ls -R` and guess.
* **Don't say:** "List the files in the directory and guess where the database code is."
* **Do say:** "Read the directory architecture to get a summary of what each file is responsible for."
* **Tool Triggered:** `read_directory_architecture`
---
## 11. Graph, Memory & Casing Standards
Actively instruct the LLM to maintain its memory constraints and use canonical casing.
* **Do say:** "Log this architectural decision in the knowledge graph using PascalCase for entity types."
* **Do say:** "Add a sticky note with the test database credentials for this session with a 1-hour TTL."
* **Do say:** "Create a milestone for the 'Rich Clipboard' feature and break it down into active tasks."
* **Tools Triggered:** `create_entities`, `log_decision`, `add_sticky_note`, `add_milestone`, `add_task`
---
## 12. Self-Healing Graph Maintenance
* **Don't say:** "Search for duplicates and orphaned entities in the graph manually."
* **Do say:** "Sweep graph health to identify orphaned entities and duplicate candidates."
* **Tool Triggered:** `sweep_graph_health`
---
## 13. Causal Lineage & Provenance
* **Don't say:** "Search all tasks, ADRs, and commits to explain why this file was changed."
* **Do say:** "Query lineage for `server/src/state.rs` to construct a causal timeline."
* **Tool Triggered:** `query_lineage`
---
## 14. Actionable Task Resolution
* **Don't say:** "List all tasks and figure out which ones are blocked."
* **Do say:** "Get the next actionable tasks to find unblocked work ready for execution."
* **Tool Triggered:** `get_next_actionable_tasks`
---
## 15. Diagnostic Hypotheses & Reasoning Traces
* **Don't say:** "Let's test three guesses and remember what we tried in chat."
* **Do say:** "Log a hypothesis for this memory leak with tested evidence."
* **Tool Triggered:** `log_hypothesis` / `query_hypotheses`
---
## 16. Context Workspace Diffing
* **Don't say:** "What is the difference between my feature workspace and the main workspace?"
* **Do say:** "Diff context workspaces between 'feature-branch' and 'main'."
* **Tool Triggered:** `diff_context_workspaces`
---
By phrasing requests around *actions* rather than *information retrieval*, the LLM is primed to leverage the rich MCP toolset built into the Antigravity Memory Server.