8000 feat: knowledge filters- manual + agentic v1 by kausmeows · Pull Request #3005 · agno-agi/agno · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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 132 commits into from
May 10, 2025

Conversation

kausmeows
Copy link
Contributor
@kausmeows kausmeows commented Apr 28, 2025

Summary

Manual user passed filters:

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:

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-
image

(If applicable, issue number: #____)

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Improvement
  • Model update
  • Other:

Checklist

  • Code complies with style guidelines
  • Ran format/validation scripts (./scripts/format.sh and ./scripts/validate.sh)
  • Self-review completed
  • Documentation updated (comments, docstrings)
  • Examples and guides: Relevant cookbook examples have been included or updated (if applicable)
  • Tested in clean environment
  • Tests added/updated (if applicable)

Additional Notes

Add any important context (deployment instructions, screenshots, security considerations, etc.)

@kausmeows kausmeows changed the title knowledge filters: manual + agentic v1 feat: knowledge filters- manual + agentic v1 May 10, 2025
dirkbrnd and others added 6 commits May 10, 2025 20:53
< 8000 input type="hidden" name="disable_live_updates" value="false" autocomplete="off" data-targets="batch-deferred-content.inputs" />
@dirkbrnd dirkbrnd merged commit 65b5119 into main May 10, 2025
2 checks passed
@dirkbrnd dirkbrnd deleted the v0-knowledge-filters-new-dx-ag-3025 branch May 10, 2025 20:05
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-

![image](https://github.com/user-attachments/assets/48b98a67-a996-4af1-8797-08b9fb837808)


(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>
@kausmeows kausmeows mentioned this pull request May 13, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0