<?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: mkash25</title>
    <description>The latest articles on DEV Community by mkash25 (@mkash25).</description>
    <link>https://dev.to/mkash25</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3813579%2F06e03dbe-84d5-451e-ad43-533cd3866546.webp</url>
      <title>DEV Community: mkash25</title>
      <link>https://dev.to/mkash25</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mkash25"/>
    <language>en</language>
    <item>
      <title>Atrium, part two: turning my agentic support tool into a product other engineers use</title>
      <dc:creator>mkash25</dc:creator>
      <pubDate>Mon, 23 Nov 2026 20:34:32 +0000</pubDate>
      <link>https://dev.to/mkash25/atrium-part-two-turning-my-agentic-support-tool-into-a-product-other-engineers-use-4j7j</link>
      <guid>https://dev.to/mkash25/atrium-part-two-turning-my-agentic-support-tool-into-a-product-other-engineers-use-4j7j</guid>
      <description>&lt;p&gt;&lt;em&gt;I'm Mayank, an engineer at Snowflake supporting security and connectivity. Atrium started as a tool for my own support casework, and around ten of my colleagues now use it. It's internal, so this post has no code and no company specifics: it's an architecture-level tour of what Atrium became since my first post, and what it took to turn a personal tool into a product.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;In my first post, Atrium was a reviewer: a web app beside my coding agent that framed a case going in and challenged the agent's work coming out. &lt;/p&gt;

&lt;p&gt;Here's what it currently looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8tv4qib7xh65qv5511we.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8tv4qib7xh65qv5511we.jpg" alt="Atrium setup in cmux (Dummy data)" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Custom cmux sidebar:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fix03czdeq6dvipcki9cz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fix03czdeq6dvipcki9cz.jpg" alt=" " width="300" height="870"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It worked, for one user. Since then it has grown into an agentic cockpit for a support engineer's whole day, used by around ten engineers who signed up to try something new.&lt;/p&gt;

&lt;p&gt;The second part turned out to be the harder engineering problem. Building features with agents is fast. Building something other people trust enough to open every morning is not. This post covers both: what Atrium does now, and what I learned getting it from "works on my machine" to a product.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────────────────────────────────────────────────────────────────────┐
  CRM (read-only feed) ──►│ Atrium  (Python + Tornado, runs on the laptop) │◄──► Slack
                          │                                                │     (validation requests)
                          │  1. Queue        lanes follow CRM status       │
                          │  2. Deadlines    every clock, NEXT bar         │
                          │  3. Proactive    prep before you arrive        │
                          │  4. Session map  one agent session per case    │
                          │  5. Review       Verifier + investigation audit│◄──► Reviewer model
                          │  6. Reply        refine, approve, send         │     (different LLM family)
                          │  7. Validations  Pass 1 + Pass 2               │
                          └───┬──────────────▲───────────────┬─────────────┘
              opens / focuses │              │ hooks, events │ two-stage prep
              forks / resumes ▼              │ session graph ▼ (laptop closed)
          ┌───────────────────────────────────┴──┐    ┌──────────────────────────┐
          │ Host: Cortex Code Desktop  or  cmux  │    │ Snowflake                │
          │  ┌────────────┐ ┌────────────┐       │    │  SQL builds a packet ──► │
          │  │ case A     │ │ case B     │  ...  │    │  agent with NO tools     │
          │  │ agent      │ │ locked prep│       │    │  writes the prep         │
          │  └────────────┘ └────────────┘       │    └──────────────────────────┘
          │  Desktop: extension + browser tab    │
          │  cmux: workspace per case + sidebar  │
          └──────────────────────────────────────┘

  Rule: agents propose, Atrium acts, the human decides.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three things matter in this picture. Atrium sits between every agent and every outside system, so agents can be as autonomous as they like without anything reaching a customer unreviewed. Agents now run in two places: sessions on the laptop, one per case, and a prep agent in Snowflake that works while the laptop is closed. And the host is swappable: the same Atrium drives Cortex Code Desktop or cmux.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it grew&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI agents changed the bottleneck in support. An agent can work through an investigation that used to take hours, and it'll happily run several at once. The engineer doesn't speed up at the same rate, and the engineer doesn't have one case: they have a queue. Each case has its own deadline, its own thread and its own agent session.&lt;/p&gt;

&lt;p&gt;So the slow part of the day stopped being "check this answer" and became "which of these twenty cases needs me next, and is its agent already on it?" I'm all-in on agents doing more of the work. Atrium's job is to make sure the human can run a fleet of them without dropping anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Atrium does now&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The queue follows the source of truth.&lt;/strong&gt; Lanes come straight from each case's status in our CRM. Anything Atrium infers (a stale status, a closure request, an SLA at risk) is a flag, never a move. An early version tried to be clever about where cases belonged, and engineers stopped trusting it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every deadline, at a glance.&lt;/strong&gt; Each case carries its tightest clock: first response, next response, a promise made, a follow-up. A &lt;strong&gt;NEXT&lt;/strong&gt; bar shows the next deadline across the whole queue and the four hours after it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prep before you arrive.&lt;/strong&gt; When a customer replies, a deadline approaches or a case is assigned, a locked-down agent investigates and leaves a prep and a draft.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One agent session per case.&lt;/strong&gt; Start, resume, focus or close it from the case's row. In cmux, each case gets its own workspace.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review that checks the path, not just the answer.&lt;/strong&gt; The Verifier still runs on a model from a different family. The investigation audit now reads a &lt;strong&gt;session graph&lt;/strong&gt; the agent records as it works and checks it against the real tool results. Every challenge is rated, so we can see whether it changed a draft.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reply, approve, send.&lt;/strong&gt; An approved reply and its status change go out through the CRM's own integration, from inside Atrium.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validating another AI's work.&lt;/strong&gt; Our support org runs an AI assistant that asks humans to approve its replies. &lt;strong&gt;Pass 1&lt;/strong&gt; reads the assistant's run and flags claims on weak evidence; &lt;strong&gt;Pass 2&lt;/strong&gt; carries out what it asked a human for and writes the guidance to send back.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Proactive prep: fork, don't restart&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How the prep session starts matters more than its prompt.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It forks the case's own session,&lt;/strong&gt; inheriting every earlier query, the customer's history and the reasoning so far. A fresh session would rediscover all of it, slower and less accurately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The fork is locked; the original isn't touched.&lt;/strong&gt; Write tools are removed from the fork only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Take over is one click.&lt;/strong&gt; The locked session stops and the same conversation resumes with every tool restored, in the same tab. One lesson: tell the model the restriction is lifted. Models trust their own history, and otherwise assume they still can't act.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Engineering for autonomous agents&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A tool you didn't attach can't be misused.&lt;/strong&gt; Telling a model which tools to use is a request, not a boundary: in testing, it used others anyway. Proactive sessions launch without write tools, and the server-side prep agent has none at all, checked before every run, failing closed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Know what your host lets a process do.&lt;/strong&gt; A cmux pane can read and type into its neighbours, so preps there get no shell, and every command Atrium sends to cmux passes an argument-checking allow-list.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost is cache writes, not prompt length.&lt;/strong&gt; Measuring the server-side prep showed that tool calls pulling large results into context drove the bill. The fix: a plain SQL step builds a compact packet, and one call to an agent with no tools writes the prep. That's a small fraction of what a general-purpose coding agent spent on the same job, and every run stores its packet, so you see exactly what the agent saw.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two hosts, one capability table.&lt;/strong&gt; On Cortex Code Desktop, a small extension opens a terminal per case and Atrium lives in the built-in browser: the easiest rollout. On cmux, every case gets a workspace grouped by lane, with deadline pills and a context meter, and a &lt;strong&gt;custom cmux sidebar&lt;/strong&gt; I wrote shows what needs you, drafts ready, agents at work and parked cases, with its own NEXT banner. It's the better home for agentic work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session mapping that survives real life.&lt;/strong&gt; Different launchers, case folders at different depths, folders that move mid-session, reused terminals: Atrium combines the host's terminal map, a session hook and the cmux workspace tree to keep every case tied to the right session.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A session graph, borrowed with gratitude.&lt;/strong&gt; The agent records its questions, actions, evidence, findings and results as it works, so a reviewer reads &lt;em&gt;why&lt;/em&gt; it concluded something. The model comes from our &lt;strong&gt;CXE team&lt;/strong&gt;, and Atrium keeps their format, so a graph could move to their service unchanged. Their assistant's audit trail is also what makes Pass 1 and Pass 2 possible.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;From tool to product&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the part I underestimated. Building Atrium for myself took evenings. Making it work for other people took everything else.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adoption took a hit, and that taught me the most&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Atrium isn't for everyone, and the beta made that clear fast. Adoption dipped for reasons that had little to do with what the agents could do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Too much on screen.&lt;/strong&gt; I'd built a cockpit for someone who lives in the queue all day. Many engineers wanted one clear view, not panels, tabs and flags all at once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expectations didn't match.&lt;/strong&gt; Some people expected a simple helper and found a full agentic workspace. When you don't understand a tool, it feels like work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sign-in trouble.&lt;/strong&gt; Expired logins, a sign-in tab left open overnight, a network blip reported as "login expired". Each one cost trust it took weeks to earn back.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plumbing underneath.&lt;/strong&gt; A change in an upstream data source meant deadlines were read wrongly until a recent fix. For a tool whose core promise is "you won't miss a deadline", that hurt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Early bugs.&lt;/strong&gt; A date that was off, a "sent" notice for something that wasn't sent, a prep that kept reopening. Small on their own. Together, enough for someone to uninstall.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What I'm learning about marketing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It turns out a product needs marketing even when every user is a colleague down the hall. That's a skill I'm still building:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Progressive disclosure.&lt;/strong&gt; The default view should answer one question: what needs me next. Everything else is there when you go looking, not in your face on day one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Show, don't tell.&lt;/strong&gt; A two-minute walkthrough beats a page of release notes. Release notes are written for users now, not for me.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Know the audience.&lt;/strong&gt; I built for my own workflow. The engineers I'm building for have their own, and they're the ones who decide whether Atrium earns a place on their screen.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What turned a tool into a product&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Real releases.&lt;/strong&gt; Versioned releases that engineers update to with one command, which roll back on their own if a new version doesn't start. Every change runs in a separate sandbox copy first, then goes through a pull request: protected main, CI on every change, and well over a thousand tests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Works for everyone.&lt;/strong&gt; Atrium has to run on anyone's Mac with only what its dependency list says. That means no personal paths, launchers or hooks, settings in one place, and a test that fails if a personal value slips into the code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measuring value.&lt;/strong&gt; Review challenges are rated and their effect on drafts is recorded, so whether Atrium actually helps is a question we can answer with data, not anecdotes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A quality bar.&lt;/strong&gt; The next release is about smoothness over features. Every core journey has to run end to end, on both hosts, with no surprises, before anything new ships.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Building it alone, alongside the day job&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I still build Atrium by delegating tasks to autonomous agents. My job is the architecture, the review standards and what gets built next. But it's a team of one next to a full-time support role, and that's the honest hard part: switching from a customer escalation to a refactor and back, losing an evening to a flaky integration, and knowing every rough edge lands on colleagues who are as busy as I am. Agents make the building fast. They don't make the context switching free.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Standing on others' shoulders&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A colleague built the &lt;strong&gt;first version of proactive investigations and a faster data feed&lt;/strong&gt;. Those ideas are the backbone of Atrium's prep.&lt;/li&gt;
&lt;li&gt;Another colleague showed me the &lt;strong&gt;route for sending replies and switching case status through the CRM's own integration&lt;/strong&gt;, which turned "copy this into the CRM" into a reviewed, one-click step.&lt;/li&gt;
&lt;li&gt;Our &lt;strong&gt;CXE team's&lt;/strong&gt; assistant, audit trail and session-graph model made process validation and the session graph possible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The beta testers&lt;/strong&gt;, who told us the truth, including the parts that stung.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What's next&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Partnerships&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The biggest next step isn't a feature. Other engineers are building their own tools for the same problems, and we'd rather build with them than beside them: shared patterns for guardrails, verification and session handling, so the next engineer who takes this on starts further ahead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;A simpler front door&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The NEXT bar is the first piece of a simpler default view: one answer to "what needs me now", across the whole queue, in Atrium and in the cmux sidebar alike. The rest of the cockpit stays one click away.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Takeaways&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Building it is the easy half.&lt;/strong&gt; Agents make features fast. Trust, onboarding and plumbing decide whether anyone uses them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not everyone wants a cockpit.&lt;/strong&gt; Lead with one clear answer and let people discover the rest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Go all-in on agents, and engineer for it.&lt;/strong&gt; A removed tool is a boundary; an instruction is a request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fork, don't restart.&lt;/strong&gt; A prep that inherits the case's session starts where you left off.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure cost before optimising it.&lt;/strong&gt; For us, cache writes mattered more than prompt length.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat colleagues like customers.&lt;/strong&gt; Releases, release notes, a quality bar and real feedback loops are what make a tool a product.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're turning your own tool into something your team uses, I'd love to hear what tripped you up. Tell me in the comments.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>python</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Support engineering in 2026 is done differently. Learn how I'm doing it at Snowflake.</title>
      <dc:creator>mkash25</dc:creator>
      <pubDate>Tue, 20 Oct 2026 04:54:32 +0000</pubDate>
      <link>https://dev.to/mkash25/support-engineering-in-2026-is-done-differently-learn-how-im-doing-it-at-snowflake-bf6</link>
      <guid>https://dev.to/mkash25/support-engineering-in-2026-is-done-differently-learn-how-im-doing-it-at-snowflake-bf6</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/mkash25/atrium-a-tour-of-the-ai-investigation-platform-i-run-beside-my-coding-agent-351g" class="crayons-story__hidden-navigation-link"&gt;Atrium: a tour of the AI investigation platform I run beside Snowflake CoCo&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/mkash25" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3813579%2F06e03dbe-84d5-451e-ad43-533cd3866546.webp" alt="mkash25 profile" class="crayons-avatar__image" width="700" height="386"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/mkash25" class="crayons-story__secondary fw-medium m:hidden"&gt;
              mkash25
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                mkash25
                
                
              
              &lt;div id="story-author-preview-content-4799183" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/mkash25" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3813579%2F06e03dbe-84d5-451e-ad43-533cd3866546.webp" class="crayons-avatar__image" alt="" width="700" height="386"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;mkash25&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/mkash25/atrium-a-tour-of-the-ai-investigation-platform-i-run-beside-my-coding-agent-351g" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Oct 5&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/mkash25/atrium-a-tour-of-the-ai-investigation-platform-i-run-beside-my-coding-agent-351g" id="article-link-4799183"&gt;
          Atrium: a tour of the AI investigation platform I run beside Snowflake CoCo
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/llm"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;llm&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/python"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;python&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/agents"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;agents&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/mkash25/atrium-a-tour-of-the-ai-investigation-platform-i-run-beside-my-coding-agent-351g" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;2&lt;span class="hidden s:inline"&gt;&amp;nbsp;reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/mkash25/atrium-a-tour-of-the-ai-investigation-platform-i-run-beside-my-coding-agent-351g#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              2&lt;span class="hidden s:inline"&gt;&amp;nbsp;comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            9 min read
          &lt;/small&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>agents</category>
      <category>ai</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Atrium: a tour of the AI investigation platform I run beside Snowflake CoCo</title>
      <dc:creator>mkash25</dc:creator>
      <pubDate>Mon, 05 Oct 2026 04:47:36 +0000</pubDate>
      <link>https://dev.to/mkash25/atrium-a-tour-of-the-ai-investigation-platform-i-run-beside-my-coding-agent-351g</link>
      <guid>https://dev.to/mkash25/atrium-a-tour-of-the-ai-investigation-platform-i-run-beside-my-coding-agent-351g</guid>
      <description>&lt;p&gt;&lt;em&gt;I'm Mayank, an engineer at Snowflake supporting security and connectivity. Atrium is a tool I built for my own support casework. It's internal, so this post has no code and no company specifics: it's an architecture-level tour of how it works and why it's shaped the way it is.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Most AI coding agents are good at investigating. Point one at a problem and it will query data, read logs, and write up an answer faster than I can open the right tabs. What they're not good at is proving their work. In support, a confident answer with a gap in it is worse than a slow answer, because it reaches a customer.&lt;/p&gt;

&lt;p&gt;Atrium is my answer to that. It's a lightweight web app that runs right next to my coding agent's terminal session and wraps the whole life of a case: intake, SLA tracking, a structured problem statement, AI insights, an adversarial review of the agent's work by a model from a different family, and a final pass on the customer reply. The agent does the investigating. Atrium frames the work going in and challenges it coming out.&lt;/p&gt;

&lt;p&gt;Here's the tour.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  CRM mirror ──► ┌─────────────────────────────────────────┐ ◄──► Slack
                 │ Atrium  (Python + Tornado)              │      (validation work)
                 │                                         │
                 │  1. Case workspace   queue, SLA timers  │
                 │  2. AI insights      past cases, causes │
                 │  3. Problem statement                   │
                 │  4. Adversarial review  Mode 1 + Mode 2 │ ◄──► Reviewer model
                 │  5. Draft refinement    tone options    │      (different LLM family)
                 │                                         │
                 └───────┬───────────────────▲─────────────┘
                         │                   │
      versioned feedback │                   │ CLI hooks / events
      packets (as input) ▼                   │
                 ┌─────────────────────────────────────────┐
                 │ Coding agent  (Cortex Code CLI)         │
                 │ investigates the case, drafts the reply │
                 └─────────────────────────────────────────┘

  State: a personal Snowflake database      UI: browser, live over WebSockets
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things matter in this picture. First, the agent never talks to the reviewer directly: Atrium sits between them, so I decide when a review runs and what goes back. Second, everything flows through the agent's own terminal. Atrium listens to the CLI's hooks and events, and it answers by injecting feedback into the CLI the same way user input arrives.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I built it
&lt;/h2&gt;

&lt;p&gt;When an AI agent investigates a support case, its mistakes are rarely loud. They look like a claim with no query behind it, a diagnostic step it quietly skipped, or a jump from symptom to root cause that the evidence doesn't quite support. Each one reads fine on its own. That's the problem.&lt;/p&gt;

&lt;p&gt;If I have to re-verify everything the agent did by hand, the time it saved me is spent again. So the real bottleneck in AI-assisted support isn't speed, it's trust: I need to see what the agent did and why before I let its work reach a customer. Atrium is built around making that visible, and around giving the agent a second opinion it can't talk its way past.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keeping pace with AI investigations
&lt;/h2&gt;

&lt;p&gt;There's a second problem underneath the trust problem: pace. An AI agent can now work through an investigation that used to take a couple of hours to a few days. The engineer who owns the case doesn't get faster at the same rate. They still have to understand the problem, check the agent's findings, and stand behind the answer in front of a customer.&lt;/p&gt;

&lt;p&gt;That leaves two bad options. Slow the agent down to human speed, and you lose most of what it offers. Or skim its output and approve it, and you're back to confident answers with gaps in them.&lt;/p&gt;

&lt;p&gt;The third option is the one Atrium is built on: give the engineer tooling that keeps pace smartly. Each stage takes a slow part of the engineer's job and makes it fast without making it shallow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Understanding the case&lt;/strong&gt; becomes reading a structured summary instead of a ticket thread.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Checking the work&lt;/strong&gt; becomes reading a review from an independent model that has already re-run the queries and rebuilt the agent's path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Seeing the whole investigation at once&lt;/strong&gt; is the next piece, through visualization. More on that at the end.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent sets the pace. Atrium's job is to make sure the engineer can keep up with it without cutting corners.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tour: one case, start to finish
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Case workspace
&lt;/h3&gt;

&lt;p&gt;Atrium pulls cases from a mirror of our CRM, so the queue, case history, and status live in the same window as the agent session instead of in another browser tab. SLA timers are tracked per case, so I can see what's close to a deadline before I pick the next one up.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. AI insights
&lt;/h3&gt;

&lt;p&gt;Before I start digging, Atrium surfaces four kinds of insight on the case:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Similar past cases&lt;/strong&gt;, so I'm not solving something that's been solved before.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Likely root causes&lt;/strong&gt;, as a starting set of hypotheses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SLA risk flags&lt;/strong&gt;, for cases that need attention now.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Suggested next steps&lt;/strong&gt;, as a concrete place to start.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Structured problem statement
&lt;/h3&gt;

&lt;p&gt;An LLM turns the raw case into a structured summary with fixed sections:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Symptoms and error messages&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Environment and configuration&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Timeline and customer impact&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What's been tried, and current hypotheses&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Concepts&lt;/strong&gt;: a plain-language breakdown of the tech stack and jargon involved, so the summary is easy to read even when the case spans unfamiliar territory.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I've tested it in real casework, and it's detailed enough to guide an in-depth investigation without asking the coding agent a single question.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Investigation
&lt;/h3&gt;

&lt;p&gt;The investigation itself happens in the coding agent's terminal session, as usual. Atrium doesn't replace the agent or wrap it in its own chat. It listens to the CLI's hooks and events, so it knows what the agent is doing as it happens.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Adversarial review
&lt;/h3&gt;

&lt;p&gt;When the agent has a draft, I click to run the review. This is the core of Atrium, so it gets its own section below.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Draft refinement
&lt;/h3&gt;

&lt;p&gt;The customer-facing reply gets a final pass on a dedicated refinement screen. The engineer sets tone options, so the reply sounds like the person sending it rather than like a model.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Validation in Slack
&lt;/h3&gt;

&lt;p&gt;Some of our validation work happens in Slack. Atrium mirrors that work so it sits next to my casework, and runs a quick sanity check on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the structured summary matters
&lt;/h2&gt;

&lt;p&gt;Of everything in the tour, the structured problem statement looks the least impressive. It's a summary. But it's the piece that changes how fast an engineer can engage with a case, and I've seen that in three concrete ways.&lt;/p&gt;

&lt;h3&gt;
  
  
  Faster ramp-up on unfamiliar cases
&lt;/h3&gt;

&lt;p&gt;Support cases don't respect specialties. A connectivity case can turn out to depend on a part of the stack you rarely touch. The Concepts section exists for exactly this: it breaks down the technologies and jargon in the case in plain language, so ramping up means reading one section instead of opening a dozen documentation tabs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Easier to spot what's missing
&lt;/h3&gt;

&lt;p&gt;A ticket thread hides its gaps. A fixed structure exposes them. When every case is summarized into the same sections (symptoms, environment, timeline and impact, what's been tried), a thin or empty section stands out immediately. If the environment section is vague, that's the next question for the customer, and I know it before the investigation goes down the wrong path.&lt;/p&gt;

&lt;h3&gt;
  
  
  Confidence on live calls
&lt;/h3&gt;

&lt;p&gt;The hardest moment in support is a real-time engagement: a customer call where you're expected to already understand the problem. Walking in with the symptoms, environment, timeline, and current hypotheses laid out means I can lead the conversation instead of reconstructing the case while the customer waits.&lt;/p&gt;

&lt;p&gt;The summary sets the case up for the agent too: as I mentioned in the tour, it's detailed enough to guide an in-depth investigation without asking the coding agent a single question.&lt;/p&gt;

&lt;h2&gt;
  
  
  The adversarial review, in depth
&lt;/h2&gt;

&lt;p&gt;The review has three design choices that matter more than any prompt: who reviews, what they check, and how the findings get back to the agent.&lt;/p&gt;

&lt;h3&gt;
  
  
  A reviewer from a different model family
&lt;/h3&gt;

&lt;p&gt;The reviewers run on a different model from a different LLM family than the coding agent. A model asked to judge work in its own style tends to agree with it. This is documented: &lt;a href="https://arxiv.org/abs/2404.13076" rel="noopener noreferrer"&gt;Panickssery, Bowman, and Feng (NeurIPS 2024)&lt;/a&gt; found that LLM evaluators score their own outputs higher than other models' outputs even when human annotators rate them as equal. A reviewer from another family is less likely to share the agent's habits and blind spots, so it's more likely to push back where it should.&lt;/p&gt;

&lt;p&gt;The review also only runs when I click to run it. I decide when the agent's work is ready to be challenged, and every review is a deliberate step rather than background noise.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mode 1: Draft check
&lt;/h3&gt;

&lt;p&gt;Mode 1 tests the answer. It takes the customer-facing draft and cross-verifies the investigation behind it: it cross-references the case material and runs its own SQL queries, independently of the agent, to confirm or counter each point the draft makes. Where the evidence disagrees, or isn't there at all, it raises the point.&lt;/p&gt;

&lt;p&gt;The independent queries are the important part. A reviewer that only reads the agent's transcript can check reasoning but not facts. One that goes back to the data can catch a claim the agent never actually verified.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mode 2: Runtime rebuild
&lt;/h3&gt;

&lt;p&gt;Mode 2 tests the path. It rebuilds the agent's run and checks it against three questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Was the right flow used?&lt;/strong&gt; Did the investigation follow the approach this kind of case calls for?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Were key skills missed?&lt;/strong&gt; Mode 2 double-checks both local and remote skills to see whether the agent skipped one it should have applied.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Are there gaps or leaps in logic?&lt;/strong&gt; Places where the agent moved from one conclusion to the next without the evidence in between.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An answer can be correct by luck and a path can look reasonable while the answer is wrong. Running both modes covers both failures.&lt;/p&gt;

&lt;h3&gt;
  
  
  Feedback as a versioned packet
&lt;/h3&gt;

&lt;p&gt;Findings from both modes go back to the agent as a versioned packet, injected directly into the CLI window the same way user input arrives. The agent doesn't need a special integration to receive a review. It reads the packet like any other instruction and revises its work, and I still review the final reply before it goes anywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Under the hood
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why Tornado
&lt;/h3&gt;

&lt;p&gt;Atrium is a Python app on Tornado, and the choice came down to what the app spends its time doing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live UI updates.&lt;/strong&gt; The browser view stays current over WebSockets as the agent works.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Async event handling.&lt;/strong&gt; CLI hooks and events arrive while other work is in flight, and Tornado's async model handles that without blocking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lightweight and fast to start.&lt;/strong&gt; It runs beside a working agent session, so it can't be the slow part of my setup.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Packet injection.&lt;/strong&gt; Writing feedback back into the CLI is one more async job alongside everything else.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  State
&lt;/h3&gt;

&lt;p&gt;Atrium keeps its state remotely, in a personal Snowflake database, rather than in local files.&lt;/p&gt;

&lt;h3&gt;
  
  
  From Vesta to Atrium
&lt;/h3&gt;

&lt;p&gt;Atrium is the second generation. The first, Vesta, was a Streamlit app. It proved the ideas, but as features piled up it became heavy and was only ever usable by one person. Rebuilding on Tornado meant giving up Streamlit's convenience in exchange for an app that's fast, light, and designed from the start to sit next to a terminal session instead of being a separate destination.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I build it
&lt;/h2&gt;

&lt;p&gt;I don't build Atrium by prompting one coding agent line by line. I develop it by delegating tasks to autonomous agents that work through them and pick up new skills as they go. My job is the architecture, the review standards, and deciding what gets built next.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Visualization: the next layer of the adversarial challenge
&lt;/h3&gt;

&lt;p&gt;Right now the review's findings arrive as text. Text is precise, but it still has to be read, and at the pace AI investigations move, reading is exactly the step that falls behind. Visualization is key to closing that gap, and it's the next part of the adversarial challenge I'm working on. It's at the design stage, built around two views:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The investigation path as a graph.&lt;/strong&gt; Instead of reading about the route the agent took through a case, I'll see it: the steps it took, in order, laid out as a graph.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claim-by-claim verdicts.&lt;/strong&gt; Each claim in a customer draft, marked as confirmed or countered by the review, so the shape of a draft's evidence is visible at a glance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is the same as everything else in Atrium: let the engineer keep pace with the agent without giving up any of the scrutiny.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adversarial checks on validation work
&lt;/h3&gt;

&lt;p&gt;The Slack validation flow currently gets a quick sanity check. Next, I plan to run the same adversarial LLM checks on it for complex casework, so the work that comes through validation gets the two-mode review that cases already get.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Let the agent investigate; don't let it grade itself.&lt;/strong&gt; Put review in a separate model, ideally from a different family.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structure is how engineers keep pace.&lt;/strong&gt; A fixed-format problem statement speeds up ramp-up, exposes what's missing, and prepares you for live calls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check the answer and the path separately.&lt;/strong&gt; Verifying claims against the data and rebuilding how the agent reached them catch different failures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Meet the agent where it already works.&lt;/strong&gt; Hooks in, feedback injected as input: no custom agent, no new chat window.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep the human on the trigger.&lt;/strong&gt; The review runs when I decide the work is ready, and nothing reaches a customer without my sign-off.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're building something similar, or you've found other ways to make an agent's work verifiable, I'd like to hear about it in the comments.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>python</category>
      <category>agents</category>
    </item>
    <item>
      <title>Check out a technical breakdown of my latest financial analyst project</title>
      <dc:creator>mkash25</dc:creator>
      <pubDate>Mon, 09 Mar 2026 00:25:31 +0000</pubDate>
      <link>https://dev.to/mkash25/check-out-a-technical-breakdown-of-my-latest-financial-analyst-project-27nm</link>
      <guid>https://dev.to/mkash25/check-out-a-technical-breakdown-of-my-latest-financial-analyst-project-27nm</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/mkash25/how-i-built-a-self-hosted-ai-financial-analyst-with-plaid-claude-and-nextjs-2986" class="crayons-story__hidden-navigation-link"&gt;How I built a self-hosted AI financial analyst with Plaid, Claude, and Next.js&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/mkash25" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3813579%2F06e03dbe-84d5-451e-ad43-533cd3866546.webp" alt="mkash25 profile" class="crayons-avatar__image" width="700" height="386"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/mkash25" class="crayons-story__secondary fw-medium m:hidden"&gt;
              mkash25
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                mkash25
                
                
              
              &lt;div id="story-author-preview-content-3328162" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/mkash25" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3813579%2F06e03dbe-84d5-451e-ad43-533cd3866546.webp" class="crayons-avatar__image" alt="" width="700" height="386"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;mkash25&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/mkash25/how-i-built-a-self-hosted-ai-financial-analyst-with-plaid-claude-and-nextjs-2986" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Mar 9&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/mkash25/how-i-built-a-self-hosted-ai-financial-analyst-with-plaid-claude-and-nextjs-2986" id="article-link-3328162"&gt;
          How I built a self-hosted AI financial analyst with Plaid, Claude, and Next.js
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/python"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;python&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/opensource"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;opensource&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/nextjs"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;nextjs&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/mkash25/how-i-built-a-self-hosted-ai-financial-analyst-with-plaid-claude-and-nextjs-2986" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;1&lt;span class="hidden s:inline"&gt;&amp;nbsp;reaction&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/mkash25/how-i-built-a-self-hosted-ai-financial-analyst-with-plaid-claude-and-nextjs-2986#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              1&lt;span class="hidden s:inline"&gt;&amp;nbsp;comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            7 min read
          &lt;/small&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>python</category>
      <category>ai</category>
      <category>opensource</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>How I built a self-hosted AI financial analyst with Plaid, Claude, and Next.js</title>
      <dc:creator>mkash25</dc:creator>
      <pubDate>Mon, 09 Mar 2026 00:01:22 +0000</pubDate>
      <link>https://dev.to/mkash25/how-i-built-a-self-hosted-ai-financial-analyst-with-plaid-claude-and-nextjs-2986</link>
      <guid>https://dev.to/mkash25/how-i-built-a-self-hosted-ai-financial-analyst-with-plaid-claude-and-nextjs-2986</guid>
      <description>&lt;p&gt;&lt;em&gt;I'm Mayank — a cloud and data engineer at Snowflake with a background in network security. I built this as a personal project to solve a problem I kept running into: investments spread across five brokerages with no unified view and no real analysis. Everything here is from scratch, self-hosted, and open source.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;I got tired of checking five different brokerage apps with no unified view and no real analysis. So I built a self-hosted system that connects to all my accounts, enriches every position with market data, and runs it through Claude for buy/sell/hold recommendations — automatically, three times a week.&lt;/p&gt;

&lt;p&gt;Here's how it works and what I learned building it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Plaid API
    ↓
Python pipeline (agent/)
    ├── fetch holdings across all brokerages
    ├── enrich positions — RSI, MACD, Bollinger Bands, fundamentals, news
    ├── Claude analysis — structured buy/sell/hold per position
    └── sync to Supabase
              ↓
         Supabase (Postgres)
              ↓
      Next.js Dashboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The system is split into two components in one monorepo: a Python backend that runs on a schedule, and a Next.js dashboard that reads from Supabase.&lt;/p&gt;




&lt;h2&gt;
  
  
  Part 1: The Python Pipeline
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Connecting accounts with Plaid
&lt;/h3&gt;

&lt;p&gt;Plaid's investment API gives you unified holdings across brokerages — one access token per institution, one schema for everything. The Development tier is free for up to 100 connections, which is more than enough for personal use.&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;# plaid_config.py
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_plaid_client&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;plaid_api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PlaidApi&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;configuration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plaid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Configuration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;plaid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Development&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;clientId&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;PLAID_CLIENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;secret&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;PLAID_SECRET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;},&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;plaid_api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PlaidApi&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;plaid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ApiClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;configuration&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Connecting a new brokerage is a browser-based flow via Plaid Link. I built a lightweight Flask server that serves the Link UI locally, and a &lt;code&gt;connect_real_account.py&lt;/code&gt; script that launches 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;# connect_real_account.py (simplified)
&lt;/span&gt;&lt;span class="nd"&gt;@app.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/create_link_token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;methods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;POST&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;create_link_token&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;link_token_create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;client_user_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;local-user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;client_name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Financial Analyst&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;products&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;investments&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;country_codes&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;US&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;language&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;en&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;jsonify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;link_token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;link_token&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;You open &lt;code&gt;http://localhost:5555&lt;/code&gt;, click Connect, Plaid handles the brokerage login, and the access token is saved locally. Tokens are encrypted at rest using PBKDF2+Fernet — the salt is stored separately from the ciphertext so neither file alone is useful.&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;# token_store.py (simplified)
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;save_tokens&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;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;salt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urandom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;kdf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PBKDF2HMAC&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;algorithm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;hashes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SHA256&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;salt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;salt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;iterations&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;480000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;base64&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlsafe_b64encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;kdf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;derive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SECRET&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;()))&lt;/span&gt;
    &lt;span class="n"&gt;encrypted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Fernet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;encrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tokens&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SALT_FILE&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;write_bytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;salt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;TOKEN_FILE&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;write_bytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;encrypted&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Fetching holdings
&lt;/h3&gt;

&lt;p&gt;Once accounts are connected, fetching holdings is straightforward. The pipeline normalizes across brokerages into a consistent schema:&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="n"&gt;holdings_response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;investments_holdings_get&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;access_token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;options&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;account_ids&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;account_ids&lt;/span&gt;&lt;span class="p"&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;holding&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;holdings_response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;holdings&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="n"&gt;security&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;securities_by_id&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;holding&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;security_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
    &lt;span class="n"&gt;normalized&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;brokerage&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;nickname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ticker&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ticker_symbol&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;quantity&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;holding&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;quantity&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cost_basis&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;holding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cost_basis&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;value&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;holding&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;institution_value&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;account_type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;account_type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One thing worth knowing: Plaid's investment data is &lt;strong&gt;previous close&lt;/strong&gt;, not real-time. That's a Plaid limitation at the Development tier — fine for a 3x/week analysis pipeline, but worth being aware of.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enriching positions
&lt;/h3&gt;

&lt;p&gt;For every unique ticker, I pull technicals and fundamentals via &lt;code&gt;yfinance&lt;/code&gt; and scrape recent news headlines. The enrichment runs in parallel across all tickers:&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;import&lt;/span&gt; &lt;span class="n"&gt;yfinance&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;yf&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pandas_ta&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;rsi&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;macd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bbands&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;enrich_ticker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ticker&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="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;stock&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;yf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Ticker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ticker&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;hist&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;stock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;history&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;period&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;6mo&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;info&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;stock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;info&lt;/span&gt;

    &lt;span class="n"&gt;close&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hist&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Close&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;rsi_val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;rsi&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;iloc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;macd_df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;macd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;bb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;bbands&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;technicals&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;price&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iloc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sma_50&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;rolling&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;iloc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;rsi_14&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;rsi_val&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;macd&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;macd_df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;MACD_12_26_9&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;iloc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bb_upper&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;bb&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;BBU_5_2.0&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;iloc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bb_lower&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;bb&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;BBL_5_2.0&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;iloc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fundamentals&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sector&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sector&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pe_trailing&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;trailingPE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;analyst_target&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;targetMeanPrice&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;performance&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;return_1m&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iloc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iloc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pct_from_52w_high&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iloc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;news&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;title&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;title&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;publisher&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;publisher&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;n&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;stock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;news&lt;/span&gt;&lt;span class="p"&gt;[:&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Getting Claude to return structured output reliably
&lt;/h3&gt;

&lt;p&gt;This took the most iteration. The key was being extremely explicit in the system prompt — not just asking for JSON, but defining the exact schema including field names, types, and valid enum values.&lt;/p&gt;

&lt;p&gt;The system prompt opens with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are a senior portfolio analyst. You will receive a full enriched portfolio
and return a JSON object that EXACTLY matches this schema. Do not include
markdown fences, explanation, or any text outside the JSON object.

Schema:
{
  "overall_health": "strong" | "moderate" | "weak",
  "summary": string,
  "action_items": string[],
  "recommendations": [
    {
      "ticker": string,
      "action": "BUY" | "SELL" | "HOLD",
      "confidence": "high" | "medium" | "low",
      "urgency": "immediate" | "soon" | "no_rush",
      "thesis": string,
      "bull_case": string,
      "bear_case": string,
      "key_signals": string[],
      "risk_factors": string[]
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even with that, Claude occasionally wraps the response in markdown fences. I added a cleaning step:&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="n"&gt;cleaned&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;raw_response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;cleaned&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;```

&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;cleaned&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cleaned&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;cleaned&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;endswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;

```&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;cleaned&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cleaned&lt;/span&gt;&lt;span class="p"&gt;[:&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;analysis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cleaned&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Real token numbers from 15 actual runs:&lt;/strong&gt; ~47K input tokens + ~15K output tokens per run. At claude-sonnet-4-6 pricing ($3/M input, $15/M output) that's ~$0.36/run, ~$5/month at 3x/week.&lt;/p&gt;

&lt;h3&gt;
  
  
  Syncing to Supabase
&lt;/h3&gt;

&lt;p&gt;After each run, the pipeline pushes everything to Supabase: holdings, enrichment data, analysis report, and recommendations. The service role key bypasses RLS, which makes bulk writes clean:&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;# sync_to_supabase.py (simplified)
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;sync_snapshot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;snapshot&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;analysis&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;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="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;supabase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pipeline_runs&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;trigger&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;scheduled&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;success&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;model&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;analysis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;model&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input_tokens&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;analysis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;usage&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input_tokens&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;output_tokens&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;analysis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;usage&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;output_tokens&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="n"&gt;run_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="n"&gt;supabase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;portfolio_snapshots&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;run_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;run_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;snapshot_date&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;today&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;total_value&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;snapshot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;summary&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;total_value&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="bp"&gt;...&lt;/span&gt;
    &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Scheduling
&lt;/h3&gt;

&lt;p&gt;On macOS, I use launchd rather than cron — it survives reboots and wakes the machine if it's asleep. A template plist is included in the repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- scheduler/macos/com.finanalyst.pipeline.plist.template --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;StartCalendarInterval&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;array&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;Weekday&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/integer&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;Hour&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;&lt;/span&gt;7&lt;span class="nt"&gt;&amp;lt;/integer&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;Minute&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;&lt;/span&gt;0&lt;span class="nt"&gt;&amp;lt;/integer&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- Monday, Wednesday, Friday --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/array&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The installer prints the exact &lt;code&gt;sed&lt;/code&gt; and &lt;code&gt;launchctl&lt;/code&gt; commands to activate it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Part 2: The Next.js Dashboard
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Database schema
&lt;/h3&gt;

&lt;p&gt;Supabase sits between the pipeline and the dashboard. The schema has six tables: &lt;code&gt;pipeline_runs&lt;/code&gt;, &lt;code&gt;portfolio_snapshots&lt;/code&gt;, &lt;code&gt;holdings&lt;/code&gt;, &lt;code&gt;enrichment&lt;/code&gt;, &lt;code&gt;analysis_reports&lt;/code&gt;, and &lt;code&gt;recommendations&lt;/code&gt;. RLS is enabled on all of them — authenticated users get read access, the service role key (pipeline-only) gets write access.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Row Level Security&lt;/span&gt;
&lt;span class="k"&gt;alter&lt;/span&gt; &lt;span class="k"&gt;table&lt;/span&gt; &lt;span class="n"&gt;holdings&lt;/span&gt; &lt;span class="n"&gt;enable&lt;/span&gt; &lt;span class="k"&gt;row&lt;/span&gt; &lt;span class="k"&gt;level&lt;/span&gt; &lt;span class="k"&gt;security&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;create&lt;/span&gt; &lt;span class="n"&gt;policy&lt;/span&gt; &lt;span class="nv"&gt;"Auth users can read holdings"&lt;/span&gt;
  &lt;span class="k"&gt;on&lt;/span&gt; &lt;span class="n"&gt;holdings&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="k"&gt;to&lt;/span&gt; &lt;span class="n"&gt;authenticated&lt;/span&gt; &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;-- service_role bypasses RLS by default — no explicit policy needed&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Dashboard features
&lt;/h3&gt;

&lt;p&gt;The dashboard is built with Next.js 14 App Router, Tailwind, Radix UI, and Recharts. Key views:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Net worth card&lt;/strong&gt; — pulls latest snapshot total, broken down by account category (taxable, retirement, cash)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Allocation chart&lt;/strong&gt; — recharts pie chart from &lt;code&gt;asset_types_json&lt;/code&gt; in the snapshot&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Holdings table&lt;/strong&gt; — per-position gain/loss, colored by performance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI recommendations&lt;/strong&gt; — latest analysis report with per-ticker cards showing action, confidence, bull/bear case&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RSU widget&lt;/strong&gt; — grant tracking with live price refresh&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  RSU price refresh
&lt;/h3&gt;

&lt;p&gt;RSU grants are stored in Supabase. When you hit the Recalc button, a server action fetches the current price from Yahoo Finance — no API key needed — and updates the grant value in real time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// app/api/rsu-grants/recalc/route.ts&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchPrice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ticker&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`https://query1.finance.yahoo.com/v8/finance/chart/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;ticker&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;?interval=1d&amp;amp;range=1d`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;User-Agent&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Mozilla/5.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;next&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;revalidate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;json&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;chart&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;?.[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]?.&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;regularMarketPrice&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Vested units are computed server-side from the vesting schedule stored as JSONB:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;computeVestedUnits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;schedule&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;RsuVestingEvent&lt;/span&gt;&lt;span class="p"&gt;[]):&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;today&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;today&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setHours&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;59&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;59&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;999&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;schedule&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;today&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;units&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  The Installer
&lt;/h2&gt;

&lt;p&gt;Getting the install experience right took more work than I expected. The goal: someone clones the repo and runs one command that handles everything — Python deps, Node deps, and all API key setup — with zero silent failures.&lt;/p&gt;

&lt;p&gt;The wizard validates every key live before writing anything to disk, using Python stdlib only (&lt;code&gt;urllib&lt;/code&gt;) so it works before any deps are installed:&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;# Anthropic — hits /v1/models, zero tokens consumed
&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.anthropic.com/v1/models&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;x-api-key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;anthropic-version&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2023-06-01&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;urlopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;8&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;r&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Plaid — hits /institutions/get with the actual credentials
&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;client_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;client_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;secret&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;secret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;count&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;offset&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;country_codes&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;US&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Request&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="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/institutions/get&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Content-Type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;application/json&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;A few things I hit during testing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;macOS ships bash 3.2&lt;/strong&gt;, which doesn't support associative arrays (&lt;code&gt;declare -A&lt;/code&gt;). Had to replace the status tracking with plain variables and helper functions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Python 3.12 installed via python.org doesn't land in PATH&lt;/strong&gt; automatically. The installer now searches a list of known locations (&lt;code&gt;/usr/local/bin/python3.12&lt;/code&gt;, &lt;code&gt;/Library/Frameworks/...&lt;/code&gt;) before giving up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;hatchling&lt;/code&gt; requires a &lt;code&gt;README.md&lt;/code&gt;&lt;/strong&gt; in the package directory. Moving to a monorepo broke this — fixed by removing the &lt;code&gt;readme&lt;/code&gt; field from &lt;code&gt;pyproject.toml&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What I'd Do Differently
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Add a token estimate before each Claude call.&lt;/strong&gt; Token count grows with portfolio size. A pre-call estimate would let users catch runaway costs early.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache yfinance calls within a run.&lt;/strong&gt; If the same ticker appears across multiple accounts, it gets enriched multiple times. Deduplication before enrichment would save time and API calls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plaid Development throttles refresh.&lt;/strong&gt; Holdings data is previous close, not real-time. Worth documenting more prominently for anyone expecting live prices.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/mkash25/Claude-powered-AI-native-financial-dashboard" rel="noopener noreferrer"&gt;https://github.com/mkash25/Claude-powered-AI-native-financial-dashboard&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MIT licensed — self-hosted, your financial data stays in your own Supabase instance&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bash install.sh&lt;/code&gt; — one command sets up everything including the key validation wizard&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Not financial advice — treat Claude's output as a starting point for your own research, not a signal to act on.&lt;/em&gt;&lt;/p&gt;

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