Wiki pages
On this page

Agent Tools and RAG

In Agent mode the AI agent works through a set of tools that read and modify your cave, and in Ask mode it draws on a local retrieval index built from your notes. This page lists the available tools, explains how to disable individual ones, and describes how retrieval (RAG) is built and kept up to date. For provider setup and the difference between the modes, see AI Agent.

Tool catalog

The agent has access to the following tools. Read-only tools are available in both modes; the tools that change your cave are available only in Agent mode.

ToolWhat it does
read_noteRead a note’s content and backlinks by slug, or the currently active note
list_notesList all notes in the cave with their slugs
create_noteCreate a new markdown note in the cave
update_noteReplace the entire body of a note
edit_noteFind and replace text within a note’s body
delete_noteDelete a note from the cave
move_noteMove a note to a different folder
rename_noteRename a note in-place
create_folderCreate a new folder in the cave
rename_folderRename a folder in-place
move_folderMove a folder under a new parent
delete_folderDelete a folder and all its notes
open_daily_noteOpen or create today’s daily note
list_foldersList all folders in the cave
search_notesSearch notes by slug (case-insensitive)
search_contentSearch inside note bodies (full-text)
list_todosList todo checkboxes from notes, with optional filtering
toggle_todoToggle the completion status of a todo checkbox in a note
web_fetchFetch a webpage and return its content as markdown
web_searchSearch the web using Brave Search

web_fetch is always available and needs no API key. web_search is registered only when a Brave Search API key is configured.

Warning

In Agent mode the agent can create, edit, move, and delete notes and folders. These actions write to your files. Review what the agent proposes, and keep your cave under version control or backed up if you let the agent make changes unattended.

Disabling tools

You can prevent specific tools from being registered by listing their names in the disabled_tools setting in the cave’s agent configuration. A disabled tool is never offered to the model, regardless of mode. For example, you might disable delete_note and delete_folder to keep the agent from removing anything. See Configuration for where this setting lives.

Note that switching to Ask mode already removes every cave-modifying tool, so disabled_tools is mainly for restricting Agent mode further.

Retrieval (RAG)

In Ask mode the agent answers from your notes using retrieval-augmented generation. Your notes are embedded into vectors locally, on the CPU, using fastembed — no external service is involved and your note content does not leave your machine for embedding. The resulting vectors are cached in .granit/embeddings.bin inside the cave so they do not have to be recomputed on every launch.

When you ask a question, the most similar notes are retrieved and injected into the conversation as context. The rag_top_n setting controls how many notes are injected per query. A higher value gives the model more context at the cost of a larger prompt.

The index is built or rebuilt in the background when a cave is opened or when the RAG configuration changes. After that it is updated incrementally as you work: creating, saving, renaming, or deleting a note updates only the affected entries rather than rebuilding the whole index.

Note

Retrieval context is injected only in Ask mode. In Agent mode the model gathers information through the tools above instead. See AI Agent for the mode distinction and Configuration for the RAG settings.