File Search Annotations reference a file rather than a chunk

We are in the process of migrating our application from using AssistantsAPI to ResponsesAPI. When using the file_seach tool with ResponsesAPI, the relevant output looks like the following:

{
“type”: “response.output_item.done”,
“sequence_number”: 8,
“output_index”: 1,
“item”: {
“id”: “fs_id”,
“type”: “file_search_call”,
“status”: “completed”,
“queries”: [
“query1”,
“query2”,
],
“results”: [
{
“attributes”: {},
“file_id”: “file_id”,
“filename”: “filename.pdf”,
“score”: 0.6731,
“text”: “chunk text”,
“vector_store_id”: “vs_id”
},

{
“type”: “response.output_text.annotation.added”,
“sequence_number”: 656,
“item_id”: “item_id”,
“output_index”: 3,
“content_index”: 0,
“annotation_index”: 18,
“annotation”: {
“type”: “file_citation”,
“file_id”: “file_id”,
“filename”: “filename.pdf”,
“index”: 3320
}
}

“type”: “response.content_part.done”,
“sequence_number”: 711,
“item_id”: “item_id”,
“output_index”: 3,
“content_index”: 0,
“part”: {
“type”: “output_text”,
“annotations”: [
{
“type”: “file_citation”,
“file_id”: “file_id”,
“filename”: “filename.pdf”,
“index”: 438
},]

This does not allow tying back an annotation to a specific chunk, only to a specific file. We’d like to expose to our users the specific chunk that was used to answer the question, not just the file. In AssistantsAPI this is a functionality we had, and we’d like to keep it the same. Is there a configuration setting or something else we’re missing or is this simply not possible with ResponsesAPI?

2 Likes

Would love to know more about this too! Trying to implement the same thing on a personal project.

I’m experiencing the exact same issue on my client implementation. With the ResponsesAPI, file citations only map back to the file level, not the specific chunk returned by the file_search tool. In the AssistantsAPI, we were able to link citations directly to the chunk used in the answer, which is essential for our UX.

Is there currently any way to retrieve or correlate the chunk associated with a given annotation? Or is this functionality no longer supported in the new API?

I’ve also noticed that after moving to the Responses API, there’s no longer any way to determine which specific chunk was referenced when a citation is produced. There seems to be no way to tell which chunk from the file_search results was actually used.

This used to work cleanly in the Assistants API, so I’m trying to figure out whether this is an intentional change or something that just hasn’t been implemented yet. If anyone has clarity on whether chunk-level traceability is expected to return, it would help me decide how to move forward.

@OpenAI_Support Any chance we could get an update on this?