query_knowledge_base
Search a specified document, directory, or local workspace by content and answer questions from the best matching passages. Use it to retrieve relevant evidence without importing files.
Instructions
The main rag tool: search files or folders on disk by content and answer a question from them. Answer a question from one explicit supported document or deliberately scoped directory (doc_path; indexed on demand, no import step), or from a named local workspace shared with Studio and the rag CLI (workspace_id). Start with the smallest canonical file or subdirectory likely to contain the answer; do not scan a repository or workspace root by default. Increase search complexity only when evidence is insufficient: try exact terms, synonyms, and counterclaims before broadening the scope. For coverage or absence claims, use multiple differently worded questions. On a scan-limit error, narrow doc_path and continue. With conversation_id, continue and save a turn in the shared workspace conversation. Returns a written answer when the user has an answer key; otherwise it returns the best matching passages, numbered with file name and lines, for you to read and answer from. Scores and retrieval metadata remain internal.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The question to answer from the selected document scope | |
| doc_path | No | Required supported document or smallest deliberate directory scope. Repository and workspace roots are not implicit. | |
| extensions | No | Optional file-type filter for a directory, such as ['.md'] or ['pdf', 'docx']. Omit it to include every supported document type. | |
| workspace_id | No | A local workspace ID listed by `rag workspaces`. Use this instead of doc_path to query the same documents as a paired Studio workspace. | |
| conversation_id | No | Optional shared conversation ID; with workspace_id, continue its recorded context and save this answer there. | |
| conversation_revision | No | Optional expected revision; rejects stale context before a provider call. |