Assistants defining retrieval query using function calling context retrieval function

Assistants defining retrieval query using function calling context retrieval function, dos and don’ts.
So I’m using assistants with gpt 4 to converse based on context retrieval.
I’m starting the guest question with up to 15 confluence pages from a chroma db search.
The intention is to enable function calling to a local context retrieval function this way the model would be able to formulate a query for context retrieval.
Why not use the built in context retrieval? Cause I’m working with a huge knowledge base 20+ confluence spaces.
Asking to see if someone already worked with such a system and has advice.