Hey everyone,
I’m using the OpenAI Assistants API with a knowledge base, and I’ve run into a strange and super frustrating issue with how citations are handled in my React Native app vs. the OpenAI Playground.
- In the Playground: Everything works correctly. If the assistant finds relevant information in my knowledge base, it cites a specific document. If it doesn’t find a match, it correctly states that it found nothing in the KB.
- In my React Native app: The assistant always claims it found something in my knowledge base, even when it shouldn’t have. Even worse, instead of citing the correct document (when it actually does find a match), it always labels the source as the name of my vector store (e.g.,
"MyApp Tracker Bot Dataset"
) instead of citing an actual file.
Expected Behavior:
Example response when no knowledge base document is relevant:
"citations": [
{
"id": "⚠️",
"source": "General knowledge on medieval architecture"
}
]
Example response when a match is found:
"citations": [
{
"id": "42",
"source": "Gothic Structures Reference Guide.pdf"
}
]
Actual Behavior in React Native App:
Regardless of whether there is a match, the assistant always returns a citation, and the source name is replaced with the vector store name instead of an actual file:
"citations": [
{
"id": "999",
"source": "MyApp Tracker Bot Dataset"
}
]
Even if I ask a question completely unrelated to the KB, it still claims it found something and uses this incorrect dataset name.
Questions:
- Is there something different in how the Assistants API handles citations outside of the Playground?
- Has anyone else experienced this issue where the vector store name gets used as a citation instead of an actual file - and most importantly, figured out a fix?