Knowledge, evaluations, and benchmarks API
Ingest and search knowledge, evaluate answers and workflows, and compare model benchmark results.
Use these endpoints to build a knowledge collection, retrieve grounded context, measure answer quality, run evaluation datasets, and compare models. The RAG and evaluation-run routes described here require an authenticated Agent Studio browser session; the dataset and benchmark handlers do not perform a session check in the current implementation.
https://agent-studio.example.com as a placeholder. Replace it with your Agent Studio origin. For session-protected routes, send the session cookie issued by your configured authentication provider. API-key coverage is not implied.Common responses
Successful requests return JSON. Most operations use success: true; RAG ingestion returns the created document, searches identify their mode, and evaluation or benchmark operations return a data object. A missing session returns 401. Validation failures return 400, and an unexpected execution failure returns 500 with an error string.
Knowledge ingestion
Ingest text
/api/rag/ingestNon-empty document text.
Document title. Defaults to `Untitled Document`.
Collection namespace. Defaults to `default`.
Source identifier or URL.
Content type. Defaults to `text/plain`.
Chunking configuration.
Metadata stored with the document.
Tags added to the stored metadata.
Embedding model override.
Enable parent-child chunking. Defaults to `false`.
curl --request POST \
--url https://agent-studio.example.com/api/rag/ingest \
--header 'Content-Type: application/json' \
--data '{
"content": "<string>",
"title": "<string>",
"collection": "<string>",
"source": "<string>",
"mimeType": "<string>",
"chunking": {},
"metadata": {},
"tags": [],
"embeddingModel": "<string>",
"useParentChunking": false
}'{ "success": true, "document": { "documentId": "doc_example", "chunkCount": 4, "totalTokens": 830 } }curl -X POST 'https://agent-studio.example.com/api/rag/ingest' \
-H 'Content-Type: application/json' \
-H 'Cookie: __session=<session-cookie>' \
-d '{"title":"Support policy","collection":"support","content":"Refund requests must include an order ID.","tags":["policy"]}'Ingest a URL
/api/rag/fetch-urlHTTP or HTTPS URL to fetch.
Target collection. Defaults to `default`.
Tags stored with the document.
Chunking configuration.
Enable parent-child chunking. Defaults to `false`.
Embedding model override.
curl --request POST \
--url https://agent-studio.example.com/api/rag/fetch-url \
--header 'Content-Type: application/json' \
--data '{
"url": "https://example.com/policy",
"collection": "support",
"tags": [
"policy"
],
"chunking": {},
"useParentChunking": false,
"embeddingModel": "text-embedding-3-small"
}'{ "success": true, "document": { "title": "Example policy", "url": "https://example.com/policy", "chunkCount": 6, "totalTokens": 1200, "documentId": "doc_example" } }The fetch operation follows redirects, allows at most 15 seconds, rejects pages larger than 5 MB, and requires at least 50 characters of extracted content.
Retrieval and analysis
Search knowledge
/api/rag/searchNon-empty search query.
Collection to search.
Maximum results. Defaults to `5`.
Minimum relevance score. Defaults to `0.2`.
Metadata constraints applied during retrieval.
Return grounded question answering output. Defaults to `false`.
Return a prompt containing retrieved context. Defaults to `false`.
Prompt used by augmentation mode.
System instruction used by answer generation.
Combine vector and lexical search. Defaults to `false`.
Return parent context for matching child chunks. Defaults to `false`.
Rerank retrieved results. Defaults to `false`.
Use hypothetical-document retrieval. Defaults to `false`.
curl --request POST \
--url https://agent-studio.example.com/api/rag/search \
--header 'Content-Type: application/json' \
--data '{
"query": "What does a refund request require?",
"collection": "support",
"limit": 5,
"minScore": 0.2,
"metadataFilter": "\"tags\":[\"policy\"]",
"generateAnswer": false,
"augmentPrompt": true,
"basePrompt": "Answer using only the supplied context.",
"systemPrompt": "Be concise and cite the retrieved policy.",
"useHybridSearch": true,
"expandToParent": false,
"useReranking": true,
"useHyDE": false
}'{ "success": true, "mode": "search", "chunkCount": 1, "results": [ { "content": "Refund requests must include an order ID.", "score": 0.87 } ] }Set only one of generateAnswer or augmentPrompt. Answer mode takes precedence when both are true; otherwise the endpoint returns raw search results. When no chunks pass the threshold, the response includes a warning to lower minScore or broaden the metadata filter.
Evaluate a grounded answer
/api/rag/evaluateThe original question.
Context supplied to the answer. Defaults to an empty array.
The answer to evaluate.
curl --request POST \
--url https://agent-studio.example.com/api/rag/evaluate \
--header 'Content-Type: application/json' \
--data '{
"query": "What does a refund request require?",
"contextChunks": [
"Refund requests must include an order ID."
],
"generatedAnswer": "A refund request must include an order ID."
}'{ "success": true, "evaluation": { "contextRelevance": 0.9, "groundedness": 0.86, "answerRelevance": 0.92 } }List knowledge documents
/api/rag/documentsFilter by collection.
Maximum documents. Defaults to `50`.
Number of documents to skip. Defaults to `0`.
Include collection names when exactly `true`.
curl --request GET \ --url https://agent-studio.example.com/api/rag/documents?collection=support&limit=50&offset=0&includeCollections=true
{ "success": true, "documents": [], "total": 0, "stats": {}, "collections": ["support"] }Delete a knowledge document
/api/rag/documentsDocument ID owned by the current user.
curl --request DELETE \ --url https://agent-studio.example.com/api/rag/documents?id=doc_example
{ "success": true, "deletedId": "doc_example" }Evaluation datasets and runs
List datasets
/api/evals/datasetscurl --request GET \ --url https://agent-studio.example.com/api/evals/datasets
{ "success": true, "data": [], "totalCount": 0 }Create a dataset
/api/evals/datasetsDataset name.
Evaluation cases.
Defaults to `Custom Evaluation Dataset`.
Defaults to `CUSTOM`.
Defaults to `GRAPH`.
curl --request POST \
--url https://agent-studio.example.com/api/evals/datasets \
--header 'Content-Type: application/json' \
--data '{
"name": "Support answers",
"items": [],
"description": "Regression cases for support answers",
"category": "CUSTOM",
"targetType": "GRAPH"
}'{ "success": true, "data": { "id": "dataset_example", "name": "Support answers", "items": [] } }Run an evaluation
/api/evals/runEvaluation dataset ID.
Defaults to `GRAPH`.
Defaults to `default_target`.
Defaults to `Agent Mission Control Graph`.
Model used by the target.
Judge model, temperature, metrics, pass threshold, and optional custom instructions.
curl --request POST \
--url https://agent-studio.example.com/api/evals/run \
--header 'Content-Type: application/json' \
--data '{
"datasetId": "dataset_example",
"targetType": "GRAPH",
"targetId": "default_target",
"targetName": "Support workflow",
"targetModel": "meta-llama/llama-3.3-70b-versatile",
"judgeConfig": "\"temperature\":0,\"passThreshold\":0.75"
}'{ "success": true, "data": { "id": "run_example", "status": "COMPLETED", "summary": { "overallScore": 84, "passRate": 80 } } }The default judge uses temperature 0, pass threshold 0.75, and the FAITHFULNESS, ANSWER_RELEVANCE, SEMANTIC_CORRECTNESS, and SAFETY_POLICY metrics.
List evaluation runs
/api/evals/runscurl --request GET \ --url https://agent-studio.example.com/api/evals/runs
{ "success": true, "data": [], "totalCount": 0 }Compare evaluation runs
/api/evals/compareFirst run ID.
Second run ID.
curl --request GET \ --url https://agent-studio.example.com/api/evals/compare?runA=run_a&runB=run_b
{ "success": true, "data": { "runA": "run_a", "runB": "run_b" } }Benchmarks
List benchmark suites
/api/benchmarks/suitescurl --request GET \ --url https://agent-studio.example.com/api/benchmarks/suites
{ "success": true, "data": { "suites": [], "totalSuites": 0, "totalTestCases": 0 } }Run a benchmark
/api/benchmarks/runSuite ID. An unknown or absent ID selects the first built-in suite.
Model ID. Defaults to the suite recommendation, then the configured fallback.
Scorecard label. Defaults to `Active Agent Architecture`.
curl --request POST \
--url https://agent-studio.example.com/api/benchmarks/run \
--header 'Content-Type: application/json' \
--data '{
"suiteId": "suite_example",
"model": "meta-llama/llama-3.3-70b-versatile",
"skillName": "Support triage"
}'{ "success": true, "data": { "skillName": "Support triage", "overallScore": 87 } }Compare benchmark models
/api/benchmarks/compareSuite ID. An unknown or absent ID selects the first built-in suite.
One or more model IDs.
curl --request POST \
--url https://agent-studio.example.com/api/benchmarks/compare \
--header 'Content-Type: application/json' \
--data '{
"suiteId": "suite_example",
"models": [
"meta-llama/llama-3.3-70b-versatile"
]
}'{ "success": true, "data": [], "suiteId": "suite_example", "suiteName": "Example suite" }