Newer
Older
navi-1 / manuals / file_ai.md

file_ai — Manual

What it does

Uses an LLM to answer a question about one file (ask) or apply a natural-language change to it (edit). Both spend an LLM call, so they are the last resort after filesystem_read and filesystem_write.

Actions

Action Use it for
ask "What does calculate() return?", "Which env vars does this read?", "Where is UserManager defined?"
edit "Rename process to handle_request", "Add type hints to every function"

When to use it

Use ask to avoid reading a large file when you need one fact from it. The answer comes back instead of the file, and large files are split into overlapping chunks.

Use edit only when the change cannot be expressed as exact text (filesystem_write edit) or line numbers (filesystem_write edit_lines). It reads the whole file, may touch more than you asked, and is not deterministic.

{"action": "ask", "path": "src/app.py", "question": "What does calculate() return?"}
{"action": "ask", "path": "deploy.sh", "question": "Which environment variables does this read?"}
{"action": "edit", "path": "src/app.py", "instruction": "Rename process to handle_request"}
{"action": "edit", "path": "src/app.py", "instruction": "Add type hints to every function"}

Limits

  • edit refuses files larger than about 200 KB; read the relevant section with filesystem_read and use edit_lines instead.
  • A successful edit returns an operation summary and a numbered diff, so you can verify the result.
  • If the LLM cannot produce valid operations, the call fails with invalid_ai_response — rephrase the instruction or use a deterministic edit.

Access

The same sandbox rules as the other file tools: in multi-user mode the path must be inside user_data/<user_id>/ or the current session directory.