Skip to main content
Linear Agent - A project management agent that integrates with Linear to create issues, update statuses, query project state, and generate progress reports.

Code

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

1

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate
2

Set your API key

export OPENAI_API_KEY=xxx
export LINEAR_API_KEY=xxx
3

Install dependencies

uv pip install -U agno sqlalchemy
4

Run Agent

python cookbook/01_showcase/01_agents/linear_agent/agent.py