<?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: Xomebel Flora</title>
    <description>The latest articles on DEV Community by Xomebel Flora (@xomebel).</description>
    <link>https://dev.to/xomebel</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4200256%2F4bc5cba9-2072-4bb8-842c-2b6cf08593d0.png</url>
      <title>DEV Community: Xomebel Flora</title>
      <link>https://dev.to/xomebel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xomebel"/>
    <language>en</language>
    <item>
      <title>A Zero-Dependency Tracing CLI for AI Agents in Python</title>
      <dc:creator>Xomebel Flora</dc:creator>
      <pubDate>Thu, 22 Oct 2026 10:41:04 +0000</pubDate>
      <link>https://dev.to/xomebel/how-i-built-a-zero-dependency-tracing-cli-for-ai-agents-in-python-nlc</link>
      <guid>https://dev.to/xomebel/how-i-built-a-zero-dependency-tracing-cli-for-ai-agents-in-python-nlc</guid>
      <description>&lt;h1&gt;
  
  
  Zero-Dependency Tracing CLI for AI Agents in Python (&lt;code&gt;severn-trace&lt;/code&gt;)
&lt;/h1&gt;

&lt;p&gt;If you've ever built an autonomous AI agent using LangChain, CrewAI, or AutoGen, you know the absolute chaos of debugging execution loops.&lt;/p&gt;

&lt;p&gt;Your agent calls a tool, the tool throws a malformed JSON payload, the loop breaks, and you're left staring at a wall of unstructured stack traces. If you try to fix this by installing heavy APM tools, you spend 20 minutes configuring API keys, setting up cloud endpoints, and wrestling with third-party dependency conflicts.&lt;/p&gt;

&lt;p&gt;When you're building fast—especially during a hackathon—you don't need cloud dashboard bloat. &lt;strong&gt;You need instant, local feedback.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That’s why &lt;strong&gt;&lt;code&gt;severn-trace&lt;/code&gt;&lt;/strong&gt;, an ultra-lightweight, zero-dependency Python tracing runtime and interactive terminal CLI. Here is how it works and how it simplifies agent debugging.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Philosophy: Pure Standard Library &amp;amp; Zero Friction
&lt;/h2&gt;

&lt;p&gt;Most monitoring tools force you to bring your own baggage: database connections, external collector middleware, or complex YAML configuration files.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;severn-trace&lt;/code&gt; takes the opposite approach. It relies &lt;strong&gt;strictly on the Python standard library&lt;/strong&gt; (&lt;code&gt;json&lt;/code&gt;, &lt;code&gt;time&lt;/code&gt;, &lt;code&gt;functools&lt;/code&gt;, &lt;code&gt;os&lt;/code&gt;). That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero dependency conflicts&lt;/strong&gt; with fast-moving LLM libraries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant setup&lt;/strong&gt; via a single shell command.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A local fallback ledger (&lt;code&gt;severn_traces.jsonl&lt;/code&gt;)&lt;/strong&gt; that stores your agent telemetry securely on your machine.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Building an Agent Step Decorator in 30 Seconds
&lt;/h2&gt;

&lt;p&gt;To start tracing any agent tool call or critical function, you don't need to rewrite your agent logic. You just import the &lt;code&gt;trace&lt;/code&gt; decorator:&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;severn&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;trace&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;

&lt;span class="nd"&gt;@trace&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;autonomous_search_agent&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="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Simulate an agent tool lookup
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ConnectionError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;API rate limit exceeded during tool execution.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Successfully retrieved context for: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__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;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nf"&gt;autonomous_search_agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Query vector #&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Caught agent exception: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every single time that function runs, &lt;code&gt;severn-trace&lt;/code&gt; automatically captures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Execution duration (timing metrics)&lt;/li&gt;
&lt;li&gt;Success vs. failure status (&lt;code&gt;SUCCESS&lt;/code&gt; or &lt;code&gt;FAILED&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Detailed error exceptions and arguments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...and appends them straight to your local &lt;code&gt;severn_traces.jsonl&lt;/code&gt; file.&lt;/p&gt;




&lt;h2&gt;
  
  
  Meet the Interactive CLI (&lt;code&gt;severn&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Instead of making you dig through raw JSON log files, &lt;code&gt;severn-trace&lt;/code&gt; comes with a built-in cyberpunk interactive terminal dashboard.&lt;/p&gt;

&lt;p&gt;Once you install it globally via &lt;code&gt;pipx&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pipx &lt;span class="nb"&gt;install &lt;/span&gt;severn-trace

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can run the global command from anywhere on your machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;severn

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This launches an interactive menu where you can:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Verify active runtime status&lt;/strong&gt; across your project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;View your local telemetry database&lt;/strong&gt; (&lt;code&gt;severn_traces.jsonl&lt;/code&gt;) directly in the terminal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explore multi-step agent topologies&lt;/strong&gt; tailored for CrewAI, LangChain, and AutoGen architectures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Access community support and hackathon portals&lt;/strong&gt; (like Lablab.ai).&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Wrap-Up &amp;amp; Try It Out
&lt;/h2&gt;

&lt;p&gt;If you're tired of heavyweight monitoring tools slowing down your local development or hackathon builds, give &lt;code&gt;severn-trace&lt;/code&gt; a spin.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PyPI Package:&lt;/strong&gt; &lt;code&gt;pip install severn-trace&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://www.google.com/search?q=https://github.com/davidamadie06/severn-trace" rel="noopener noreferrer"&gt;github.com/davidamadie06/severn-trace&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Community Discord:&lt;/strong&gt; Connect via &lt;strong&gt;@severnteam&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Drop a star on GitHub if you find it helpful for your agent projects, and let me know how you're using it in your builds! ⚡&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>tutorial</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
