Skip to content

Commit ebf03a6

Browse files
committed
chore: 2.2.5 update
1 parent 5d36fc8 commit ebf03a6

19 files changed

+1594
-147
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build Docker Images
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
build-api-image:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v3
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v3
23+
24+
- name: Docker Login
25+
uses: docker/login-action@v3
26+
with:
27+
username: ${{ secrets.DOCKERHUB_USERNAME }}
28+
password: ${{ secrets.DOCKERHUB_TOKEN }}
29+
30+
- name: Build and push
31+
uses: docker/build-push-action@v5
32+
with:
33+
context: .
34+
file: Dockerfile
35+
platforms: linux/amd64,linux/arm64
36+
push: true
37+
tags: ${{ vars.DOCKERHUB_NAMESPACE }}/agno-demo-app:dev, ${{ vars.DOCKERHUB_NAMESPACE }}/agno-demo-app:prd

.github/workflows/ecr-images.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build ECR Images
2+
3+
on: workflow_dispatch
4+
5+
permissions:
6+
# For AWS OIDC Token access as per https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services#updating-your-github-actions-workflow
7+
id-token: write # This is required for requesting the JWT
8+
contents: read # This is required for actions/checkout
9+
10+
env:
11+
ECR_REPO: YOUR ECR REPO
12+
# Create role using https://aws.amazon.com/blogs/security/use-iam-roles-to-connect-github-actions-to-actions-in-aws/
13+
AWS_ROLE: YOUR_ROLE_ARN
14+
AWS_REGION: us-east-1
15+
16+
jobs:
17+
build-api-image:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v3
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
# https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions
28+
- name: Configure AWS credentials
29+
uses: aws-actions/configure-aws-credentials@v4
30+
with:
31+
role-to-assume: ${{ env.AWS_ROLE }}
32+
aws-region: ${{ env.AWS_REGION }}
33+
# https://github.com/marketplace/actions/amazon-ecr-login-action-for-github-actions
34+
- name: ECR Login
35+
id: login-ecr
36+
uses: aws-actions/amazon-ecr-login@v2
37+
- name: Build, tag, and push docker image to Amazon ECR
38+
uses: docker/build-push-action@v5
39+
with:
40+
context: .
41+
file: Dockerfile
42+
platforms: linux/amd64,linux/arm64
43+
push: true
44+
tags: ${{ env.ECR_REPO }}/agno-demo-app:dev, ${{ env.ECR_REPO }}/agno-demo-app:prd

.github/workflows/validate.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Validate
2+
3+
on:
4+
push:
5+
pull_request:
6+
types:
7+
- opened
8+
- edited
9+
- reopened
10+
branches:
11+
- "main"
12+
13+
env:
14+
UV_SYSTEM_PYTHON: 1
15+
16+
jobs:
17+
validate:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
python-version: ["3.11"]
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v3
28+
with:
29+
enable-cache: true
30+
cache-dependency-glob: "requirements**.txt"
31+
32+
- name: Set up Python ${{ matrix.python-version }}
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
37+
- name: Install the project
38+
run: uv pip sync requirements.txt
39+
40+
- name: Format with ruff
41+
run: uv run ruff format .
42+
43+
- name: Lint with ruff
44+
run: uv run ruff check .
45+
46+
- name: Type-check with mypy
47+
run: uv run mypy .
48+
49+
# - name: Run tests
50+
# run: uv run pytest tests

agents/agno_assist.py

Lines changed: 95 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -8,109 +8,99 @@
88
from agno.tools.duckduckgo import DuckDuckGoTools
99
from agno.vectordb.pgvector import PgVector, SearchType
1010

11-
from db.session import db_url
12-
13-
14-
def get_agno_assist(
15-
model_id: str = "gpt-5",
16-
debug_mode: bool = False,
17-
) -> Agent:
18-
return Agent(
19-
id="agno-assist",
20-
name="Agno Assist",
21-
model=OpenAIChat(id=model_id),
22-
# Tools available to the agent
23-
tools=[DuckDuckGoTools()],
24-
# Description of the agent
25-
description=dedent("""\
26-
You are AgnoAssist, an advanced AI Agent specializing in Agno: a lightweight framework for building multi-modal, reasoning Agents.
27-
28-
Your goal is to help developers understand and use Agno by providing clear explanations, functional code examples, and best-practice guidance for using Agno.
29-
"""),
30-
# Instructions for the agent
31-
instructions=dedent("""\
32-
Your mission is to provide comprehensive and actionable support for developers working with the Agno framework. Follow these steps to deliver high-quality assistance:
33-
34-
1. **Understand the request**
35-
- Analyze the request to determine if it requires a knowledge search, creating an Agent, or both.
36-
- If you need to search the knowledge base, identify 1-3 key search terms related to Agno concepts.
37-
- If you need to create an Agent, search the knowledge base for relevant concepts and use the example code as a guide.
38-
- When the user asks for an Agent, they mean an Agno Agent.
39-
- All concepts are related to Agno, so you can search the knowledge base for relevant information
40-
41-
After Analysis, always start the iterative search process. No need to wait for approval from the user.
42-
43-
2. **Iterative Knowledge Base Search:**
44-
- Use the `search_knowledge_base` tool to iteratively gather information.
45-
- Focus on retrieving Agno concepts, illustrative code examples, and specific implementation details relevant to the user's request.
46-
- Continue searching until you have sufficient information to comprehensively address the query or have explored all relevant search terms.
47-
48-
After the iterative search process, determine if you need to create an Agent.
49-
50-
3. **Code Creation**
51-
- Create complete, working code examples that users can run. For example:
52-
```python
53-
from agno.agent import Agent
54-
from agno.tools.duckduckgo import DuckDuckGoTools
55-
56-
agent = Agent(tools=[DuckDuckGoTools()])
57-
58-
# Perform a web search and capture the response
59-
response = agent.run("What's happening in France?")
60-
```
61-
- Remember to:
62-
* Build the complete agent implementation
63-
* Includes all necessary imports and setup
64-
* Add comprehensive comments explaining the implementation
65-
* Ensure all dependencies are listed
66-
* Include error handling and best practices
67-
* Add type hints and documentation
68-
69-
Key topics to cover:
70-
- Agent architecture, levels, and capabilities.
71-
- Knowledge base integration and memory management strategies.
72-
- Tool creation, integration, and usage.
73-
- Supported models and their configuration.
74-
- Common development patterns and best practices within Agno.
75-
76-
Additional Information:
77-
- You are interacting with the user_id: {current_user_id}
78-
- The user's name might be different from the user_id, you may ask for it if needed and add it to your memory if they share it with you.\
79-
"""),
80-
# -*- Knowledge -*-
81-
# Add the knowledge base to the agent
82-
knowledge=Knowledge(
83-
contents_db=PostgresDb(id="agno-storage", db_url=db_url),
84-
vector_db=PgVector(
85-
db_url=db_url,
86-
table_name="agno_assist_knowledge",
87-
search_type=SearchType.hybrid,
88-
embedder=OpenAIEmbedder(id="text-embedding-3-small"),
89-
),
11+
from app.models import OPENAI_MODEL_ID
12+
from db.session import get_session_db, db_url
13+
14+
agno_assist = Agent(
15+
id="agno-assist",
16+
name="Agno Assist",
17+
model=OpenAIChat(id=OPENAI_MODEL_ID),
18+
# Tools available to the agent
19+
tools=[DuckDuckGoTools()],
20+
# Description of the agent
21+
description=dedent("""\
22+
You are AgnoAssist, an advanced AI Agent specializing in Agno: a lightweight framework for building multi-modal, reasoning Agents.
23+
24+
Your goal is to help developers understand and use Agno by providing clear explanations, functional code examples, and best-practice guidance for using Agno.
25+
"""),
26+
# Instructions for the agent
27+
instructions=dedent("""\
28+
Your mission is to provide comprehensive and actionable support for developers working with the Agno framework. Follow these steps to deliver high-quality assistance:
29+
30+
1. **Understand the request**
31+
- Analyze the request to determine if it requires a knowledge search, creating an Agent, or both.
32+
- If you need to search the knowledge base, identify 1-3 key search terms related to Agno concepts.
33+
- If you need to create an Agent, search the knowledge base for relevant concepts and use the example code as a guide.
34+
- When the user asks for an Agent, they mean an Agno Agent.
35+
- All concepts are related to Agno, so you can search the knowledge base for relevant information
36+
37+
After Analysis, always start the iterative search process. No need to wait for approval from the user.
38+
39+
2. **Iterative Knowledge Base Search:**
40+
- Use the `search_knowledge_base` tool to iteratively gather information.
41+
- Focus on retrieving Agno concepts, illustrative code examples, and specific implementation details relevant to the user's request.
42+
- Continue searching until you have sufficient information to comprehensively address the query or have explored all relevant search terms.
43+
44+
After the iterative search process, determine if you need to create an Agent.
45+
46+
3. **Code Creation**
47+
- Create complete, working code examples that users can run. For example:
48+
```python
49+
from agno.agent import Agent
50+
from agno.tools.duckduckgo import DuckDuckGoTools
51+
52+
agent = Agent(tools=[DuckDuckGoTools()])
53+
54+
# Perform a web search and capture the response
55+
response = agent.run("What's happening in France?")
56+
```
57+
- Remember to:
58+
* Build the complete agent implementation
59+
* Includes all necessary imports and setup
60+
* Add comprehensive comments explaining the implementation
61+
* Ensure all dependencies are listed
62+
* Include error handling and best practices
63+
* Add type hints and documentation
64+
65+
Key topics to cover:
66+
- Agent architecture, levels, and capabilities.
67+
- Knowledge base integration and memory management strategies.
68+
- Tool creation, integration, and usage.
69+
- Supported models and their configuration.
70+
- Common development patterns and best practices within Agno.
71+
72+
Additional Information:
73+
- You are interacting with the user_id: {current_user_id}
74+
- The user's name might be different from the user_id, you may ask for it if needed and add it to your memory if they share it with you.\
75+
"""),
76+
# -*- Knowledge -*-
77+
# Add the knowledge base to the agent
78+
knowledge=Knowledge(
79+
contents_db=get_session_db(),
80+
vector_db=PgVector(
81+
db_url=db_url,
82+
table_name="agno_assist_knowledge",
83+
search_type=SearchType.hybrid,
84+
embedder=OpenAIEmbedder(id=OPENAI_MODEL_ID),
9085
),
91-
# Give the agent a tool to search the knowledge base (this is True by default but set here for clarity)
92-
search_knowledge=True,
93-
# -*- Storage -*-
94-
# Storage chat history and session state in a Postgres table
95-
db=PostgresDb(id="agno-storage", db_url=db_url),
96-
# -*- History -*-
97-
# Send the last 3 messages from the chat history
98-
add_history_to_context=True,
99-
num_history_runs=3,
100-
# Add a tool to read the chat history if needed
101-
read_chat_history=True,
102-
# -*- Memory -*-
103-
# Enable agentic memory where the Agent can personalize responses to the user
104-
enable_agentic_memory=True,
105-
# -*- Other settings -*-
106-
# Format responses using markdown
107-
markdown=True,
108-
# Add the current date and time to the instructions
109-
add_datetime_to_context=True,
110-
# Show debug logs
111-
debug_mode=debug_mode,
112-
)
113-
114-
115-
# Create the agno assist agent instance for direct import
116-
agno_assist = get_agno_assist()
86+
),
87+
# Give the agent a tool to search the knowledge base (this is True by default but set here for clarity)
88+
search_knowledge=True,
89+
# -*- Storage -*-
90+
# Storage chat history and session state in a Postgres table
91+
db=get_session_db(),
92+
# -*- History -*-
93+
# Send the last 3 messages from the chat history
94+
add_history_to_context=True,
95+
num_history_runs=3,
96+
# Add a tool to read the chat history if needed
97+
read_chat_history=True,
98+
# -*- Memory -*-
99+
# Enable agentic memory where the Agent can personalize responses to the user
100+
enable_agentic_memory=True,
101+
# -*- Other settings -*-
102+
# Format responses using markdown
103+
markdown=True,
104+
# Add the current date and time to the instructions
105+
add_datetime_to_context=True,
106+
)

0 commit comments

Comments
 (0)