An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
Hi @Dipendu Singh , thank you for your question!
The most likely gap here is that Completed on the SharePoint sync only confirms the crawl/ingestion job finished, not that it fed into the same vector_store your agent is querying those can be two separate resources under the hood. A SharePoint-connected knowledge source in Foundry typically indexes into a managed Azure AI Search index as part of the sync, which is a different object from an OpenAI-style vector store populated via direct file uploads. If vector_store.id in your code isn't the exact store the SharePoint sync wrote into, file_search will run cleanly against a store with zero relevant (or zero total) chunks and return a non-grounded answer, with nothing surfacing as an error since the tool call itself succeeds.
To confirm this before changing anything else:
- Call
client.vector_stores.files.list(vector_store_id=vector_store.id)(or the equivalent inazure-ai-projects) and check the actual file count and per-filestatusa file that'scompletedat the sync/portal level can still showin_progressorfailedat the embedding level if you look at the vector store's own file status rather than the portal's sync label. - Separately check
vector_store.file_counts(as you mentioned), ifcompletedis 0 andtotalis 0, the SharePoint sync never actually wrote into this vector store, confirming a mismatch between the sync target and what your agent references. - If the counts do show indexed files with nonzero
completed, the issue is more likely retrieval-side (e.g.,file_searchchunking/ranking not surfacing the doc for your test query), which would point toward testing withazure_ai_searchas the tool type instead if the underlying knowledge source is Search-backed rather than vector-store-backed.
So the explicit "attach" step isn't missing from your code (you are correctly passing vector_store_ids at agent creation), the more likely fix is confirming that ID is actually the one the SharePoint sync populated, since Foundry's SharePoint connector and the Assistants-style file_search vector store aren't guaranteed to be the same object unless explicitly wired together.
Please upvote or accept answer if this is helpful!