Getting AI Search citations in Responses API?

I’m moving from the completions API because it’s not giving enough control over the data source results from my Azure AI Search index. I want to use the responses API.

First, I perform query rewrites and retrieve the search results from the index, passing them to the responses instructions.

The result is good, but I want to get something similar to “citations” in the completions API. A list of each citation used in the answer, and a [doc1] or indicator to match the citation within the text.

I think this must be possible somehow because the FileSearch tool will return citations as “annotations” and provide an index for where in the response the citation should go. Do I need to turn my AI Search results into some form of tool? I don’t want to just add a system instruction and rely on the LLM to insert [doc1], [doc2] etc. at the right place and in the right format.

Has anyone had any experience with this?

1 Like