<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hugo</title>
    <description>The latest articles on DEV Community by Hugo (@hugoapolinario).</description>
    <link>https://dev.to/hugoapolinario</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3904100%2Fa874bca5-c618-4a1d-8bca-5eab026541a4.png</url>
      <title>DEV Community: Hugo</title>
      <link>https://dev.to/hugoapolinario</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hugoapolinario"/>
    <language>en</language>
    <item>
      <title>I built Farol — AI agent observability in one decorator (open source)</title>
      <dc:creator>Hugo</dc:creator>
      <pubDate>Wed, 29 Apr 2026 10:44:09 +0000</pubDate>
      <link>https://dev.to/hugoapolinario/i-built-farol-ai-agent-observability-in-one-decorator-open-source-2l0g</link>
      <guid>https://dev.to/hugoapolinario/i-built-farol-ai-agent-observability-in-one-decorator-open-source-2l0g</guid>
      <description>&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;br&gt;
I kept finding out my AI agents broke from user complaints — not from my own monitoring.&lt;br&gt;
An agent would run 47 times overnight. Three failed. Costs spiked 3×. I found out the next morning from a user ticket.&lt;br&gt;
Every existing tool was either enterprise-grade overkill (Datadog, New Relic) or required complex setup (Langfuse, Helicone). Nothing was built for a solo dev who just wants to know when something goes wrong.&lt;br&gt;
So I built Farol.&lt;br&gt;
One decorator. That's it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;farol&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;trace&lt;/span&gt;

&lt;span class="nd"&gt;@trace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;agent_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;my-agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;farol_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;frl_...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;my_agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;topic&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;
    &lt;span class="c1"&gt;# your agent code here
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all you need to get started. Farol tracks everything automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you get&lt;/strong&gt;&lt;br&gt;
Cost anomaly detection — Farol learns what's normal for each agent and alerts you when a run costs 3× more than usual. Before your cloud bill does.&lt;br&gt;
Full trace inspector — Every tool call, LLM call, duration, tokens, and error reconstructed end to end. Click any run and see exactly what happened at each step.&lt;br&gt;
Agent Health Score — One number (0-100) combining success rate, cost efficiency, quality, and latency. Changes week over week so you know if things are getting better or worse.&lt;br&gt;
Quality scoring — Rate outputs thumbs up or down. Farol tracks quality trends and alerts you when it degrades — catches prompt regressions before your users do.&lt;br&gt;
Proactive trend alerts — Fires when your agent is trending slower or more expensive, even when nothing has technically broken yet.&lt;br&gt;
Weekly digest email — Every Monday, a summary of your agents' health, cost, and quality. Green means sleep. Red means act.&lt;br&gt;
Multi-agent trace linking — Pass parent_trace_id to link child agent runs to their parent. See total pipeline cost across the entire chain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Works with any framework&lt;/strong&gt;&lt;br&gt;
LangChain, CrewAI, Vercel AI SDK, or raw Anthropic/OpenAI calls. If it's a Python or Node.js function, &lt;a class="mentioned-user" href="https://dev.to/trace"&gt;@trace&lt;/a&gt; wraps it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# LangChain
&lt;/span&gt;
&lt;span class="nd"&gt;@trace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;agent_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;langchain-agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;farol_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;frl_...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run_chain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;topic&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;span&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;chain_invoke&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;chain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;invoke&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;query&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open source SDK&lt;br&gt;
The SDK is MIT licensed and published on PyPI and npm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;farol-sdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or for Node.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @usefarol/sdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The hosted dashboard (where alerts fire, data lives) is the paid part. Free tier available — 1 agent, 50k events/month, no credit card required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned building it&lt;/strong&gt;&lt;br&gt;
The hardest part wasn't the monitoring itself — it was the statistical baseline detection. A naive "alert when cost exceeds X" creates too many false positives. Farol uses a rolling median + standard deviation baseline that requires 10+ successful runs before firing. This means no noise in the first few days, and reliable signals after.&lt;br&gt;
The other insight: proactive alerts matter more than reactive ones. Most monitoring tools tell you when something breaks. Farol also tells you when things are trending in the wrong direction — before they break. That's the Day 30 retention feature.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Live demo (no signup): usefarol.dev/demo&lt;br&gt;
Docs: usefarol.dev/docs&lt;br&gt;
GitHub: github.com/hugoapolinario/farol&lt;/p&gt;

&lt;p&gt;Would love feedback — what's missing? What would you add?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
