API Reference
Process Query
Process a user query and return an LLM-generated response
POST
Process Query
Main endpoint for querying the RAG system. Performs semantic search in your documents and generates an intelligent response based on the found context.Endpoint
Request Body
string
required
The user’s question or query
string
ID of the collection to query (default: all collections)
integer
default:"5"
Maximum number of source documents to retrieve (1-20)
boolean
default:"true"
Use the LLM to generate a response. If false, returns only relevant sources.
object
Metadata filters to refine the search
Response
string
Unique query identifier
string
Response generated by the LLM (null if use_llm=false)
array
List of source documents used
integer
Execution time in milliseconds
string
ISO 8601 query timestamp
Examples
Error Codes
Bad Request
Invalid request (missing or incorrect parameters)
Internal Server Error
Server error (LLM unavailable, processing error)
Gateway Timeout
Request timeout (>60 seconds)
Best Practices
Optimize Performance
Optimize Performance
- Adjust
max_resultsaccording to your needs (less = faster) - Use
use_llm=falsefor pure search without generation - Add metadata filters to refine the search
Improve Answer Quality
Improve Answer Quality
- Formulate clear and precise questions
- Use terms specific to your domain
- Increase
max_resultsfor more context (5-10)
Use Metadata Filters
Use Metadata Filters
Handle Errors
Handle Errors
Limitations
Technical Notes
Search Process
- Query embedding: Conversion to vector (384 dimensions)
- Vector search: K-nearest neighbors search in Qdrant (cosine similarity)
- Filtering: Application of metadata filters if provided
- Relevance threshold: Only results with score > 0.7 are kept
- Content retrieval: Getting full text of chunks
- LLM generation: Prompt construction and response generation
LLM Prompt Format
See Also
Upload Documents
Add documents to the system
Collections
Organize your documents

