agno: Cursor rule for Cursor

.cursorrules

cursorrules is a cursor rule for Cursor from agno-agi/agno. It costs 1,090 tokens per session, scanned A, original, Apache-2.0.

Project rules for building Python applications with the Agno framework, including applications where software agents perform tasks using models and tools.

In plain words
What is it for?
It helps guide Agno agent code, including agent reuse, structured outputs, database selection, and documentation or example-writing conventions.
Why use it?
It keeps implementation choices consistent, such as how agents are created, how responses are structured, and which databases are used in development and production.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

This is agno-agi/agno's own configuration. It tells Cursor how to work on agno itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agno configures →

About the project

Agno is a framework and runtime for building, running, and managing platforms made of AI agents. Developers use its SDK, service runtime, and web interface to create agent applications with storage, integrations, APIs, and operational controls; the catalogue entries provide agent-oriented workflows and configuration for using Agno.

agno-agi/agno · 43,076 stars · on GitHub · docs.agno.com

Reuse

Borrowing it

Nothing to install: this file belongs to agno-agi/agno. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/agno-agi/agno/main/.cursorrules
Clone the repo
git clone --depth 1 https://github.com/agno-agi/agno

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cursorrules

README.md
[![agentmods](https://agentmods.dev/badge/rules/agno-agi/agno/cursorrules/github.svg)](https://agentmods.dev/rules/agno-agi/agno/cursorrules)
Your own site
<a href="https://agentmods.dev/rules/agno-agi/agno/cursorrules"><img src="https://agentmods.dev/badge/rules/agno-agi/agno/cursorrules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cursorrules

Your own site · 80×15
<a href="https://agentmods.dev/rules/agno-agi/agno/cursorrules"><img src="https://agentmods.dev/badge/rules/agno-agi/agno/cursorrules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,090 This file is loaded in full into every session.
When invoked 1,090 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01090 $0.01090
Opus 5.5 $0.00436 $0.00436
Sonnet 5.5 $0.00218 $0.00218
Haiku 4.5 $0.00109 $0.00109

Measured 2mo ago against content hash d400f5971f06, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cursorrules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursorrules · 187 lines

How it starts

The opening of the file, as written. The whole thing — 187 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert in Python, Agno framework, and AI agent development.

Core Rules

  • NEVER create agents in loops - reuse them for performance
  • Always use output_schema for structured responses
  • PostgreSQL in production, SQLite for dev only
  • Start with single agent, scale up only when needed

Documentation:

  • Don't use f-strings for print lines where there are no variables to format.
  • Don't use emojis in examples and print lines

Basic Agent (start here):

from agno.agent import Agent
from agno.models.openai import OpenAIResponses

agent = Agent(
    model=OpenAIResponses(id="gpt-5.5"),
    instructions="You are a helpful assistant",
    markdown=True,
)
agent.print_response("Your query", stream=True)

Agent with Tools:

from agno.tools.websearch import WebSearchTools

agent = Agent(
    model=OpenAIResponses(id="gpt-5.5"),
    tools=[WebSearchTools()],
    instructions="Search the web for information",
)

CRITICAL: Agent Reuse Performance

# WRONG - Recreates agent every time (significant overhead)
for query in queries:
    agent = Agent(...)  # DON'T DO THIS
    
# CORRECT - Create once, reuse
agent = Agent(...)
for query in queries:
    agent.run(query)

When to Use Each Pattern

Single Agent (90% of use cases):

  • One clear task or domain
  • Can be solved with tools + instructions
  • Example: Search, analyze, generate content

Team (autonomous coordination):

  • Multiple specialized agents with different expertise
  • Agents decide who does what via LLM
  • Complex tasks requiring multiple perspectives
  • Example: Research + Analysis + Writing

Workflow (programmatic control):

  • Sequential steps with clear flow
  • Need conditional logic or branching
  • Full control over execution order
  • Example: Extract → Transform → Load pipelines

Team Pattern:

from agno.team.team import Team

web_agent = Agent(
    name="Researcher",
    model=OpenAIResponses(id="gpt-5.5"),
    tools=[WebSearchTools()],
)

writer_agent = Agent(
    name="Writer",
    model=OpenAIResponses(id="gpt-5.5"),
)

team = Team(
    members=[web_agent, writer_agent],
    model=OpenAIResponses(id="gpt-5.5"),
    instructions="Research and write articles",
)

Workflow Pattern:

from agno.workflow.workflow import Workflow
from agno.db.sqlite import SqliteDb

# Define agents first (researcher, writer)
async def blog_workflow(session_state, topic: str):
    # Step 1: Research
    research = await researcher.arun(topic)
    
    # Step 2: Write
    article = await writer.arun(research.content)
    
    return article

workflow = Workflow(
    name="Blog Generator",
    steps=blog_workflow,
    db=SqliteDb(db_file="tmp/workflow.db"),
)

Knowledge/RAG:

from agno.knowledge.knowledge import Knowledge
from agno.vectordb.lancedb import LanceDb, SearchType
from agno.knowledge.embedder.openai import OpenAIEmbedder

knowledge = Knowledge(
    vector_db=LanceDb(
        uri="tmp/lancedb",
        table_name="knowledge_base",
        search_type=SearchType.hybrid,
        embedder=OpenAIEmbedder(id="text-embedding-3-small"),
    ),
)

agent = Agent(
    model=OpenAIResponses(id="gpt-5.5"),
    knowledge=knowledge,
    search_knowledge=True,  # Critical: enables agentic RAG
    instructions="Use knowledge base, cite sources"
)

Chat History:

agent = Agent(
    model=OpenAIResponses(id="gpt-5.5"),
    db=SqliteDb(db_file="tmp/agents.db"),
    user_id="user-123",
    add_history_to_context=True,  # Adds previous messages
    num_history_runs=3,
)

Structured Output:

from pydantic import BaseModel

class Result(BaseModel):
    summary: str
    findings: list[str]

agent = Agent(
    model=OpenAIResponses(id="gpt-5.5"),
    output_schema=Result,
)
result: Result = agent.run(query).content

AgentOS Production:

from agno.os import AgentOS
from agno.db.postgres import PostgresDb

agent_os = AgentOS(
    agents=[agent],
    db=PostgresDb(db_url=os.getenv("DATABASE_URL")),
)
app = agent_os.get_app()

Read the full file on GitHub · 187 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 187 lines · 1,090 tokens per session scan A d400f5971f06

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository agno-agi/agno (43,076 stars, last pushed yesterday), licensed Apache-2.0. It adds 1,090 tokens to every session, about $0.0044 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

cursorrules compared with cursor rules from other repositories

cursorrules next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cursorrulesagno-agi/agnoCursor rule43kyesterdayApache-2.0A1,090Cursor
fenictypedef-ai/fenicCursor rule679yesterdayApache-2.0A615Cursor
mcp-guidelinesatlanhq/agent-toolkitCursor rule422d agoMITA0Cursor
pythonatlanhq/agent-toolkitCursor rule422d agoMITA213Cursor
hatch3r-python-patternshatch3r/hatch3rCursor rule261mo agoMITA0Cursor
pythonAcKeskin/contextureCursor rule22d agoMITA1,117Cursor
python_clean_codeknowledgestack/ks-cookbookCursor rule93mo agoMITA9Cursor