Query Rag
POST /api/agents/pipeline/research/rag-query
Query RAG system for relevant documents via Lagan.
Splits body.research_terms on commas, dedupes to
MAX_RESEARCH_TERMS, fans out one concurrent
divinity/lagan-research-query dispatch per term via
asyncio.gather(..., return_exceptions=True) so a single failing term
degrades gracefully instead of sinking the whole batch. Response carries
terms_submitted / terms_processed / terms_failed so the
client can surface partial-success states.
Request Body required
Section titled “Request Body required ”Request for RAG query.
object
Comma-separated terms
Responses
Section titled “ Responses ”Successful Response
Response for RAG query.
object
Single RAG result.
object
Document content
Relevance score
Source name
object
Deduplicated result count before max_results trimming
Deduplication statistics for RAG queries.
object
Number of terms the client sent in research_terms
Number of terms actually queried (capped at MAX_RESEARCH_TERMS)
Number of queried terms whose LLM call raised an exception
Validation Error