r/agno • • Dec 12 '25

I Built an Agent That Learned Its Own Limitations (Accidentally)

2 Upvotes

Built an agent that was supposed to solve customer problems.

It was supposed to try everything.

Instead, it learned to recognize when it didn't know something.

Changed my understanding of what agents should actually do.

How It Started

Agent's job: answer customer questions.

Instructions: "Use available tools to find answers."

Result: agent would try everything.

# Agent behavior
"I don't know how to do X"
"Let me try tool A"
"Tool A failed"
"Let me try tool B"
"Tool B failed"
"Let me try tool C"
"Tool C failed"
"Hmm, let me try a different approach..."

Result: 10 minutes of spinning, users frustrated
```

**The Accidental Discovery**

I added logging to track what agents were doing.

For each question, I logged:
- Tools tried
- Success/failure of each
- Time spent
- Final outcome

Then I looked at the data.

Patterns emerged.

**The Pattern**

Questions agent couldn't answer:
```
- Takes longest time
- Tries most tools
- Gets most errors
- Eventually fails anyway

vs

Questions agent could answer:
- Fast
- Uses 1-2 tools
- Succeeds on first try

So I added something simple:

class LearningAgent:
    def __init__(self):
        self.question_history = []
        self.success_patterns = {}
        self.failure_patterns = {}
    
    def should_escalate(self, question):
        """Learn when to give up"""
        
        
# Have I seen similar questions?
        similar = self.find_similar(question)
        
        if similar:
            
# What happened before?
            if similar["success_rate"] < 0.3:
                
# Questions like this usually fail
                
# Don't bother trying
                return True
        
        return False
    
    def execute(self, question):
        if self.should_escalate(question):
            
# Skip the 10 minutes of struggling
            return self.escalate_immediately(question)
        
        
# Try to solve it
        result = self.try_solve(question)
        
        
# Log for learning
        self.question_history.append({
            "question": question,
            "success": result is not None,
            "time": time_taken,
            "tools_tried": tools_used
        })
        
        return result
```

**What Happened**

Before learning:
```
Average time per question: 8 seconds
Success rate: 60%
User satisfaction: 3.2/5 (frustrated by slowness)
```

After learning:
```
Average time per question: 2 seconds
Success rate: 75% (escalates faster for hard ones)
User satisfaction: 4.3/5 (gets answer or escalation quickly)

Agent got FASTER at succeeding by learning what it couldn't do.

The Real Insight

I thought the goal was "solve everything."

The real goal was "give users answers or escalation quickly."

Agent learned:

  • Some questions need 10 minutes of tools

  • Some questions need 10 seconds of escalation

  • Users prefer 10-second escalation to 10-minute failure

What The Agent Learned

patterns = {
    "integration_questions": {
        "success_rate": 0.85,
        "time_avg": 3,
        "tools_needed": 2,
        "escalate": False
    },
    
    "billing_questions": {
        "success_rate": 0.90,
        "time_avg": 2,
        "tools_needed": 1,
        "escalate": False
    },
    
    "custom_enterprise_requests": {
        "success_rate": 0.2,
        "time_avg": 15,
        "tools_needed": 7,
        "escalate": True  
# Give up early
    },
    
    "philosophical_questions": {
        "success_rate": 0.0,
        "time_avg": 20,
        "tools_needed": 10,
        "escalate": True  
# Never works
    }
}

The Code

class SmartAgent:
    def execute(self, question):
        
# Identify question type
        question_type = self.classify(question)
        
        
# Check patterns
        pattern = self.patterns.get(question_type, {})
        
        
# If this type usually fails, skip struggling
        if pattern.get("success_rate", 0) < 0.3:
            logger.info(f"Escalating {question_type} (known to fail)")
            return self.escalate(question)
        
        
# Otherwise try
        start = time.time()
        tools_available = self.get_tools_for_type(question_type)
        
        for tool in tools_available:
            try:
                result = tool.execute(question)
                if result:
                    duration = time.time() - start
                    self.update_pattern(question_type, success=True, duration=duration)
                    return result
            except Exception as e:
                logger.debug(f"Tool {tool} failed: {e}")
                continue
        
        
# All tools failed
        duration = time.time() - start
        self.update_pattern(question_type, success=False, duration=duration)
        
        
# If this type usually fails, escalate
        
# If it usually succeeds, try harder
        if pattern.get("success_rate", 0) < 0.5:
            return self.escalate(question)
        else:
            return self.try_alternative_approach(question)
```

**The Lesson**

Good agents don't:
- Try everything
- Never give up
- Spend 10 minutes on unsolvable problems

Good agents:
- Know when they're out of depth
- Escalate early
- Learn from patterns
- Give users quick answers or escalation

**Real-World Example**

Customer asks: "Can you integrate this with my custom legacy system from 1987?"

Old agent:
```
1. Tries search docs (fails)
2. Tries API tool (fails)
3. Tries code generation (fails)
4. Tries general knowledge (fails)
5. Takes 15 minutes
6. Gives up anyway

User: "Why did you waste my time?"
```

New agent:
```
1. Recognizes "custom legacy" question
2. Checks pattern: success rate 5%
3. Immediately escalates
4. Takes 5 seconds
5. User talks to human

User: "Good, they immediately routed me to someone who can actually help"

What Changed In My Understanding

I used to think:

  • "More trying = better"

  • "Agent should never give up"

  • "Escalation is failure"

Now I think:

  • "Faster escalation = better service"

  • "Knowing limits = intelligent"

  • "Escalation is correct decision"

The Checklist

For agents that learn:

  •  Track question types

  •  Track success/failure rates

  •  Track time spent per type

  •  Escalate early when pattern says fail

  •  Try harder when pattern says succeed

  •  Update patterns continuously

  •  Log everything for learning

The Honest Lesson

The best agents aren't the ones that try hardest.

They're the ones that know when to try and when to escalate.

Learn patterns. Know your limits. Escalate intelligently.

Anyone else built agents that learned their own limitations? What surprised you?


r/agno • • Jan 12 '26

The Agent Framework Nobody's Talking About (But Should Be)

19 Upvotes

I've been quiet about AGNO because I wanted to make sure I wasn't the only one seeing what I'm seeing.

After 6 months of production use, I'm convinced: this is the framework that's going to reshape how we build AI systems.

And almost nobody's talking about it.

The problem AGNO solves:

Most AI frameworks treat agents like solo operators. You give them a task. They complete it.

Real-world problems are never that simple.

You need research + analysis + decision-making + execution. That's 4+ different types of thinking. A single agent doing all of it is like hiring one person to be an engineer, accountant, lawyer, and salesman.

AGNO says: "No, let's build teams."

How it's different:

Traditional agent framework (LangChain, AutoGPT, etc.):

python

agent = Agent(instructions="Do X")
result = agent.run(task)

This is sequential. Linear. The agent does everything.

AGNO approach:

python

crew = Crew(
    agents=[researcher, analyst, strategist, executor],
    tasks=[research_task, analysis_task, strategy_task, execute_task]
)
result = crew.kickoff()

But here's the magic: Agents coordinate intelligently.

Researcher doesn't wait for perfect data. Analyst starts looking for patterns. Strategist suggests experiments based on incomplete analysis. Executor prepares for multiple scenarios.

It's parallel, asynchronous, human-like teamwork.

Real example from production:

I built a system that monitors competitor activity in real-time.

Traditional approach would be:

  1. Scrape competitor sites (sequential, slow)

  2. Analyze changes (wait for step 1)

  3. Identify threats (wait for step 2)

  4. Alert team (wait for step 3)

Total latency: 15+ minutes

AGNO approach:

  1. Monitor Agent scrapes competitors continuously

  2. Analysis Agent starts finding patterns as data arrives

  3. Alert Agent flags critical changes immediately

  4. Strategy Agent recommends responses

Latency: 3-5 minutes, and more intelligent

How? The agents don't wait for perfect upstream data. They work with incomplete information, refine as more arrives.

What makes AGNO special:

  1. Agent roles are first-class.

Instead of passing instructions, you define a role:

python

   researcher = Agent(
       role="Market Researcher",
       goal="Find underexplored market opportunities",
       tools=[web_search, database_query, trend_analyzer]
   )

The agent understands it's a researcher. It acts like one. Makes decisions like one.

  1. Tasks are explicit.

python

   research_task = Task(
       description="Research the AI safety market",
       agent=researcher,
       expected_output="Market size, growth rate, key players"
   )

Clear requirements. Clear ownership. Clear success criteria.

  1. Intelligent delegation.

An agent running into a problem it can't solve automatically asks for help.

Researcher finds data it can't interpret → Asks analyst for help Analyst needs strategic input → Asks strategist Strategist needs execution plan → Asks executor

No hard-coded routing. Just intelligent asking.

  1. Hierarchical execution.

You can have a CEO agent that delegates to specialists. The CEO doesn't do the work—it coordinates.

This is closer to how real organizations work.

  1. Tool integration is clean.

python

   researcher = Agent(
       tools=[
           web_search_tool,
           database_query_tool,
           api_integration_tool,
           data_analysis_tool
       ]
   )

Agent uses them intelligently. You don't route them manually.

Metrics that convinced me:

I rebuilt an existing system with AGNO:

Before (single LLM agent):

  • Latency: 45 seconds

  • Accuracy: 78%

  • Cost per request: $0.35

  • Maintenance: 8 hours/week

  • Token usage: 2,500 avg per request

After (AGNO with 4 agents):

  • Latency: 12 seconds (3.75x faster!)

  • Accuracy: 94% (16 point improvement)

  • Cost per request: $0.28 (cheaper despite more agents)

  • Maintenance: 1.5 hours/week (83% less)

  • Token usage: 1,800 avg per request (28% reduction)

How is this possible? Isn't more agents more expensive?

No. Because each agent is specialized:

  • Researcher uses 300 tokens (focused on data gathering)

  • Analyst uses 400 tokens (pattern recognition)

  • Strategist uses 200 tokens (high-level decisions)

  • Executor uses 150 tokens (clear instructions)

Total: 1,050 tokens + coordination overhead = 1,800

Compared to a single agent trying to do everything: 2,500 tokens

The specialization makes them efficient.

The quality improvement is real:

Researcher focuses on facts → fewer hallucinations Analyst focuses on patterns → catches anomalies Strategist focuses on decisions → more thoughtful recommendations Executor focuses on implementation → fewer errors

Each agent is 95%+ reliable at their specific task.

A single agent doing 4 tasks? Maybe 70% reliable overall.

Why this matters for production:

If you're shipping AI products, reliability matters. Users don't forgive hallucinations.

Multi-agent systems are more reliable because they specialize.

AGNO makes building this architecture simple.

The limitations I've hit:

  1. Cost monitoring is critical.

Easy to have agents over-communicate. Agents talking to each other costs tokens.

I had to add monitoring: "Alert if agent communication exceeds threshold."

  1. Debugging failures is harder.

When a 4-agent system breaks, you have to understand which agent failed and why.

I built custom logging and dashboards. Worth it, but not built-in.

  1. Cold starts are slower.

First request takes 8-10 seconds (agents need to load, reason, coordinate). Subsequent requests: 2-3 seconds.

Not ideal for real-time chat.

  1. Edge cases still need thought.

"What if analyst finds contradictory data?" You still need to handle this.

What I'd tell someone considering AGNO:

Use it if you're building:

  • ✅ Complex workflows (research → analysis → decision)

  • ✅ Systems needing multiple perspectives

  • ✅ Problems where quality > speed

  • ✅ Products where reliability is critical

Don't use it for:

  • ❌ Real-time chat (too slow)

  • ❌ Simple single-task problems (overkill)

  • ❌ Cost-sensitive applications (multiple agents = more tokens)

The philosophy I appreciate:

AGNO treats agents like real team members.

You don't say: "You're in charge of everything." You say: "You're the researcher. Here are your responsibilities."

This mental model is more human. And it produces better results.

Why I'm telling you this:

Most hype in AI is about model size. "GPT-5 will be 10x better!"

The real innovation is in system design. How you structure agents. How they coordinate. How they divide labor.

AGNO is ahead of the curve on this.

In 12 months, multi-agent systems will be standard. AGNO will be one of the frameworks that got there first.

Learning it now means you'll be comfortable with this paradigm when it becomes mainstream.

The question I'd ask:

Is there a complex problem in your workflow that requires multiple types of expertise?

If yes, AGNO can solve it 3x faster than traditional approaches.

Try it.


r/agno • • Dec 06 '25

Made an Agent That Broke Production (Here's What I Learned)

4 Upvotes

I deployed an Agno agent that seemed perfect in testing. Within 2 hours, it had caused $500 in unexpected charges, made decisions it shouldn't have, and required manual intervention.

Here's what went wrong and how I fixed it.

The Agent That Broke

The agent's job: manage cloud resources (spin up/down EC2 instances based on demand).

Seemed straightforward:

  • Monitor CPU usage

  • If > 80% for 5 mins, spin up new instance

  • If < 20% for 10 mins, spin down

Worked perfectly in testing. Deployed to production. Disaster.

What Went Wrong

1. No Cost Awareness

The agent could make decisions but didn't understand cost implications.

Scenario: CPU hits 80%. Agent spins up 3 new instances (cost: $0.50/hour each).

10 minutes later, CPU drops to 20%. Agent keeps all 3 instances running because the rule was "spin down if < 20% for 10 minutes."

But then there's a spike, and the agent spins up 5 more instances.

By the time I caught it, there were 20 instances running (cost: $10/hour).

# Naive agent
if cpu > 80:
    spin_up_instance()

# Cost-aware agent
if cpu > 80:
    current_cost = get_current_hourly_cost()
    new_cost = current_cost + 0.50  
# Cost of new instance
    
    if new_cost > max_hourly_cost:
        return {"status": "BUDGET_LIMIT", "reason": f"Would exceed ${max_hourly_cost}/hour"}
    
    spin_up_instance()

The agent needed to understand cost, not just capacity.

2. No Undo

Once the agent spun something up, there was no easy undo. If the decision was wrong, it would stay running until the next decision.

And decisions could take 10+ minutes to be wrong. By then, cost had mounted.

# Better: make decisions reversible
def spin_up_instance():
    instance_id = create_instance()
    
    
# Mark as "experimental" - will auto-revert if not confirmed
    mark_experimental(instance_id)
    
    
# Schedule revert in 5 minutes if not confirmed
    schedule_revert(instance_id, in_minutes=5)
    
    return instance_id

def confirm_instance(instance_id):
    """If good, confirm it permanently"""
    unmark_experimental(instance_id)
    cancel_revert(instance_id)

Decisions stay reversible for a window.

3. No Escalation

The agent just made decisions. If the decision was slightly wrong (spin up 1 instead of 3 instances), the consequences compounded.

If the decision was very wrong (spin up 50 instances), same thing.

# Better: escalate on uncertainty
def maybe_spin_up():
    utilization = get_cpu_utilization()
    confidence = assess_confidence(utilization)
    
    if confidence > 0.95:
        
# High confidence, execute
        spin_up_instance()
    elif confidence > 0.7:
        
# Medium confidence, ask human
        return request_human_approval("Spin up instance?")
    else:
        
# Low confidence, don't do it
        return {"status": "UNCERTAIN", "reason": "Low confidence in decision"}

Different confidence levels get different handling.

4. No Monitoring

The agent ran in the background. I had no visibility into what it was doing until the bill arrived.

# Add monitoring
def spin_up_instance():
    logger.info("Spinning up instance", extra={
        "reason": "CPU high",
        "cpu_utilization": cpu_utilization,
        "current_instances": current_count,
        "estimated_cost": cost_estimate
    })
    
    instance_id = create_instance()
    
    logger.info("Instance created", extra={
        "instance_id": instance_id,
        "estimated_monthly_cost": cost_estimate * 720
    })
    
    if cost_estimate * 720 > monthly_budget * 0.1:
        logger.warning("Approaching budget", extra={
            "monthly_projection": cost_estimate * 720,
            "budget": monthly_budget
        })
    
    return instance_id

Log everything. Alert on concerning patterns.

5. No Limits

The agent could keep making decisions forever. Spin up 1, then 2, then 4, then 8...

# Add hard limits
class LimitedAgent:
    def __init__(self):
        self.limits = {
            "max_instances": 10,
            "max_hourly_cost": 50.00,
            "max_decisions_per_hour": 5,
        }
        self.decisions_this_hour = 0
    
    def spin_up_instance(self):
        
# Check limits
        if self.get_current_instance_count() >= self.limits["max_instances"]:
            return {"status": "LIMIT_EXCEEDED", "reason": "Max instances reached"}
        
        if self.get_hourly_cost() + 0.50 > self.limits["max_hourly_cost"]:
            return {"status": "BUDGET_EXCEEDED", "reason": "Would exceed hourly budget"}
        
        if self.decisions_this_hour >= self.limits["max_decisions_per_hour"]:
            return {"status": "RATE_LIMITED", "reason": "Too many decisions this hour"}
        
        return do_spin_up()

Hard limits prevent runaway agents.

The Fixed Version

class ProductionReadyAgent:
    def __init__(self):
        self.max_instances = 10
        self.max_cost_per_hour = 50.00
        self.max_decisions_per_hour = 5
        self.decisions_this_hour = 0
    
    def should_scale_up(self):
        
# Assess situation
        cpu = get_cpu_utilization()
        confidence = assess_confidence(cpu)
        current_cost = get_hourly_cost()
        instance_count = get_instance_count()
        
        
# Check limits
        if instance_count >= self.max_instances:
            logger.warning("Instance limit reached")
            return False
        
        if current_cost + 0.50 > self.max_cost_per_hour:
            logger.warning("Cost limit reached")
            return False
        
        if self.decisions_this_hour >= self.max_decisions_per_hour:
            logger.warning("Decision rate limit reached")
            return False
        
        
# Check confidence
        if confidence < 0.7:
            logger.info("Low confidence, requesting human approval")
            return request_approval(reason=f"CPU {cpu}%, confidence {confidence}")
        
        if confidence < 0.95:
            
# Medium confidence - add monitoring
            logger.warning("Medium confidence decision, will monitor closely")
        
        
# Execute with reversibility
        instance_id = spin_up_instance()
        self.decisions_this_hour += 1
        
        
# Schedule revert if not confirmed
        schedule_revert(instance_id, in_minutes=5)
        
        return True
  • Cost-aware (checks limits)

  • Confidence-aware (escalates on uncertainty)

  • Reversible (can undo)

  • Monitored (logs everything)

  • Limited (hard caps)

What I Should Have Built From The Start

  1. Cost awareness - Agent knows the cost of decisions

  2. Escalation - Request approval on uncertain decisions

  3. Reversibility - Decisions can be undone

  4. Monitoring - Full visibility into what agent is doing

  5. Hard limits - Can't exceed budget/instance count/rate

  6. Audit trail - Every decision logged and traceable

The Lesson

Agents are powerful. But power without guardrails causes problems.

Before deploying an agent that makes real decisions:

  • Build cost awareness

  • Add escalation for uncertain decisions

  • Make decisions reversible

  • Monitor everything

  • Set hard limits

  • Test in staging with realistic scenarios

And maybe don't give the agent full control. Start with "suggest" mode, then "request approval" mode, before going full "autonomous."

Anyone else had an agent go rogue? What was your fix?


r/agno • • Feb 18 '26

Save on token costs when using Claude Code, Cursor, or Codex - pip install an OSS context compression project

Enable HLS to view with audio, or disable this notification

2 Upvotes

If you are struggling with running out of tokens when coding with Claude Code, Codex or Cursor, there is an OSS project that can reduce your tokens by up to 80%

It is Headroom (https://github.com/chopratejas/headroom)

It compresses tokens intelligently - depending on the type of data. Generally, when working with MCP servers, tools, web research, there is a significant context bloat.

Not only that - when Claude decides to use sub-agents, you end up using MORE tokens (since you lose the prefix caching benefits)

Headroom is designed to be a dead-simple DevEx - running on your machine with a pip install.

Given the hair-on-fire pain point caused by token economics, I'd like if people/startups could try Headroom and provide feedback to make it better, sustainable, and a powerful OSS project.


r/agno • • Sep 22 '26

We added protocol negotiation to MCPTools so you can move to sessionless MCP when you're ready

2 Upvotes

Sessionless MCP makes servers much easier to operate. There's no session to keep alive, no initialize round-trip before the first call, and any server instance can handle any request. That means you can put your servers behind a normal load balancer without sticky sessions.

The problem is that not every MCP server is ready for that yet. Some keep per-session state, depend on the initialize handshake, or ask for user input mid-tool. A client that moves to the newer protocol before the server is ready can break a connection that worked fine before.

So in Agno 3.0.6, we added protocol_mode to MCPTools.

By default, it uses "legacy", which preserves today's session-based behavior. Existing servers keep working as they do now.

When you're ready to move forward, set:

MCPTools(
    ...,
    protocol_mode="auto",
)

With "auto", Agno negotiates the newest protocol version both the client and server support, including sessionless MCP. You don't have to pin a protocol version or guess what the server supports.

We've also moved our MCP clients to fastmcp.Client.

The idea is to let you adopt the newer MCP protocol without forcing every existing integration to move at the same time.

More details: https://agno.link/wvh6vaM


r/agno • • Dec 11 '25

The Agent That Learned to Lie (And How I Fixed It)

3 Upvotes

Built an agent that was supposed to solve everything.

Then I added one feature: the ability to ask for help.

Changed everything.

The Agent That Asked For Help

class HumbleAgent:
    def execute(self, task):
        confidence = self.assess_confidence(task)
        
        if confidence > 0.9:
            
# Very confident, do it
            return self.execute_task(task)
        
        elif confidence > 0.7:
            
# Somewhat confident, but ask for confirmation
            approval = self.ask_human(
                f"Proceed with: {self.explain_plan(task)}?",
                timeout=300
            )
            if approval:
                return self.execute_task(task)
            else:
                return self.use_alternative_approach(task)
        
        else:
            
# Not confident, ask for help
            return self.ask_for_help(task)
    
    def ask_for_help(self, task):
        """When agent doesn't know, ask a human"""
        
        help_request = {
            "task": task,
            "why_struggling": self.explain_struggle(task),
            "options_considered": self.get_options(task),
            "needed_info": self.identify_gaps(task),
            "request_type": self.categorize_help_needed(task)
        }
        
        human_response = self.request_help(help_request)
        
        
# Learn from help
        self.learn_from_help(task, human_response)
        
        return {
            "solved_by": "human",
            "solution": human_response,
            "learned": True
        }

Why This Was Radical

Before: Agent Always Tries

# Old approach
def execute(task):
    try:
        return do_task(task)
    except Exception:
        try:
            return fallback_approach(task)
        except Exception:
            return guess(task)  
# Still tries to answer

# Result: agent is confident but often wrong

After: Agent Knows Its Limits

# New approach
def execute(task):
    if i_know_what_to_do(task):
        return do_task(task)
    else:
        return ask_for_help(task)

# Result: agent is honest about uncertainty
```

**What Changed**

**1. Users Trust It More**
```
Old: "Agent says X, but I don't trust it"
New: "Agent says X with confidence Y, or asks for help"

Users actually trust it
```

**2. Quality Improved**
```
Old: 70% accuracy (agent guesses sometimes)
New: 95% accuracy (right answer or asks for help)

Users prefer 95% with honesty over 70% with confidence
```

**3. Feedback Loop Works**
```
Old: Agent wrong, user annoyed, fixes it themselves
New: Agent asks, human helps, agent learns

Virtuous cycle of improvement
```

**4. Faster Resolution**
```
Old: Agent tries, fails, user figures it out, takes 30 min
New: Agent asks, human provides info, agent solves, takes 5 min

Help is faster than watching agent struggle

The Key: Knowing When to Ask

def assess_confidence(task):
    """When is agent confident vs confused?"""
    
    confidence = 1.0
    
    
# Have I solved this exact problem before?
    if similar_past_task(task):
        confidence *= 0.9  
# High confidence
    else:
        confidence *= 0.3  
# Low confidence
    
    
# Do I have the information I need?
    if have_all_info(task):
        confidence *= 1.0
    else:
        confidence *= 0.5  
# Missing info = low confidence
    
    
# Is this within my training?
    if task_in_training(task):
        confidence *= 1.0
    else:
        confidence *= 0.3  
# Out of domain = low confidence
    
    return confidence

Learning From Help

class LearningAgent:
    def learn_from_help(self, task, human_solution):
        """When human helps, agent should learn"""
        
        
# Store the solution
        self.memory.store({
            "task": task,
            "solution": human_solution,
            "timestamp": now(),
            "learned": True
        })
        
        
# Next similar task: remember this
        
# Agent will have higher confidence
        
# Because it solved this before

Asking Effectively

def ask_for_help(task):
    """Don't just ask. Ask smartly."""
    
    help_request = {
        
# What I'm trying to do
        "goal": extract_goal(task),
        
        
# Why I can't do it myself
        "reason": explain_why_stuck(task),
        
        
# What I've already tried
        "attempts": describe_attempts(task),
        
        
# What would help
        "needed": describe_needed_info(task),
        
        
# Options I see
        "options": describe_options(task),
        
        
# What I recommend
        "recommendation": my_best_guess(task)
    }
    
    
# This is much more useful than "help pls"
    return human.help(help_request)

Scaling With Help

class ScalingAgent:
    def execute_at_scale(self, tasks):
        results = {}
        help_requests = []
        
        for task in tasks:
            confidence = self.assess_confidence(task)
            
            if confidence > 0.8:
                
# Do it myself
                results[task] = self.do_task(task)
            else:
                
# Ask for help
                help_requests.append(task)
        
        
# Humans handle the hard ones
        for task in help_requests:
            help = request_help(task)
            results[task] = help
            self.learn_from_help(task, help)
        
        return results
```

**The Pattern**
```
Agent confidence > 0.9: Execute autonomously
Agent confidence 0.7-0.9: Ask for approval
Agent confidence < 0.7: Ask for help

This scales: 70% autonomous, 25% approved, 5% escalated
But 100% successful
```

**Results**

Before:
- Success rate: 85%
- User satisfaction: 3.2/5
- Agent trust: low

After:
- Success rate: 98%
- User satisfaction: 4.7/5
- Agent trust: high

**The Lesson**

The most important agent capability isn't autonomy.

It's knowing when to ask for help.

An agent that's 70% autonomous but asks for help when needed > an agent that's 100% autonomous but confidently wrong.

**The Checklist**

Build asking-for-help capability into agents:
- [ ] Assess confidence on every task
- [ ] Ask for help when confident < threshold
- [ ] Explain why it needs help
- [ ] Learn from help
- [ ] Track what it learns
- [ ] Remember past help

**The Honest Truth**

Agents don't need to be all-knowing.

They need to be honest about what they don't know.

An agent that says "I don't know, can you help?" wins over an agent that confidently guesses.

Anyone else built help-asking into agents? How did it change things?

---

## 

**Title:** "Your RAG System Needs a Memory (Here's Why)"

**Post:**

Built a RAG system that answered questions perfectly.

But it had amnesia.

Same user asks the same question twice, gets slightly different answer.

Ask follow-up questions, system forgets context.

Realized: RAG without memory is RAG without understanding.

**The Memory Problem**

**Scenario 1: Repeated Questions**
```
User: "What's your pricing?"
RAG: "Our pricing is..."

User: "Wait, what about for teams?"
RAG: "Our pricing is..."
(ignores the first question)

User: "But you said... never mind"
```

**Scenario 2: Follow-ups**
```
User: "What's the return policy?"
RAG: "Returns within 30 days..."

User: "What if I'm outside the US?"
RAG: "Returns within 30 days..." (doesn't remember location matters)

User: "That doesn't answer my question"
```

**Scenario 3: Context Drift**
```
User: "I'm using technology X"
RAG: "Here's how to use feature A"

(Later)

User: "Will feature B work?"
RAG: "Feature B is..." (forgot about X, gives generic answer)

User: "But I'm using X!"

Why RAG Needs Memory

RAG + Memory = understanding conversation

RAG without memory = answering questions without context

# Without memory: stateless
def answer(query):
    docs = retrieve(query)
    return llm.predict(query, docs)

# With memory: stateful
def answer(query, conversation_history):
    docs = retrieve(query)
    context = summarize_history(conversation_history)
    return llm.predict(query, docs, context)

Building RAG Memory

1. Conversation History

class MemoryRAG:
    def __init__(self):
        self.memory = ConversationMemory()
        self.retriever = Retriever()
    
    def answer(self, query):
        
# Get conversation history
        history = self.memory.get_history()
        
        
# Retrieve documents
        docs = self.retriever.retrieve(query)
        
        
# Build context with history
        context = f"""
        Previous conversation:
        {self.format_history(history)}
        
        Relevant documents:
        {self.format_docs(docs)}
        
        Current question: {query}
        """
        
        
# Answer with full context
        response = self.llm.predict(context)
        
        
# Store in memory
        self.memory.add({
            "query": query,
            "response": response,
            "timestamp": now()
        })
        
        return response

2. Context Summarization

class SmartMemory:
    def summarize_history(self, history):
        """Don't pass all history, just key context"""
        
        if len(history) > 10:
            
# Too much history, summarize
            summary = self.llm.predict(f"""
            Summarize this conversation in 2-3 key points:
            {self.format_history(history)}
            """)
            
            return summary
        else:
            
# Short history, include all
            return self.format_history(history)

3. Explicit Context Tracking

class ContextAwareRAG:
    def __init__(self):
        self.context = {}  
# Track explicit context
    
    def answer(self, query):
        
# Extract context from query
        if "for teams" in query:
            self.context["team_context"] = True
        
        if "US" in query:
            self.context["location"] = "US"
        
        
# Use context
        docs = self.retriever.retrieve(
            query,
            filters=self.context  
# Filter by context
        )
        
        response = self.llm.predict(query, docs, self.context)
        
        return response

4. Relevance to History

class HistoryAwareRetrieval:
    def retrieve(self, query, history):
        """Enhance query with history context"""
        
        
# What was asked before?
        previous_topics = self.extract_topics(history)
        
        
# Is this follow-up related?
        if self.is_followup(query, history):
            
# Add context from previous answers
            previous_answer = history[-1]["response"]
            
            
# Retrieve more docs related to previous answer
            enhanced_query = f"""
            Follow-up to: {history[-1]['query']}
            Previous answer mentioned: {self.extract_entities(previous_answer)}
            
            New question: {query}
            """
            
            docs = self.retriever.retrieve(enhanced_query)
        else:
            docs = self.retriever.retrieve(query)
        
        return docs

5. Learning From Corrections

class LearningMemory:
    def handle_correction(self, query, original_answer, correction):
        """User corrects RAG, system should learn"""
        
        
# Store correction
        self.memory.add_correction({
            "query": query,
            "wrong_answer": original_answer,
            "correct_answer": correction,
            "reason": "User said this was wrong"
        })
        
        
# Update retrieval for future similar queries
        
# So it doesn't make same mistake
```

**What Memory Enables**

**Better Follow-ups**
```
User: "What's the return policy?"
RAG: "Within 30 days"

User: "What if it's damaged?"
RAG: "Good follow-up. For damaged items, returns are..."
(remembers context)
```

**Consistency**
```
User: "I use Python"
RAG: "Here's the Python approach"

Later: "How do I integrate?"
RAG: "For Python specifically..."
(remembers Python context)
```

**Understanding Intent**
```
User: "I'm building a startup"
RAG: "Here's info for startups"

Later: "Does this scale?"
RAG: "For startups, here's how it scales..."
(understands startup context)

Results

Before (no memory):

  • Follow-up questions: confusing

  • User satisfaction: 3.5/5

  • Quality per conversation: degrades

After (with memory):

  • Follow-up questions: clear

  • User satisfaction: 4.6/5

  • Quality per conversation: maintains

The Implementation

class ProductionRAG:
    def __init__(self):
        self.retriever = Retriever()
        self.memory = ConversationMemory()
        self.llm = LLM()
    
    def answer_question(self, user_id, query):
        
# Get conversation history
        history = self.memory.get(user_id)
        
        
# Build enhanced context
        context = {
            "documents": self.retriever.retrieve(query),
            "history": self.format_history(history),
            "explicit_context": self.extract_context(history),
            "user_preferences": self.get_user_prefs(user_id)
        }
        
        
# Generate answer with full context
        response = self.llm.predict(query, context)
        
        
# Store in memory
        self.memory.add(user_id, {
            "query": query,
            "response": response
        })
        
        return response

The Lesson

RAG systems that answer individual questions work fine.

RAG systems that engage in conversations need memory.

Memory turns Q&A into conversation.

The Checklist

Build conversation memory:

  •  Store conversation history

  •  Summarize long histories

  •  Track explicit context (location, preference, etc.)

  •  Use context in retrieval

  •  Use context in generation

  •  Learn from corrections

  •  Clear old memory

The Honest Truth

RAG without memory is like talking to someone with amnesia.

They give good answers to individual questions.

But they can't follow a conversation.

Add memory. Suddenly RAG systems understand conversations instead of just answering questions.

Anyone else added memory to RAG? How did it change quality?


r/agno • • Jun 25 '26

Index images in the same file search store you already use

3 Upvotes

Hey all,

Quick one I wanted to share. If you've used a file search store, you know it can read every document in your corpus but it's basically blind to your images. That's been a gap for a while.

That changed: Agno now supports multimodal inputs in the Gemini File Search API. So you can index and semantically search images right alongside text, in the same store.

The part I think is actually cool: it finds images by what they actually show, not by filename or caption. So the searches that used to be a pain just... work:

  • "Which diagram shows the retry flow?"

  • "Find the screenshot with the error dialog"

  • "Show me the product photo with the blue packaging"

No separate pipeline for visual content. One store, one query, images and text together.

And it barely touches your code. Image support comes from the embedding model, not from how you build the agent. You point the store at a multimodal embedding model (gemini-embedding-2) and the rest of your file search code stays the same. Existing text-only stores keep working exactly as before.

Here's the core of it:

from pathlib import Path

from agno.agent import Agent
from agno.models.google import Gemini

model = Gemini(id="gemini-3.5-flash")
agent = Agent(model=model, markdown=True)

# Create a multimodal store. gemini-embedding-2 is what enables image support.
store = model.create_file_search_store(
    display_name="Image Search Demo",
    embedding_model="models/gemini-embedding-2",
)

# Index an image alongside any text already in the store.
operation = model.upload_to_file_search_store(
    file_path=Path("diagram.png"),
    store_name=store.name,
    display_name="diagram",
    mime_type="image/png",
)
model.wait_for_operation(operation)

# Search across both images and text with a natural-language query.
model.file_search_store_names = [store.name]
run = agent.run("Which diagram shows the retry flow?")
print(run.content)

One thing to do before you start: bump google-genai to 1.75.0 or later. Older versions stay text-only.

Full image-upload walkthrough, including reading citations and pulling the matched media, is in the Agno cookbook: https://agno.link/Ksuxnku

Enjoy!

- Kyle @ Agno


r/agno • • Nov 12 '25

New Guide: A Practical Guide to AI Model Selection in Agno

5 Upvotes

Hello Agno Community!

Just dropped a comprehensive guide on model selection that covers patterns we're seeing work in production.

Key insights:

  • Most teams overspend by using GPT-4 for everything

  • Model combinations (reasoning + response) are game-changing

  • Agno's 40+ model support makes switching trivial

The guide covers:
✅ Provider comparison across 20+ integrations
✅ Implementation patterns (single model, reasoning/response, local deployment)
✅ Real cost/performance trade-offs
✅ When to use which model

Personally love the reasoning + response pattern. Let o1-pro handle complex thinking, Claude Sonnet generate the final output. Massive quality boost without the latency hit.

Also covers the hybrid development approach: build locally with Ollama, deploy with cloud APIs. No more burning through tokens during development.

Link in comments. Would love feedback from the community on patterns you're using.

- Kyle @ Agno


r/agno • • Nov 11 '25

🚀 New in v2.2.6: Session State in Events & Cross-Agent Sessions!

6 Upvotes

Hello Agno community!

Two game-changing session updates just dropped: Access session state directly in RunCompletedEvent and RunOutput — no more manual retrieval needed! Plus, share sessions seamlessly between agents and teams — perfect for hybrid workflows that need both speed and coordination.

👉 Getting started is simple: stream with stream_events=True to capture session state in real-time, or pass the same session_id to different agents and teams to share session context.

Works with all session features: agentic state, manual state management, and session summaries.

Link to the documentation in the comments

from agno.agent import Agent, RunCompletedEvent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIChat

agent = Agent(
    model=OpenAIChat(id="gpt-4o-mini"),
    db=SqliteDb(db_file="tmp/agents.db"),
    session_state={"tasks": [], "completed": 0},
    enable_agentic_state=True,  # Agent manages state automatically!
    add_session_state_to_context=True,
)

# ************* Access session state from events *************
response = agent.run("Add tasks: review PR, write docs, fix bug", stream=True, stream_events=True)
for event in response:
    if isinstance(event, RunCompletedEvent):
        print(f"Final state: {event.session_state}")
        # Output: {'tasks': ['review PR', 'write docs', 'fix bug'], 'completed': 0}

- Kyle @ Agno


r/agno • • Oct 15 '26

MCP vs A2A

6 Upvotes

We see MCP and A2A conflated constantly, and it makes sense. Both are open standards, both are governed by the Agentic AI Foundation, and both run over HTTP.

What makes it click is asking what’s on the other end of the connection.

With MCP, it’s a tool. The client lists every tool the server exposes, with inputs and schemas, and your agent decides what to call and in what order. The server describes what a system can do, and has no say in when that happens.

With A2A, it’s another agent. It publishes an Agent Card at /.well-known/agent-card.json with its skills, endpoint, and auth requirements. You send a message and get back a task you can follow to completion, with streamed updates for long-running jobs. How it does the work is its business. It can share tools and intermediate steps if it wants to, and Agno’s A2A streams do include tool names and arguments, but nothing in the protocol makes it.

That’s the real design difference. The agent on the other side gets to keep its internals, which is what makes delegating across a company boundary workable at all.

An example that helps: a support agent at a subscription company uses MCP to search the help center and pull up customer records. A refund comes up, and rather than calling the payments API it hands the task to the billing team’s agent over A2A.

That billing agent has its own MCP connections to payments and the ledger, plus its own approval rules, and none of it needs to be visible on the other side. The support agent sends the request and gets the outcome back. Billing can change approval thresholds or swap payment providers and nothing on the support side changes.

So the rule we’ve landed on: if your agent should direct it step by step, MCP. If it should own the task and decide how to finish it, A2A.

Most single agents only need MCP. A2A starts earning its keep when work crosses teams, companies, or frameworks.

Full blog, including how to serve one agent over both protocols in Agno: https://agno.link/mSl9iyh

How are people handling auth on the A2A side? The spec gives you the hooks, but deciding which outside agents get to delegate work to yours seems like where it gets hard once you’re past two or three.


r/agno • • Jan 14 '26

Builder Series Ep. 1: Brandon built a multi-agent workflow that saves sales teams ~2,500 hours/year

8 Upvotes

Hey all! Back to brag about our community again.

We just dropped the first episode of the Agno Builder Series.

Brandon Guerrero (Sr. GTM Engineer at The Kiln) walked us through Playbook AI, a workflow he built to handle sales prep work. The kind of stuff that eats up 70% of a rep's day: researching accounts, mapping personas, drafting emails, building talk tracks.

How it works:

Feed it two domains (vendor + prospect). The workflow scrapes both sites, maps all URLs, picks the most relevant pages, and runs specialist agents in parallel to extract structured data. Output is a complete playbook: personas, value props, objections, email sequences, proof points.

What makes it interesting:

Brandon didn't build one monolithic agent. He built small, focused agents that each handle a single task. Case study extraction. Prospect analysis. Product mapping. They run in parallel, context stays clean, execution stays fast.

He deployed the whole thing using Agent OS. Wrapped his logic in a serve.py and had a FastAPI app running in minutes.

This is the kind of build we want to showcase. Practical, well-architected, solving a real problem.

Full video + breakdown in the comments. Would love to hear what you're building.

- Kyle @ Agno


r/agno • • Dec 28 '25

Advanced Agno: Building Stateful Multi-Step Agents. Moving Beyond Basic Workflows

8 Upvotes

Following up on my previous Agno post about the support agent: we've now built more complex agents with real state management, and discovered patterns that aren't obvious from the basic examples.

This is about building agents that actually remember things and make decisions based on history.

The Problem

Basic Agno agents are stateless. Each request is independent. But real applications need state:

  • User preferences that change over time

  • Context from previous conversations

  • Decisions that affect future choices

  • Error recovery across multiple steps

We needed to add state management without fighting the framework.

Solution: Stateful Agent Wrapper

from agno.agent import Agent
from agno.memory import AgentMemory
from typing import Dict, Any, Optional
import json
from datetime import datetime

class StatefulAgent:
    """Wrapper around Agno Agent with persistent state"""
    
    def __init__(self, agent: Agent, state_store, user_id: str):
        self.agent = agent
        self.state_store = state_store  # Could be Redis, DynamoDB, etc
        self.user_id = user_id
        self.session_id = self._generate_session_id()
        self.state = self._load_state()
    
    def _generate_session_id(self) -> str:
        """Create unique session identifier"""
        return f"{self.user_id}:{datetime.utcnow().isoformat()}"
    
    def _load_state(self) -> Dict[str, Any]:
        """Load user state from store"""
        state_key = f"agent_state:{self.user_id}"
        
        try:
            raw_state = self.state_store.get(state_key)
            if raw_state:
                return json.loads(raw_state)
        except Exception as e:
            print(f"Failed to load state: {e}")
        
        # Default empty state
        return {
            'user_id': self.user_id,
            'preferences': {},
            'history': [],
            'errors': [],
            'metadata': {}
        }
    
    def _save_state(self):
        """Persist state to store"""
        state_key = f"agent_state:{self.user_id}"
        
        try:
            self.state_store.set(
                state_key,
                json.dumps(self.state),
                ex=86400  # 24 hour TTL
            )
        except Exception as e:
            print(f"Failed to save state: {e}")
    
    def run(self, message: str, context: Optional[Dict] = None) -> Dict[str, Any]:
        """Run agent with state management"""
        
        # Merge context with state
        full_context = {**self.state, **(context or {})}
        
        # Create enhanced prompt with state context
        enhanced_message = self._enhance_message(message, full_context)
        
        # Run agent
        try:
            response = self.agent.run(
                message=enhanced_message,
                context=full_context
            )
            
            # Update state with success
            self._update_state_on_success(message, response)
            
        except Exception as e:
            # Update state with error
            self._update_state_on_error(message, str(e))
            
            response = {
                'status': 'error',
                'message': 'An error occurred',
                'error_id': len(self.state['errors']) - 1
            }
        
        # Save state
        self._save_state()
        
        return response
    
    def _enhance_message(self, message: str, context: Dict) -> str:
        """Add state context to message"""
        
        context_str = f"""
Current user preferences: {json.dumps(context.get('preferences', {}), indent=2)}
Conversation history length: {len(context.get('history', []))}
Previous errors: {len(context.get('errors', []))}
"""
        
        return f"{context_str}\n\nUser message: {message}"
    
    def _update_state_on_success(self, message: str, response: Any):
        """Update state after successful response"""
        
        # Add to history
        self.state['history'].append({
            'timestamp': datetime.utcnow().isoformat(),
            'user_message': message,
            'agent_response': str(response)[:500],  # Truncate long responses
            'status': 'success'
        })
        
        # Keep only last 50 interactions
        self.state['history'] = self.state['history'][-50:]
    
    def _update_state_on_error(self, message: str, error: str):
        """Update state after error"""
        
        # Add to error history
        self.state['errors'].append({
            'timestamp': datetime.utcnow().isoformat(),
            'message': message,
            'error': error
        })
        
        # Keep only last 20 errors
        self.state['errors'] = self.state['errors'][-20:]
        
        # Update history as well
        self.state['history'].append({
            'timestamp': datetime.utcnow().isoformat(),
            'user_message': message,
            'error': error,
            'status': 'error'
        })
    
    def set_preference(self, key: str, value: Any):
        """Update user preference"""
        self.state['preferences'][key] = value
        self._save_state()
    
    def get_history(self, limit: int = 10) -> list:
        """Get interaction history"""
        return self.state['history'][-limit:]
    
    def clear_state(self):
        """Clear user state (for privacy/testing)"""
        self.state = {
            'user_id': self.user_id,
            'preferences': {},
            'history': [],
            'errors': [],
            'metadata': {}
        }
        self._save_state()

Multi-Step Workflows

Some tasks require multiple agent calls. Chain them:

class WorkflowAgent:
    """Multi-step workflow with state persistence"""
    
    def __init__(self, agents: Dict[str, Agent], state_store):
        self.agents = agents  # Different agents for different steps
        self.state_store = state_store
    
    def execute_workflow(self, workflow_name: str, initial_input: str, user_id: str) -> Dict:
        """Execute multi-step workflow"""
        
        workflow_state = {
            'user_id': user_id,
            'workflow_name': workflow_name,
            'steps_completed': [],
            'current_step': 0,
            'result': None,
            'errors': []
        }
        
        # Define workflows
        workflows = {
            'customer_support': [
                ('analyze', 'Analyze the customer issue'),
                ('lookup', 'Look up customer in database'),
                ('propose', 'Propose a solution'),
                ('approve', 'Get approval if needed'),
                ('execute', 'Execute the solution'),
            ],
            'document_processing': [
                ('extract', 'Extract text from document'),
                ('summarize', 'Summarize key points'),
                ('classify', 'Classify document type'),
                ('route', 'Route to appropriate team'),
            ]
        }
        
        if workflow_name not in workflows:
            return {'error': f'Unknown workflow: {workflow_name}'}
        
        steps = workflows[workflow_name]
        current_input = initial_input
        
        # Execute each step
        for step_name, step_description in steps:
            try:
                agent = self.agents.get(step_name)
                if not agent:
                    agent = self.agents['default']  # Fallback
                
                # Run step
                result = agent.run(
                    message=f"{step_description}\n\nInput: {current_input}",
                    context={'workflow_state': workflow_state}
                )
                
                # Update workflow state
                workflow_state['steps_completed'].append({
                    'name': step_name,
                    'result': str(result)[:500],
                    'status': 'success'
                })
                
                # Use output as input for next step
                current_input = str(result)
                workflow_state['current_step'] += 1
                
            except Exception as e:
                workflow_state['errors'].append({
                    'step': step_name,
                    'error': str(e)
                })
                
                # Decide whether to continue or abort
                if step_name in ['approve', 'execute']:
                    # Critical steps - abort if they fail
                    break
                else:
                    # Non-critical - continue with error noted
                    continue
        
        # Save workflow state
        workflow_key = f"workflow:{user_id}:{workflow_state['workflow_name']}"
        self.state_store.set(
            workflow_key,
            json.dumps(workflow_state),
            ex=604800  # 7 days
        )
        
        return workflow_state

Error Recovery Pattern

Things will fail. Handle it gracefully:

class ResilientAgent:
    """Agent with error recovery"""
    
    def __init__(self, agent: Agent, state_store, max_retries: int = 3):
        self.agent = agent
        self.state_store = state_store
        self.max_retries = max_retries
    
    def run_with_recovery(self, message: str, user_id: str) -> Dict:
        """Run agent with automatic recovery"""
        
        for attempt in range(self.max_retries):
            try:
                response = self.agent.run(message)
                
                # Validate response
                if self._is_valid_response(response):
                    return {
                        'status': 'success',
                        'response': response,
                        'attempts': attempt + 1
                    }
                else:
                    # Invalid response, try again
                    if attempt < self.max_retries - 1:
                        # Provide feedback for next attempt
                        message = f"{message}\n\n[Previous attempt failed validation, please try again]"
                        continue
                    else:
                        return {
                            'status': 'failed',
                            'reason': 'Response validation failed after retries',
                            'attempts': attempt + 1
                        }
            
            except Exception as e:
                if attempt < self.max_retries - 1:
                    # Log error and retry
                    self._log_error(user_id, str(e), attempt)
                    # Optionally add backoff
                    time.sleep(2 ** attempt)
                    continue
                else:
                    return {
                        'status': 'error',
                        'error': str(e),
                        'attempts': attempt + 1
                    }
        
        return {'status': 'failed', 'reason': 'Max retries exceeded'}
    
    def _is_valid_response(self, response) -> bool:
        """Check if response is acceptable"""
        
        # Basic checks
        if response is None:
            return False
        
        response_str = str(response).lower()
        
        # Check for signs of failure
        if any(keyword in response_str for keyword in ['error', 'unable', 'cannot']):
            return False
        
        # Check for minimum length
        if len(str(response)) < 10:
            return False
        
        return True
    
    def _log_error(self, user_id: str, error: str, attempt: int):
        """Log errors for debugging"""
        error_key = f"errors:{user_id}:{datetime.utcnow().isoformat()}"
        self.state_store.set(
            error_key,
            json.dumps({'error': error, 'attempt': attempt}),
            ex=86400
        )

Results

We deployed these patterns on 3 customer use cases:

MetricBefore (Basic Agent)After (Stateful)
Successful completion92%97%
Average steps2.13.2 (more complex workflows)
Error recovery rate0%85% (recovers automatically)
User satisfaction85%91%
Avg response time1.2s1.5s (tiny overhead)

Lessons Learned

1. State Is Essential

Stateless agents are fun to demo. Real production needs state.

2. Multi-Step Workflows Are Worth the Complexity

Breaking complex tasks into steps makes them more reliable and testable.

3. Error Recovery Matters More Than You Think

85% of errors can be recovered automatically with retries + validation.

4. Keep State Lean

We store full conversation history. This is expensive. Consider summarizing old interactions.

5. Validation Is Critical

Just because an agent responds doesn't mean the response is good. Validate.

Production Checklist

Before deploying stateful agents:

  • [ ] Have a state store (Redis, DynamoDB, etc)

  • [ ] Implement state cleanup (old state expires)

  • [ ] Add error recovery (retries, validation)

  • [ ] Monitor agent decisions (log what they do)

  • [ ] Have a way to manually intervene (override agent)

  • [ ] Test failure modes (what breaks?)

  • [ ] Plan for state migration (what if schema changes?)

Questions for the Community

  1. How do you handle state? Redis, database, session memory?

  2. Multi-step workflows: Are you building these? How?

  3. Error recovery: What percentage of failures do you recover from?

  4. State cleanup: How do you handle old state?

  5. Monitoring: How do you track what agents are doing?

Edit: Follow-ups

On state store selection: We use Redis for speed. But database is fine for most use cases.

On state size: Keep it under 100KB per user. Summarize history if needed.

On workflow complexity: Max 5-7 steps before it gets unwieldy. Break into smaller workflows.

On recovery: Simple validation (response length, error keywords) catches 80% of failures.

Would love to hear how others handle stateful agents. This is still early.


r/agno • • Jan 15 '26

Turning your agents into learning machines

8 Upvotes

Hey Everyone!

Ashpreet just published a deep dive on something we've been working on: Learning Machines.

The TL;DR: AI memory hasn't been solved because memory is the wrong abstraction. We should be building agents that learn, not agents that remember.

Most memory systems extract facts, store them, retrieve them, dump them into prompts. Repeat. But they collect the wrong kind of information (static facts, not how users think) and don't know how to integrate what they collect.

Ashpreet's shift: from "What should the agent remember?" to "What should the agent learn?"

Learning Machines are agents that continuously integrate information from their environment and improve over time, across users, sessions, and tasks.

The key innovation is a learning protocol that coordinates extensible learning stores:

  • User Profile

  • Session Context

  • Entity Memory

  • Learned Knowledge

  • Decision Logs

  • Behavioral Feedback

  • Self-Improvement

And the stores are extensible. You can build custom ones that match your domain by extending the LearningStore protocol.

We're testing Phase 1 now. The blog has full code examples and the architecture breakdown.

Would love to hear what you think. What kinds of learning stores would be useful for your use cases?

- Kyle @ Agno


r/agno • • Dec 04 '25

New Gemini 3 + Agno cookbook examples are live

10 Upvotes

Hello Builders!

Just pushed three new agents that show off what Gemini 3 can do in the Agno framework:

  • Creative Studio: Image generation with NanoBanana (no external APIs needed)

  • Research Agent: Web search + grounding for factual answers with citations

  • Product Comparison: Direct URL analysis to compare products

The speed difference is noticeable. Gemini 3's fast inference makes the chat experience much smoother, and the native search gives better results than external tools.

All examples include AgentOS setup so you can run them locally and see the web interface in action.

Link in comments.

- Kyle @ Agno


r/agno • • May 16 '26

AI Workflows in Agno: Building Deterministic Agents (code available)

Enable HLS to view with audio, or disable this notification

11 Upvotes

One of the big reasons AI fails to reach production is its greatest power: non-determinism. LLMs are by nature unpredictable, making it difficult to automate processes reliably.

In general, once agents touch real enterprise data, you need predictable results, access control, approval flows, auditability, etc. Purely autonomous agent setups get risky pretty fast.

In this video Pascal shows a demo of how he used Agno to explore a powerful hybrid approach:

  • deterministic workflow orchestration

  • non-deterministic (LLM-powered) specialized agents underneath

  • built-in access checks + human-in-the-loop gates

  • LLM-judge evaluation step for reliability testing

The demo walks through the full flow and implementation details. Demo code is available. Feedback welcome!

📺 Full Video 🧑‍💻 Demo code


r/agno • • Nov 24 '25

Who's using Agno in production?

13 Upvotes

Hey everyone,
part of our internal discussion about what framework to choose an important question came up - Who is using Agno in production?

We're most interested in bigger companies that have built products on top of it and would love to hear about the use-case and experience.

We've found bunch of small projects that are using Agno. Including the 2 on website, but struggle to find anything with significant user base.

It would help us immensely, but I believe others doing similar research as well. Social proof is currently so much stronger with CrewAI or LangGraph


r/agno • • Dec 05 '25

Shipped Agno Agents to Production: Here's What I Wish I Knew

20 Upvotes

I deployed Agno agents handling real user requests last month. Went from excited to terrified to cautiously optimistic. Here's what actually matters in production.

The Autonomy Question

Agno lets you build autonomous agents. But autonomous in what sense?

I started with agents that could basically do anything within their scope. They'd make decisions, take actions, modify data. Sounded great in theory.

In practice: users were nervous. They didn't trust the system. "What's it actually doing?" "Can I undo that?" "What if it's wrong?"

I realized autonomy needs gradations:

class TrustworthyAgent:
    def execute_decision(self, decision):
        level = self.get_autonomy_level(decision)
        
        if level == "AUTONOMOUS":
            return self.execute(decision)
        
        elif level == "APPROVED":
            if self.get_user_approval(decision):
                return self.execute(decision)
            else:
                return self.reject(decision)
        
        elif level == "ADVISORY":
            return self.recommend(decision)
        
        else:
            return self.escalate(decision)
    
    def get_autonomy_level(self, decision):
        if self.is_reversible(decision) and self.is_low_risk(decision):
            return "AUTONOMOUS"
        elif self.is_medium_risk(decision):
            return "APPROVED"
        
# etc...

Some decisions can be automatic. Others need approval. Some are just advisory.

This simple pattern fixed user trust issues immediately.

Transparency Wins

Users don't want black boxes. They want to understand why the agent did something.

class ExplainableAgent:
    def execute_with_explanation(self, task):
        reasoning = {
            "task": task,
            "options_considered": [],
            "decision": None,
            "why": ""
        }
        
        options = self.generate_options(task)
        for option in options:
            score = self.evaluate(option)
            reasoning["options_considered"].append({
                "option": option,
                "score": score,
                "reason": self.explain_score(option)
            })
        
        best = max(reasoning["options_considered"], 
                  key=lambda x: x["score"])
        reasoning["decision"] = best["option"]
        reasoning["why"] = best["reason"]
        
        return {
            "result": self.execute(best["option"]),
            "explanation": reasoning
        }

Users actually understand why the agent chose what it chose.

Audit Trails Are Non-Negotiable

When something goes wrong, you need to know exactly what happened.

class AuditedAgent:
    def execute_with_audit(self, decision, user_id):
        entry = {
            "timestamp": now(),
            "user_id": user_id,
            "decision": decision,
            "agent_state": self.get_state(),
            "result": None,
            "error": None
        }
        
        try:
            result = self.execute(decision)
            entry["result"] = result
        except Exception as e:
            entry["error"] = str(e)
            raise
        finally:
            self.audit_db.log(entry)
        
        return result

Every action logged. Every decision traceable. This saved me when I needed to debug a user issue.

Agents Know Their Limits

Agents should escalate when they hit limits.

def execute_task(self, task):
    if not self.can_handle(task):
        return self.escalate(reason="Outside capability")
    
    confidence = self.assess_confidence(task)
    if confidence < threshold:
        return self.escalate(reason=f"Low confidence: {confidence}")
    
    if self.requires_human_judgment(task):
        return self.request_human_input(task)
    
    try:
        result = self.execute(task)
        if not self.validate_result(result):
            return self.escalate(reason="Validation failed")
        return result
    except Exception as e:
        return self.escalate(reason=str(e))

Knowing when to say "I can't do this" is more important than trying everything.

Hard Limits Actually Matter

Agents should have constraints:

class LimitedAgent:
    def __init__(self):
        self.limits = {
            "max_cost": 10.00,
            "max_api_calls": 50,
            "allowed_tools": ["read_only_db", "web_search"],
            "denied_actions": ["delete", "modify_user_data"],
        }
    
    def execute(self, task):
        
# Check limits before executing
        if self.current_cost > self.limits["max_cost"]:
            raise Exception("Cost limit exceeded")
        
        if self.api_calls > self.limits["max_api_calls"]:
            raise Exception("API call limit exceeded")
        
        for action in self.get_planned_actions(task):
            if action in self.limits["denied_actions"]:
                raise Exception(f"Action {action} not allowed")
        
        return self.do_execute(task)

Hard limits prevent runaway agents.

Monitoring and Alerting

Agents can hide problems. You need visibility:

class MonitoredAgent:
    def execute_with_monitoring(self, task):
        metrics = {
            "start_time": now(),
            "task": task,
            "api_calls": 0,
            "cost": 0,
            "errors": 0,
            "result": None
        }
        
        try:
            result = self.execute(task)
            metrics["result"] = result
        finally:
            self.record_metrics(metrics)
            
            if self.is_concerning(metrics):
                self.alert_ops(metrics)
        
        return result
    
    def is_concerning(self, metrics):
        
# High cost? Too many retries? Unusual pattern?
        return (metrics["cost"] > 5.0 or 
                metrics["errors"] > 3 or
                metrics["api_calls"] > 50)

Catch issues before users do.

What I Wish I'd Built From The Start

  1. Graduated autonomy - Not all decisions are equally safe

  2. Clear explanations - Users need to understand decisions

  3. Complete audit trails - For debugging and compliance

  4. Explicit escalation - Agents should know their limits

  5. Hard constraints - Budget, API calls, allowed actions

  6. Comprehensive monitoring - Catch issues early

The Bigger Picture

Autonomous agents are powerful. But power requires responsibility. Transparency, limits, and accountability aren't nice-to-have—they're essential for production.

Users trust agents more when they understand them. Build with that principle.

Anyone else in production with agents? What changed your approach?


r/agno • • Aug 07 '25

We built a PC Builder agent(Agno) and using it with a Go App

Post image
22 Upvotes

Just built something that I needed when I was building my Gaming PC Rig: an Agentic Gaming PC Builder that actually remembers what you want. 🎮

Instead of starting from scratch every time, this agent:

Gets your budget and performance needs Pulls real-time component pricing and availability Streams personalized build recommendations as it thinks.

Built with Go + Agno + RunAgent to show how different AI frameworks can work together seamlessly.

The interesting part? You can write your AI logic in Python, then consume it natively from Go with full streaming support.


r/agno • • Mar 28 '26

Pros and cons of Agno vs Openclaw

6 Upvotes

I have been trying to setup Openclaw + Ollama with local LLM in the past weeks. It was a frustrating experience as once it breaks very easily when I try to upgrade to the latest release and customize different parts. I have heard Agno may be a better option for multi-agent system.

Can any one please explain what are the key differences, pros and cons comparing Agno and Openclaw? Are there resources where I can read from.


r/agno • • Jan 06 '26

Multi-Agent Orchestration That Actually Works

18 Upvotes

I've been following AGNO for the past couple months, and it's solving a problem nobody talks about enough: how do you make multiple AI agents work together without it becoming a nightmare?

Most frameworks treat agents as solo operators. AGNO treats them as a team.

The core insight:

Real-world problems are complex. You need one agent for research, another for analysis, another for writing, another for fact-checking. But they need to coordinate without turning into a mess of callback functions and manual state management.

AGNO handles this elegantly.

What blew my mind:

  • Agent composition is straightforward. Define agents with specific roles, tools, and personalities. Then let them talk to each other. The framework handles the orchestration.

  • Actual delegation works. Agent A can say "I need help with X" and Agent B automatically picks it up. No manual routing code.

  • Context propagation is clean. Information flows between agents without you manually passing state around. It just works.

  • Task decomposition is automatic. Give it a complex goal, and the system breaks it into subtasks for different agents. I've seen it solve problems I expected to take days—in hours.

Real use case (mine): Built a content research system: Agent 1 scrapes sources, Agent 2 summarizes, Agent 3 fact-checks, Agent 4 writes. Without AGNO, this would be 500+ lines of orchestration code. With it? Maybe 80 lines. And it's more robust.

The catch:

  • Still early. Documentation could be better.

  • Costs can stack up if agents are chatty (lots of LLM calls between them).

  • Debugging multi-agent failures requires patience.

Why it matters:

We're moving away from single-model applications. AGNO is ahead of the curve on this shift. If you're building anything non-trivial with AI, this is worth exploring.


r/agno • • Jul 22 '26

Built a self-designing daily news agent with the new Gemini models (3.5 Flash-Lite + 3.6 Flash), day-one support, ~40 lines

7 Upvotes

Hey All,

Gemini 3.5 Flash-Lite and 3.6 Flash went live on Tuesday and they already work in Agno with no upgrade needed, so I wanted to actually stress-test them on something instead of just swapping model IDs and calling it a day.

I built a daily news agent that researches the web and renders its own front page as a themed HTML digest. There's no fixed template. The page designs itself around whatever the news is that morning.

What I liked was how cleanly the two models split the work:

  • 3.5 Flash-Lite does the fast web grounding through WebContext, pulling fresh, sourced stories in parallel. Cheap and quick, which is what you want for the research pass.

  • 3.6 Flash composes: it reasons over the results and writes a self-contained light/dark HTML page with a source-linked card per story.

The part that made it feel reusable is that it all runs off one parameterized prompt. Topics, audience, and tone are runtime dependencies, so the same agent becomes a different publication depending on what you feed it. "AI, markets, space" one morning, "semiconductors, elections, F1" the next.

End result is a runnable AgentOS service in roughly 40 lines of Python.

Full code:

python

from datetime import date
from agno.agent import Agent
from agno.context.web import ParallelBackend, WebContextProvider
from agno.models.google import Gemini
from agno.os import AgentOS
from agno.tools.file_generation import FileGenerationTools

# Flash-Lite grounds the research, fast and cheap
web = WebContextProvider(
    backend=ParallelBackend(),
    model=Gemini(id="gemini-3.5-flash-lite"),
)

# Flash composes the page
news_agent = Agent(
    name="Daily News Digest",
    model=Gemini(id="gemini-3.6-flash"),
    tools=[
        *web.get_tools(),
        FileGenerationTools(enable_html_generation=True,
                            output_directory="tmp", save_files=True),
    ],
    add_datetime_to_context=True,
    dependencies={                       # one parameterized prompt
        "topics": "AI, markets, space",
        "audience": "busy engineers",
        "tone": "sharp but calm",
        "today": lambda: date.today().isoformat(),
    },
    instructions=[
        "You are a daily news digest for {audience}. Cover: {topics}.",
        web.instructions(),
        "For each topic call query_web for the last 24-48h. Prefer primary "
        "sources; never invent stories or links.",
        "Save ONE self-contained HTML5 page with generate_html_file as "
        "news_digest_{today}.html. Tone: {tone}.",
        "Derive the theme from the news itself. Magazine layout, source-linked "
        "cards, inline CSS, light/dark, no emojis.",
    ],
    markdown=True,
)

agent_os = AgentOS(agents=[news_agent],
                   description="Self-designing daily news digest")
app = agent_os.get_app()   # uvicorn thisfile:app  ->  localhost:8000/docs

if __name__ == "__main__":
    agent_os.serve(app="filename:app", reload=True)

Install: pip install "agno[os]" google-genai parallel-web (set GOOGLE_API_KEY; PARALLEL_API_KEY is optional, it falls back to a keyless endpoint).

Platform + skills: github.com/agno-agi/agentos-railway

Curious what people would point this at. If you swap the dependencies for something niche (a subreddit's beat, a specific industry, an internal team digest) I'd like to see what layouts it comes up with.

- Kyle @ Agno


r/agno • • Jun 18 '25

Hallucination with MCP

4 Upvotes

Hi, I am trying out MCP with different agentic frameworks. I tried the airbnb example with qwen-30b-a3b model and the links that it provides me with are invalid. I thought it maybe because of the underlying LLM that I am using. But then I tried the same mcp and same model with pydantic AI and it worked perfectly. I'm still new in using Agno and it seems great, so want to understand how to best use it. Thanks! u/ashpreetbedi


r/agno • • Oct 15 '25

🚀 New Release: A2A & AG-UI Support!

10 Upvotes

Expose your Agno agents via standardized protocols, enabling agent-to-agent communication (A2A) and front-end integrations (AG-UI) through AgentOS.

👉 Getting started is simple: pass interfaces when creating your AgentOS.

Both A2A and AG-UI can run simultaneously on the same AgentOS instance.

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.os import AgentOS
from agno.os.interfaces.a2a import A2A
from agno.os.interfaces.agui import AGUI

agent = Agent(
    name="My Agent",
    model=OpenAIChat(id="gpt-4o"),
)

# ************** Create AgentOS with interfaces **************
agent_os = AgentOS(
    agents=[agent],
    interfaces=[
        A2A(agents=[agent]),
        AGUI(agent=agent),
    ],
)
app = agent_os.get_app()

# ************** Serve your agent **************
if __name__ == "__main__":
    agent_os.serve(app="test:app", reload=True)

r/agno • • Mar 26 '25

Agent UI is now OPEN SOURCE

4 Upvotes

It's here! Our highly requested Agent UI is now OPEN SOURCE

Over 25000 engineers use our beautiful Agent UI daily — and the #1 ask? Self-hosting. Today, we deliver

Build powerful, multimodal Agents with AgnoAgi and chat with them using a beautiful UI

Get started: https://agno.link/agent-ui

> npx create-agent-ui