Files
mcp-memory/EFFECTIVE_DISCOURSE.md
T

4.9 KiB

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 the new 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. 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

3. 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

4. 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

5. 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.

6. Proactive Background Hooks & Autonomous Review

The Memory Server actively watches your filesystem for changes in .rs, .lua, .md, and .toml files.

  • Don't say: "Can you run a linter and review the file I just saved?"
  • Do say: "I just saved file.rs, check the autonomous review results to see if the daemon found any issues." (The daemon hooks fire automatically on file save).

7. Neovim Ghost Text (Live Previews)

Keep your workflow entirely within your editor rather than copy-pasting code blocks from the chat.

  • Don't say: "Write the updated function here so I can copy-paste it."
  • Do say: "Push this refactor to my active Neovim buffer as ghost text so I can review it in-line."
  • Tool Triggered: nvim_set_preview (via win-nvim or linux-nvim)

8. 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

9. Interactive Terminal Execution

When asking the LLM to run commands that have prompts, long output, or ANSI colors.

  • Don't say: "Run cargo run and tell me what the output is." (Hides output, hangs on prompts).
  • Do say: "Send the cargo run command to my Neovim terminal split so I can interact with it."
  • Tool Triggered: nvim_send_to_terminal

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 & Decay Management

Actively instruct the LLM to maintain its own memory constraints and organize data. The daemon automatically consolidates old sticky notes and snippets to prevent unbounded context growth.

  • Do say: "Log this architectural decision in the knowledge graph."
  • Do say: "Add a sticky note with the test database credentials for this session."
  • 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

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.