-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat: knowledge filters- manual + agentic v1 #3005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? 8000 Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Dirk Brand <51947788+dirkbrnd@users.noreply.github.com>
Co-authored-by: Dirk Brand <51947788+dirkbrnd@users.noreply.github.com>
Co-authored-by: Dirk Brand <51947788+dirkbrnd@users.noreply.github.com>
Co-authored-by: Dirk Brand <51947788+dirkbrnd@users.noreply.github.com>
…com/agno-agi/agno into v0-knowledge-filters-new-dx-ag-3025
dirkbrnd
approved these changes
May 10, 2025
deepd1534
pushed a commit
to deepd1534/agno
that referenced
this pull request
May 11, 2025
## Summary Manual user passed filters: ```py knowledge_base = PDFUrlKnowledgeBase( urls=[ { "https://agno-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf": { "metadata": { "user_id": "user_2", "source": "Cape Cookbook", } } }, { "https://agno-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf": { "metadata": { "user_id": "user_2", "source": "Cape Cookbook", } } }, ], vector_db=vector_db, reader=PDFUrlReader(chunk=True), ) knowledge_base.load() agent = Agent( knowledge=knowledge_base, search_knowledge=True, knowledge_filters={"user_id": "jordan_mitchell"}, ) ``` Agentic filters: ```py agent = Agent( knowledge=knowledge_base, search_knowledge=True, enable_agentic_filters=True, ) agent.print_response( "Tell me about Jordan Mitchell's experience and skills with user id as jordan_mitchell and document type cv and year as 2025", markdown=True, ) ``` The agent automatically figures out which filters to use and applies-  (If applicable, issue number: #____) ## Type of change - [ ] Bug fix - [x] New feature - [x] Breaking change - [ ] Improvement - [ ] Model update - [ ] Other: --- ## Checklist - [x] Code complies with style guidelines - [x] Ran format/validation scripts (`./scripts/format.sh` and `./scripts/validate.sh`) - [x] Self-review completed - [ ] Documentation updated (comments, docstrings) - [x] Examples and guides: Relevant cookbook examples have been included or updated (if applicable) - [x] Tested in clean environment - [x] Tests added/updated (if applicable) --- ## Additional Notes Add any important context (deployment instructions, screenshots, security considerations, etc.) --------- Co-authored-by: Dirk Brand <dirkbrnd@gmail.com> Co-authored-by: Yash Pratap Solanky <101447028+ysolanky@users.noreply.github.com> Co-authored-by: Dirk Brand <51947788+dirkbrnd@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
Yo
2E29
u must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Manual user passed filters:
Agentic filters:
The agent automatically figures out which filters to use and applies-

(If applicable, issue number: #____)
Type of change
Checklist
./scripts/format.sh
and./scripts/validate.sh
)Additional Notes
Add any important context (deployment instructions, screenshots, security considerations, etc.)