Skip to main content
Use the AI Baseline API to ask natural-language questions about a knowledge base and receive rendered evidence, metadata summaries, dashboards, or ready-to-feed agent context. Each knowledge base belongs to an organization and uses a domain that defines how its material is interpreted and queried. These docs use the S&P 500 SEC filings knowledge base as a worked example. The same API serves other knowledge bases with their own data, domain, and access permissions. Start with organizations, knowledge bases, and domains to understand how they fit together.

Base URL

org identifies the owning organization; base identifies the knowledge base within it. v2 selects the REST API contract. Use the exact identifiers supplied for your knowledge base. For the S&P 500 example, the organization is baseline and the knowledge base is sandp500:
Every request must include your API key:

Endpoints

Append each endpoint to the base URL above. Corpus overview describes inventory and coverage; use query evidence to support factual answers.

Minimal Query

This request defaults to mode: "basic" and effort: "medium". It returns rendered evidence, evidence_instructions, evidence_budget, and summary by default.

Response Shape

/query returns a response with a stable request_id and optional top-level sections:
SectionContains
evidenceGrounding text selected by include.evidence_format; both formats retain source metadata once and the same per-entry citation records.
evidence_instructionsGuidance for downstream LLMs on how to use the returned evidence. Returned by default when evidence is included.
agent_contextDerived Markdown context block for direct handoff to another LLM or agent.
metadata_distributionMetadata distribution keyed by canonical field names, with readable display names and metric values inside each entry.
metadata_dashboardRendered ASCII summary of the metadata distribution.
summarySelected mode, effort, filters, warnings, and evidence-path count.
coverageTask-aware requirement coverage for agentic_research, including missing or budget-omitted inputs.
evidence_budgetDeterministic evidence token estimate, optional requested cap, available and returned chain counts, and truncation status.
retrieval_planRetrieval query plan for agentic_research.

Response Privacy

Public query responses use a strict field allowlist. They never include internal retrieval diagnostics, graph entry points, evidence-chain diagnostic summaries, retrieval metadata, or resolved internal retrieval parameters. This applies to basic, research, and agentic_research responses, including streaming and error branches. This response contraction is a security and privacy hardening change. The request-side retrieval.max_evidence and retrieval.max_evidence_tokens controls remain supported; there is no response-side retrieval object.

Example Response Sections

Responses always include request_id. By default, /query returns rendered evidence, evidence_instructions, evidence_budget, and summary. Other top-level sections are returned when enabled by include or by the selected query mode. The examples below are abbreviated to show their structure.

request_id

evidence

The API returns evidence as a string. Both evidence formats keep document metadata once in <source_registry> and use the same citation projection. Follow the inline citation guide for contributing-record attribution, short-link lifetime and missing-link behavior. relevance_score is a system-derived integer from 0 to 10 that indicates how closely the evidence chain matches the query. confidence_score reflects the system’s confidence in the specific fact captured by that entry. An entry can cite multiple sources: all cited sources support the shared <consensus> claim, while each source can contribute distinct <observed_epistemic_statuses> and <additional_context>. Abbreviated JSON envelope:
The expanded example below follows the Apple supply-chain question above. It illustrates evidence drawn from Apple’s 2024 and 2025 10-K Item 1A disclosures. Chain, entry and citation IDs are shortened for readability; actual responses use stable identifiers. The citation URLs are illustrative and are not working links.
The consensus cites c1 and c3, passages from the 2025 and 2024 filings that support the shared claim. The additional-context item cites only c2, the passage from the 2025 filing supporting the assembly detail. Two passages from the same filing share a source ID but have separate citation IDs and URLs. Each supplied URL opens the retained document at its cited location; document metadata stays in the registry.

evidence_instructions

evidence_instructions is returned by default when evidence is included. This top-level string contains guidance for how a downstream LLM should use the returned evidence to generate a grounded answer. It is separate from the evidence content itself. Set include.evidence_instructions to false to omit it.

agent_context

Set include.agent_context to true to return agent_context. This top-level object is intended for direct handoff to another LLM or agent. It is a derived convenience payload, not the canonical evidence contract. Clients building custom prompts or UIs should use evidence and evidence_instructions directly. Request agent_context without duplicating the raw top-level evidence fields:
content_type is currently always "text/markdown". text combines the evidence-use instructions with the selected evidence format. With evidence_format: "rendered", the context includes rendered evidence; with evidence_format: "xml", it includes XML evidence with the same public XML formatting behavior as top-level evidence. For agentic_research, the context also contains the coverage assessment and source_fields includes "coverage".

metadata_distribution

This abbreviated example shows two distribution metrics keyed by canonical field names. evidence_paths is the evidence-path count. Metric entries include display_name plus values for distributions, or value for text summaries. The ... entry marks omitted metrics and is not returned literally.

metadata_dashboard

The API returns metadata_dashboard as a string. Returned JSON field:
Same value, expanded:

summary

summary.domain identifies the selected knowledge base’s domain. In this example, sandp_500 is the domain ID, while sandp500 is the knowledge-base ID in the URL. Several knowledge bases can use the same domain without sharing data or permissions.

coverage

coverage is returned for agentic_research. It compares the independently required retrieval inputs with the evidence chains actually delivered to the caller.
Overall status is complete, partial, none, or not_assessed. Requirement status is covered, missing, or omitted_by_budget. Coverage means at least one complete delivered chain is associated with each planned requirement; it does not independently verify the contents of that chain.

evidence_budget

evidence_budget is returned whenever evidence or agent_context is requested. requested_max_tokens is null when no token cap was supplied, which is the default.
Set a strict estimated-token cap with retrieval.max_evidence_tokens. The estimator is ceil(projected evidence characters / 4) and is not provider-exact. Budgeting keeps complete chains and includes their regenerated source registry in the estimate.

retrieval_plan

Start with the quickstart, then use the API reference for complete request and response schemas. To use AI Baseline in a chat application, follow Connect with Claude, Connect with ChatGPT, or Connect with MCP.