query_config
parameter. This allows you to get source-verified responses with inline citations and tune your Knowledge Graph queries for specific use cases.
references
object that contains a direct snippet from the source file that was used to support the response:query_config
parameter allows you to add inline citations to Knowledge Graph responses and fine-tune how Knowledge Graphs search, rank, and retrieve content. Inline citations show which specific sources support each part of the response, enabling you to verify information and trace claims back to their origins.
You can use this parameter with:
/v1/graphs/question
endpointinline_citations: true
parameter adds source references directly in the response text, while other parameters control search behavior:
inline_citations: true
- Enables inline citations showing which sources support each part of the responsegrounding_level: 0.2
- Keeps responses closely tied to source material (20% creative interpretation allowed)search_weight: 60
- Balances keyword and semantic search (60% keyword search, 40% semantic search)keyword_threshold: 0.6
- Requires 60% keyword match for content to be includedsemantic_threshold: 0.8
- Requires 80% semantic similarity for content to be includedName | Type | Range | Default | Description |
---|---|---|---|---|
inline_citations | Boolean | True/False | False | Whether to include inline citations within the response text. See Inline citations for details. |
max_subquestions | Integer | 1-10 | 6 | Maximum number of sub-questions to generate when processing complex queries. Set higher to improve detail, set lower to reduce response time. See Max sub-questions for details. |
search_weight | Integer | 0-100 | 50 | Controls the balance between keyword and semantic search in ranking results. See Search weight for details. |
grounding_level | Number | 0.0-1.0 | 0.0 | Controls how closely responses must match to source material. Set lower for grounded outputs, higher for creativity. See Grounding level for details. |
max_snippets | Integer | 5-25 (recommended) | 30 | Maximum number of text snippets to retrieve from the Knowledge Graph for context. Works in concert with search_weight to control best matches vs broader coverage. Note: While technically supports 1-60, values below 5 may return no results due to RAG implementation. Recommended range is 5-25. See Max snippets for details. |
max_tokens | Integer | 100-8000 | 4000 | Maximum number of tokens the model can generate in the response. See Max tokens for details. |
keyword_threshold | Number | 0.0-1.0 | 0.7 | Threshold for keyword-based matching when searching Knowledge Graph content. Set higher for stricter relevance, lower for broader range. See Keyword threshold for details. |
semantic_threshold | Number | 0.0-1.0 | 0.7 | Threshold for semantic similarity matching when searching Knowledge Graph content. Set higher for stricter relevance, lower for broader range. See Semantic threshold for details. |
inline_citations
, inline citations in the response text correspond to entries in the references
array. Each citation contains a file name and a cite ID that you can use to locate the specific source.
references
array. Each citation uses the cite
field from the references array as its identifier. If you turn off inline citations, the cite
field is null.
Citation format: citations appear as [filename.pdf](cite)
where the cite value matches the cite
field from the references array.
Example correlation:
Here’s an example showing how inline citations correlate with the references array:
Response text:
[Acme-Product-Catalog.pdf](a1b2c3d4-e5f6-7890-abcd-ef1234567890)
uses the cite
field from the first reference object[Acme-Product-Catalog.pdf](b2c3d4e5-f6g7-8901-bcde-f23456789012)
uses the cite
field from the second reference object0.0
: “According to the documentation, the API supports JSON responses” (direct quote/paraphrase)0.5
: “The API documentation indicates that JSON responses are supported, which suggests additional capabilities” (interpretive)1.0
: “Based on the available information, users can expect JSON responses, though other formats might be possible” (highly interpretive)search_weight
to control best matches vs broader coverage.
How it works:
0.9
: Very strict - only content with high semantic similarity (for example, searching “user authentication” only finds content about “user authentication”, “login”, “sign-in”)0.7
: Moderate - includes conceptually related content (for example, searching “user authentication” finds “authentication”, “security”, “access control”, “user management”)0.3
: Lenient - includes tangentially related content (for example, searching “user authentication” finds “authentication”, “security”, “user management”, “database”, “API”, “web development”)max_snippets
and search_weight
: Work together to control best matches vs broader coverage. max_snippets
controls how many snippets are fed to the LLM in RAG.max_snippets
and max_tokens
: max_snippets
controls input context size, while max_tokens
controls output response length.keyword_threshold
and semantic_threshold
: Both filters are applied - content must pass both thresholds to be included.semantic_threshold = 0.8
and search_weight = 30
, you get a small set of very relevant documents ranked more by semantic similarity than keyword matching.
max_tokens
: Increases processing time and costmax_subquestions
: Increases processing time for complex queriesinline_citations: true
: Minimal performance impact, slight increase in response sizereferences
array with different structures depending on the source type. The array contains file
objects for file-based sources and web
objects for web-based sources.
references.file
objects)Field | Type | Description |
---|---|---|
text | string | The actual text snippet from the source document that supports the response |
fileId | string | Unique identifier for the source file |
score | number | Internal score used during the retrieval process for ranking and selecting relevant snippets |
page | integer | Page number where the snippet was found in the source document |
cite | string | Unique identifier used in inline citations within the response text |
references.web
objects)Field | Type | Description |
---|---|---|
text | string | The actual text snippet from the web page that supports the response |
url | string | URL of the source web page |
title | string | Title of the web page |
score | number | Internal score used during the retrieval process for ranking and selecting relevant snippets |
cite | string | Unique identifier used in inline citations within the response text |