<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vivek Pandey on Medium]]></title>
        <description><![CDATA[Stories by Vivek Pandey on Medium]]></description>
        <link>https://medium.com/@viveklok?source=rss-796144e4ef32------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Yo57XbXVqrOE8gP5y6Gtow.jpeg</url>
            <title>Stories by Vivek Pandey on Medium</title>
            <link>https://medium.com/@viveklok?source=rss-796144e4ef32------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 17:22:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@viveklok/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Before You Build an AI Agent: Architecture Decisions You Can’t Undo Later]]></title>
            <link>https://medium.com/@viveklok/before-you-build-an-ai-agent-architecture-decisions-you-cant-undo-later-6b6a14c8b039?source=rss-796144e4ef32------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b6a14c8b039</guid>
            <category><![CDATA[langgraph]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Vivek Pandey]]></dc:creator>
            <pubDate>Fri, 23 Jan 2026 03:50:57 GMT</pubDate>
            <atom:updated>2026-01-23T04:10:25.297Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is a decision-first checklist for developers building sophisticated, scalable, reliable multi-agent systems.</p><p>We’ll show how a small set of requirements — <strong>scale, task horizon, cost, and risk</strong> — quickly narrows your options, so you can choose the right platform, framework, and architecture for what you’re building: a research assistant, a consumer chat experience, or an automation agent that acts on real systems.</p><p><strong>Why this checklist matters:</strong> many teams pick a platform and architecture early, then try to fit every new requirement into that choice. That’s how you end up with fragile loops, missing checkpoints, and painful rewrites</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZSDVSZhw_kUO8YHOBd6ZMg.png" /></figure><p>If you take only one thing from this article, let it be this:</p><blockquote>Let <strong>requirements</strong> drive <strong>decisions</strong> — and let <strong>decisions</strong> choose the <strong>frameworks</strong></blockquote><h3><strong>Identify workflows</strong></h3><p>Start by listing the main workflows your system must run. For each workflow, mark which parts are <strong>deterministic</strong> (fixed rules, clear inputs/outputs) and which parts are <strong>agentic</strong> (ambiguity, judgment, synthesis). The point is to be explicit about where you actually need an agent, and where you don’t.</p><p>As you map workflows, list out the main agents in your system — then write down what each agent owns, what it outputs, and what it’s not allowed to do.</p><h3><strong>Coordination Model</strong></h3><p>Choose the coordination model that fits your requirements — and keeps execution predictable</p><ul><li><strong>Chat-style:</strong> good for exploration; weak for control and debugging.</li><li><strong>Supervisor → workers:</strong> best default — one owner delegates to specialists and keeps state coherent.</li><li><strong>Workflow/graph (DAG):</strong> use when execution must be deterministic, needs parallel fan-out + converge, or must pause/resume safely (HITL, long tool jobs, audits).</li><li><strong>A2A:</strong> use when agents are independently deployed and need capability discovery + progress/follow-ups.</li></ul><h3><strong>Choose a Runtime (per agent)</strong></h3><p>Not every agent needs to run on the same runtime or even the same platform. In real systems, specialist agents can run differently and still collaborate — so pick a runtime per agent role, based on what that agent must handle.</p><p><strong>1) Scale &amp; concurrency</strong></p><ul><li>If the agent must handle bursts or high parallel tool calls, prefer runtimes/frameworks that support <strong>async-first execution</strong> and <strong>backpressure</strong> (timeouts, rate limits, cancellation), and play well with <strong>queues/pub-sub</strong>.</li></ul><p><strong>2) Stateful vs stateless</strong></p><ul><li>If the agent must <strong>pause/resume</strong>, survive restarts, or be audit-friendly, choose a <strong>stateful-first</strong> runtime — look for <strong>durable checkpoints + resume</strong> as a first-class feature.</li><li>If runs are short and you’re fine storing minimal context yourself, a <strong>stateless-first</strong> runtime (request/response + light session state) is simpler and cheaper.</li></ul><p><strong>3) Task horizon</strong></p><ul><li><strong>Seconds → few turns:</strong> lightweight runtime + simple retries is usually enough.</li><li><strong>Minutes+, approvals, waiting on tools/other agents:</strong> you’ll want checkpointing, progress updates, and replay-safe recovery.</li></ul><p><strong>4) Primitives (structure vs cost)</strong></p><ul><li>If the agent needs planning/notes/summarization/reflection often, look for frameworks that provide these <strong>built-in primitives</strong> — but budget for extra LLM calls.</li><li>If not, keep it lean: tight tools + minimal orchestration.</li></ul><p>For long-running or distributed agents, prefer runtimes that make it easy to emit <strong>progress events</strong>, support <strong>idempotent retries</strong>, and integrate with <strong>tracing/evals</strong>.</p><h3><strong>Decompose the system</strong></h3><p>Once you’ve picked coordination and runtimes, decide what becomes an agent and what should stay deterministic.</p><ul><li><strong>Tools:</strong> deterministic actions (DB update, search, ticket create). Keep them idempotent and testable.</li><li><strong>Skills:</strong> reusable mini-flows (classify, extract, summarize) that can be invoked consistently.</li><li><strong>Subagents:</strong> specialist workers for a domain/task with clear inputs/outputs (research, triage, ticketing).</li><li><strong>MCP servers:</strong> a stable boundary for shared tools — versioned interface, auth, rate limits, auditing — especially when another team owns the capability.</li></ul><p>Rule of thumb: <strong>LLMs for ambiguity; tools/workflows for determinism.</strong> Start co-located, then split out shared or high-traffic boundaries as the system matures.</p><h3><strong>Interactions &amp; protocols</strong></h3><p>For every interaction — <strong>human ↔ agent</strong>, <strong>agent ↔ tool/MCP</strong>, <strong>agent ↔ agent</strong> — list out required inputs, expected outputs, typical latency, and whether it should be <strong>sync</strong> or <strong>async</strong> (including fan-out/fan-in if needed).</p><ul><li><strong>Short flows:</strong> direct API calls (optionally streaming) are usually enough.</li><li><strong>Multi-step / long-running flows:</strong> treat it like a workflow — emit <strong>progress events</strong>, support <strong>cancel/retry</strong>, and use <strong>async patterns</strong> (queue/pub-sub) to absorb slow tools and bursts</li></ul><p>To support <strong>Interrupt/resume</strong> — you’ll typically store a <strong>run/task id</strong>, persist minimal state, and on callback publish an event (or enqueue a message) that wakes the right workflow step.</p><p>For <strong>UI</strong>, keep a simple event model (started → progress → done/failed), and standardize telemetry: use a consistent event schema (AGUI-style) and emit OTel-friendly traces/logs so that you can debug the runs and failures.</p><p><strong>Use MCP</strong> when tools are <strong>shared</strong>, <strong>owned by another team</strong>, or need a stable, versioned interface (auth, rate limits, auditing).</p><p><strong>Use A2A</strong> when agents need richer collaboration: <strong>capability discovery</strong>, <strong>follow-ups</strong>, and <strong>progress/streaming updates</strong> etc.</p><h3><strong>Safety &amp; Observability</strong></h3><p>Don’t leave <strong>Tracing &amp; evals</strong> for later. Once you have multi-step workflows or retries, you’ll need visibility.</p><p>Make tracing first-class: emit a trace per run with spans for each tool/agent step (OTel-friendly), and standardize progress events so you can debug “where it got stuck.”</p><p>Add lightweight regression evals (golden tasks) and occasional step checks so prompt/model/tool changes don’t silently degrade behavior.</p><p>If your agents are making changes in real world, you’ll need scoped permissions, clear confirmation points or HITL, an audit trail, and a rollback/escalation path — because the goal is always to <strong>limit blast radius</strong> so small failures don’t become expensive incidents.</p><h3><strong>Personalization</strong></h3><p>Use a small preference/profile memory that’s retrieved selectively (not injected every turn). If something truly important emerges, <strong>promote it to long-term memory</strong>; for proactive follow-ups, capture a few session takeaways and keep them fresh with recency/override rules — while keeping memory separate from workflow/correctness state to avoid drift.</p><h3><strong>Deployment Note</strong></h3><p>As your system grows, you’ll choose whether agents and services run <strong>together</strong> or as <strong>separate deployments</strong> — each with different trade-offs.</p><ul><li><strong>Co-located:</strong> simplest to start — fewer moving parts and easier debugging.</li><li><strong>Distributed:</strong> better scaling and clearer ownership, but requires strong <strong>contracts</strong> (timeouts, retries, events, auth).</li></ul><p>A practical, relatively vendor-neutral setup may be<strong> managed Kubernetes</strong> for agents and supporting services (UI, MCP tools, observability, schedulers), paired with <strong>managed stateful services</strong> (DB, cache, queues) to reduce ops burden — just note that costs can rise quickly at scale (always-on clusters, managed services, logs/traces).</p><h3><strong>Conclusion</strong></h3><p><strong>Don’t start by choosing a framework — start by writing down requirements. </strong>Scale, task horizon, and whether your agent can create real-world side effects will quickly force your architecture: <strong>async vs sync execution</strong>, <strong>durable checkpoints vs session-only state</strong>, and <strong>standard protocols vs ad-hoc integrations</strong>. Once those are clear, picking a platform or framework gets simpler — because you’re choosing for fit, not optimizing a prototype.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b6a14c8b039" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>