Skip to main content

Request Body

agent_id
string
required
The agent’s public ID (ag_*)
query
string
required
The search query (natural language question)
top_k
integer
default:"5"
Number of most relevant chunks to return (1–20)

Response 200

Response Fields

results
array
Ranked list of matching chunks
results[].content
string
The text content of the chunk
results[].source_name
string
Name of the knowledge source
results[].source_type
string
Source type (text, url, file, etc.)
results[].similarity_score
number
Cosine similarity (0.0–1.0). Higher = more relevant
results[].chunk_index
integer
Position of this chunk within its source
query
string
The original search query
total_results
integer
Number of results returned

Use Cases

  • Debug retrieval quality: Verify that the right content is being found for specific questions
  • Tune chunk size: Check if chunks are too large (low relevance) or too small (missing context)
  • Validate knowledge: Confirm that newly added sources are indexed and retrievable

Errors