knowledge_query
Answer questions using knowledge base (uploaded documents, handbooks, files).
Use for QUESTIONS that need an answer synthesized from documents or messages. Returns an evidence pack with source citations, KG entities, and extracted numbers.
Modes:
'auto' (default): Smart routing — works for most questions
'rag': Semantic search across documents & messages
'entity': Entity-centric queries (e.g., 'Tell me about [entity]')
'relationship': Two-entity queries (e.g., 'How is [entity A] related to [entity B]?')
Examples:
'What did we discuss about the budget?' → knowledge.query
'Tell me about [entity]' → knowledge.query mode=entity
'How is [A] related to [B]?' → knowledge.query mode=relationship
NOT for finding/listing files, threads, or links — use search.files / search.threads / search.links for that.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date_to | No | Filter messages until this date (ISO format: YYYY-MM-DD). | |
| file_ids | No | Specific file IDs to search within (for pinned files). Only ids returned by files.search or listed in the [ATTACHMENTS] block of THIS run; an id you have not seen in this workspace matches nothing and the search comes back empty. Leave it out to search the agent's collections. Numeric ids; numeric strings are accepted. | |
| question | Yes | The question to answer from user's knowledge base. Required even for entity queries. | |
| date_from | No | Filter messages from this date (ISO format: YYYY-MM-DD). Use for time-based queries like 'this week', 'last month'. | |
| thread_id | No | Limit search to a specific thread/chat | |
| max_sources | No | Maximum number of sources to consider (1-10) | |
| in_workspace | No | Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected. | |
| needs_aggregation | No | True if query asks for totals/sums/counts. | |
| include_relationships | No | Include KG relationships in answer (default: true for entity mode) |