DeepFellow DOCS
DeepFellow API ReferenceVector store files

Retrieve a chunk's original fragment with optional neighborhood.

GET
/v1/vector_stores/{vector_store_id}/files/{file_id}/chunks/{chunk_index}/fragment

Retrieve a chunk's original fragment, with optional neighboring context or the whole file.

When the file was ingested through the doc-chunker, the fragment and its neighborhood are resolved from the stored document.json. Otherwise (vector created without the doc-chunker), it falls back to the chunk text already stored on the vector, reconstructed via the vector database.

Needs user bearer token in authorization header.

Authorization

headerAuthorizationBearer <token>

Path Parameters

file_id*string

The ID of the file to retrieve

Match^[0-9a-fA-F]{24}$
vector_store_id*string

The ID of the vector store to use.

Match^[0-9a-fA-F]{24}$
chunk_index*integer

Index of the chunk to retrieve, as assigned during ingestion.

Range0 <= value

Query Parameters

context?integer

Number of neighboring fragments/chunks to include on each side.

Range0 <= value <= 50
Default0
whole_file?boolean

If true, also return the whole reconstructed file content.

Defaultfalse

Header Parameters

OpenAI-Organization?|

Organization Id from OpenAi compatible endpoint. Required to organization access or project access (with OpenAI-Project header) when logged as User or Admin User.

OpenAI-Project?|

Project Id from OpenAi compatible endpoint. Required to project access for organization api key or User / Admin User access with OpenAI-Organization

Response Body

Successful Response

application/json
  1. response
file_id*string

A 24-character hexadecimal MongoDB ObjectId string.

Match^[0-9a-fA-F]{24}$
filename*string
chunk_index*integer

Index of the resolved chunk, as assigned during ingestion.

fragment*string

The chunk's original fragment text.

fragment_source*string

Whether the fragment came from the doc-chunker's document.json or from the chunk's own stored text.

Value in"document_json""chunk_text"
neighbors_before?array<string>

Text of the neighboring fragments/chunks immediately before the target, if requested.

Default[]
neighbors_after?array<string>

Text of the neighboring fragments/chunks immediately after the target, if requested.

Default[]
full_file?|

The whole reconstructed file content, if requested.

Example Request
curl -X GET 'https://deepfellow-server-host/v1/vector_stores/5eb7cf5a86d9755df3a6c593/files/5eb7cf5a86d9755df3a6c593/chunks/0/fragment'
Example Response
{  "file_id": "5eb7cf5a86d9755df3a6c593",  "filename": "string",  "chunk_index": 0,  "fragment": "string",  "fragment_source": "document_json",  "neighbors_before": [],  "neighbors_after": [],  "full_file": "string"}

We use cookies on our website. We use them to ensure proper functioning of the site and, if you agree, for purposes such as analytics, marketing, and targeting ads.