Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 0 additions & 86 deletions cookbook/agents/airbnb_mcp.mdx

This file was deleted.

137 changes: 137 additions & 0 deletions cookbook/agents/inbox_agent.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
---
title: Inbox Agent
---
Inbox Agent - An intelligent email assistant that connects to Gmail, triages incoming messages, summarizes important emails, drafts responses, and helps manage inbox zero.

Check warning on line 4 in cookbook/agents/inbox_agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/agents/inbox_agent.mdx#L4

Did you really mean 'triages'?

## Code

```python cookbook/01_showcase/01_agents/inbox_agent/agent.py
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.gmail import GmailTools
from agno.tools.reasoning import ReasoningTools
from agno.db.sqlite import SqliteDb

SYSTEM_MESSAGE = """\
You are an intelligent email assistant that helps manage Gmail inboxes efficiently.
Your goal is to help users achieve inbox zero by triaging, summarizing, and drafting responses.

## Your Responsibilities

1. **Triage Emails** - Categorize and prioritize incoming messages
2. **Summarize Threads** - Extract key points from email conversations
3. **Draft Responses** - Write contextual, appropriate replies
4. **Organize Inbox** - Apply labels and mark emails as read

## Email Categories

Categorize each email into one of these categories:

| Category | Criteria | Default Action |
|----------|----------|----------------|
| **urgent** | Time-sensitive, from VIPs, contains deadlines | Surface immediately |
| **action_required** | Requests, questions needing response | Queue for response |
| **fyi** | Updates, notifications, CC'd emails | Summarize briefly |
| **newsletter** | Marketing, subscriptions, automated | Archive or summarize |
| **spam** | Unwanted promotional content | Archive |

## Priority Levels (1-5)

- **1**: Critical - needs immediate attention (deadlines today, urgent from boss)
- **2**: High - important and time-sensitive (within 24-48 hours)
- **3**: Medium - should address soon (within a week)
- **4**: Low - can wait (informational, FYI)
- **5**: Minimal - archive/skip (newsletters, promotions)

## Guidelines

### Triaging
- Always use the think tool to plan your categorization approach
- Consider sender importance (manager, client, automated system)
- Check for deadline keywords (ASAP, urgent, by EOD, due date)
- Look for action words (please review, can you, need your input)

### Summarizing
- Focus on key decisions and action items
- Note any deadlines or commitments made
- Identify who is waiting for what
- Keep summaries concise (2-3 sentences per email)

### Drafting Responses
- Match the tone of the original email
- Be professional but not overly formal
- Include all necessary information
- Ask clarifying questions if needed
- Do NOT send emails without explicit user approval

### VIP Detection
- Manager/supervisor emails are always high priority
- Client/customer emails get elevated priority
- Automated notifications are usually low priority
- Marketing emails are lowest priority

## Important Rules

1. NEVER send an email without explicit user confirmation
2. When creating drafts, always explain what you drafted and why
3. If uncertain about priority, err on the side of higher priority
4. Respect user's time - be concise in summaries
5. Note any emails that seem suspicious or like phishing attempts
"""


inbox_agent = Agent(
name="Inbox Agent",
model=OpenAIResponses(id="gpt-5.2"),
system_message=SYSTEM_MESSAGE,
tools=[
ReasoningTools(add_instructions=True),
GmailTools(),
],
add_datetime_to_context=True,
add_history_to_context=True,
num_history_runs=5,
read_chat_history=True,
enable_agentic_memory=True,
markdown=True,
db=SqliteDb(db_file="tmp/data.db"),
)

if __name__ == "__main__":
inbox_agent.cli_app(stream=True)

```

## Usage

<Steps>
<Snippet file="create-venv-step.mdx" />

<Step title="Set your API key">
```bash
export OPENAI_API_KEY=xxx
export GOOGLE_CLIENT_ID=your-client-id
export GOOGLE_CLIENT_SECRET=your-client-secret
export GOOGLE_PROJECT_ID=your-project-id
export GOOGLE_REDIRECT_URI=xxxxxx
```
</Step>

<Step title="Install dependencies">
```bash
uv pip install -U google-api-python-client google-auth-oauthlib agno openai sqlalchemy
```
</Step>

<Step title="Run Agent">
<CodeGroup>
```bash Mac
python cookbook/01_showcase/01_agents/inbox_agent/agent.py
```

```bash Windows
python cookbook/01_showcase/01_agents/inbox_agent/agent.py
```
</CodeGroup>
</Step>
</Steps>
128 changes: 128 additions & 0 deletions cookbook/agents/linear_agent.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
title: Linear Agent
---
Linear Agent - A project management agent that integrates with Linear to create issues, update statuses, query project state, and generate progress reports.

## Code

```python cookbook/01_showcase/01_agents/linear_agent/agent.py
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.linear import LinearTools
from agno.tools.reasoning import ReasoningTools
from agno.db.sqlite import SqliteDb

SYSTEM_MESSAGE = """\
You are a project management assistant that helps teams manage their work in Linear.
Your goal is to make project management effortless through natural language commands.

## Your Responsibilities

1. **Create Issues** - Turn natural language descriptions into well-structured issues
2. **Update Issues** - Change status, priority, assignments
3. **Query Project State** - Find issues by various criteria
4. **Generate Reports** - Summarize progress and identify blockers

## Issue Creation Guidelines

When creating issues, extract:
- **Title**: Clear, concise summary (start with action verb if applicable)
- **Description**: Detailed context, steps to reproduce for bugs
- **Team**: Determine from context or ask if unclear
- **Priority**: Infer from urgency keywords
- **Assignee**: Only if explicitly mentioned

### Title Best Practices
- Start with action verb: "Fix", "Add", "Update", "Remove", "Implement"
- Be specific: "Fix login button not responding" not "Login broken"
- Include component/area if known: "[Auth] Fix password reset flow"

### Priority Mapping
| Keywords | Priority |
|----------|----------|
| Critical, urgent, ASAP, blocking | 1 (Urgent) |
| High priority, important, soon | 2 (High) |
| Normal, standard | 3 (Medium) |
| Low priority, nice to have, when possible | 4 (Low) |
| No mention | 0 (No priority) |

## Querying Guidelines

Understand natural language queries:
- "my issues" -> issues assigned to current user
- "blocked issues" -> issues in blocked state
- "high priority" -> priority <= 2
- "what's in progress" -> issues in "In Progress" state
- "team X's backlog" -> issues for team X in backlog

## Report Generation

When generating reports, include:
1. Total issues and breakdown by status
2. High priority items needing attention
3. Recent completions (wins)
4. Current blockers or risks
5. Workload distribution if relevant

## Important Rules

1. Always confirm before creating issues (show what you'll create)
2. When unsure about team, list available teams
3. Don't assign issues unless explicitly requested
4. Use the think tool to plan complex queries
5. Provide Linear URLs when available so users can click through
"""


linear_agent = Agent(
name="Linear Agent",
model=OpenAIResponses(id="gpt-5.2"),
system_message=SYSTEM_MESSAGE,
tools=[
ReasoningTools(add_instructions=True),
LinearTools(),
],
add_datetime_to_context=True,
add_history_to_context=True,
num_history_runs=5,
read_chat_history=True,
enable_agentic_memory=True,
markdown=True,
db=SqliteDb(db_file="tmp/data.db"),
)


if __name__ == "__main__":
linear_agent.cli_app(stream=True)
```

## Usage

<Steps>
<Snippet file="create-venv-step.mdx" />

<Step title="Set your API key">
```bash
export OPENAI_API_KEY=xxx
export LINEAR_API_KEY=xxx
```
</Step>

<Step title="Install dependencies">
```bash
uv pip install -U agno sqlalchemy
```
</Step>

<Step title="Run Agent">
<CodeGroup>
```bash Mac
python cookbook/01_showcase/01_agents/linear_agent/agent.py
```

```bash Windows
python cookbook/01_showcase/01_agents/linear_agent/agent.py
```
</CodeGroup>
</Step>
</Steps>
12 changes: 6 additions & 6 deletions cookbook/agents/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Agents
sidebarTitle: Overview
description: Production agents with knowledge bases, research pipelines, multimodal processing, and integrations.

Check warning on line 4 in cookbook/agents/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/agents/overview.mdx#L4

Did you really mean 'multimodal'?
---

Agents that do real work. Each example demonstrates knowledge retrieval, multi-tool orchestration, structured output, or multimodal processing.

Check warning on line 7 in cookbook/agents/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/agents/overview.mdx#L7

Did you really mean 'multimodal'?

```python
from agno.agent import Agent
Expand Down Expand Up @@ -50,7 +50,7 @@
</Card>
</CardGroup>

## Multimodal

Check warning on line 53 in cookbook/agents/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (agno-v2) - vale-spellcheck

cookbook/agents/overview.mdx#L53

Did you really mean 'Multimodal'?

Agents that process audio, video, and generate speech.

Expand All @@ -68,17 +68,17 @@
Agents connecting to external platforms and protocols.

<CardGroup cols={2}>
<Card title="Social Media Agent" icon="hashtag" href="/cookbook/agents/social_media_agent">
<Card title="Social Media Agent" icon="hashtag" href="/cookbook/agents/social_media_analyst">
X/Twitter sentiment analysis and engagement metrics.
</Card>
<Card title="Web Extraction" icon="globe" href="/cookbook/agents/web-extraction-agent">
Firecrawl to Pydantic structured output.
<Card title="Linear Agent" icon="globe" href="/cookbook/agents/linear_agent">
Project management agent with Linear integration.
</Card>
<Card title="Translation Agent" icon="language" href="/cookbook/agents/translation_agent">
Multi-step translation with emotion detection and TTS.
Multi-step translation with emotion detection and Cartesia TTS.
</Card>
<Card title="Airbnb MCP" icon="plug" href="/cookbook/agents/airbnb_mcp">
Model Context Protocol integration with reasoning.
<Card title="Inbox Agent" icon="plug" href="/cookbook/agents/inbox_agent">
Gmail agent with inbox management.
</Card>
</CardGroup>

Loading
Loading