ai_knowledge_query
Query an AI Knowledge project with RAG to get LLM answers or retrieve document chunks as context.
Instructions
Legacy AI Knowledge API: query an AI Knowledge project with RAG or retrieve context only. For new one-product agents, use Agent Factory messages/send or messages/stream with Storage-backed file_search.
Use method='query' (default) for full RAG response with LLM answer. Use method='context' to retrieve document chunks only without LLM response.
Requires a legacy AI Knowledge project API key (from AI Knowledge > API & Webhooks).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | User question or query text | |
| apiKey | Yes | Legacy AI Knowledge project API key (from AI Knowledge > API & Webhooks) | |
| method | No | query=RAG with LLM response, context=chunks only | |
| filters | No | Document filters for RAG context | |
| history | No | Conversation history for context | |
| projectId | Yes | Legacy AI Knowledge project ID | |
| environment | No | Optional environment name (from PRISME_ENVIRONMENTS) to use specific API URL | |
| tool_choice | No | Force specific tools to be used | |
| numberOfSearchResults | No | Number of chunks to retrieve (for context method) |