Knowledge source search Limitation

Hello Team,
I’m facing an issue while using the knowledge source to answer queries. I have uploaded multiple documents in the Knowledge directory, but it seems like there’s a hardcoded limit in the knowledge.py file where the number of results returned is restricted to 3. Please refer to below function in knowledge.py file.
Code:

Due to this limitation, only 3 results are retrieved during the search, leading to a loss of knowledge and incomplete answers. If i increase the limit then i am able to get correct output from my agent.

Is there a way to modify this limit or override it dynamically? Any guidance on resolving this would be greatly appreciated.

Thanks!

1 Like