AI & LLM
RAG Document Chunk JSON Example
A JSON example of a retrieval-augmented generation (RAG) document chunk — includes text, embedding reference, source metadata, and a relevance score. Copy-ready for building RAG pipelines.
Field Reference
idrequiredstringStable chunk id, often documentId plus a chunk suffixtextrequiredstringThe chunk's raw text — what gets injected into the LLM context windowscoreoptionalnumberRelevance/similarity score from the retriever (0–1 for cosine). Higher is closermetadata.sourcerequiredstringWhere the chunk came from — used for citations and filteringmetadata.chunkIndexrequiredintegerOrder of this chunk within the source documentmetadata.tokenCountoptionalintegerTokens in the chunk — used to budget the context windowVariants
Retriever responseA ranked list of chunks returned for a query, ready to assemble into context.
Common Use Cases
- →Chunking documents and storing them for retrieval in a RAG pipeline
- →Returning cited sources alongside an LLM answer
- →Filtering retrieval by metadata such as source, date, or access level
ragretrievalchunkvector searchcontextllm
Validate or format this JSON
One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.
Frequently Asked Questions
Related JSON Examples
AI & LLMEmbedding Vector ResponseEmbeddings API response with the vector array, model, and usage.AI & LLMChat Conversation HistoryOrdered messages array with system, user, and assistant roles for LLM chats.AI & LLMOpenAI Chat Completion ResponseOpenAI Chat Completions API response with choices, message, finish_reason, and usage.