<?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 Krishna Kumar Akurathi on Medium]]></title>
        <description><![CDATA[Stories by Krishna Kumar Akurathi on Medium]]></description>
        <link>https://medium.com/@kindlingknowledge?source=rss-1888a8d4ce78------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*aVsk11iC2H10389i</url>
            <title>Stories by Krishna Kumar Akurathi on Medium</title>
            <link>https://medium.com/@kindlingknowledge?source=rss-1888a8d4ce78------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 19:12:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kindlingknowledge/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[Rate Limits Protect Availability. Quotas Govern AI Consumption.]]></title>
            <link>https://kindlingknowledge.medium.com/rate-limits-protect-availability-quotas-govern-ai-consumption-dae38686a87a?source=rss-1888a8d4ce78------2</link>
            <guid isPermaLink="false">https://medium.com/p/dae38686a87a</guid>
            <category><![CDATA[ai-quota]]></category>
            <category><![CDATA[ai-ratelimit]]></category>
            <category><![CDATA[ai-governance]]></category>
            <dc:creator><![CDATA[Krishna Kumar Akurathi]]></dc:creator>
            <pubDate>Fri, 23 Oct 2026 11:34:28 GMT</pubDate>
            <atom:updated>2026-10-23T11:34:28.873Z</atom:updated>
            <content:encoded><![CDATA[<p>A reference pattern for multi-dimensional governance in enterprise multi-tenant agent platforms</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dlpPIF3tPmmI5O4hvHkORg.png" /><figcaption>The takeaway: protecting request throughput and governing cumulative AI consumption are related, but different, engineering problems.</figcaption></figure><p>An API can remain comfortably below its requests-per-second limit while an AI workload quietly consumes millions of tokens, processes thousands of document pages, occupies scarce model capacity, and creates an unexpected bill. Conventional API throttling is necessary for an enterprise AI platform, but it is not enough.</p><p>Rate limits protect the platform from traffic arriving too quickly. Quotas govern how much a tenant, user, or workload may consume over time. Concurrency limits constrain how much work may be in flight at once. Production AI systems need all three because speed, simultaneous pressure, and cumulative entitlement are different risk dimensions.</p><p>This article proposes a <strong>reference pattern</strong>, not an industry standard. Its contribution is the synthesis of four mechanisms into one consumption-governance model:</p><ol><li>synchronous admission control;</li><li>multi-dimensional usage reservations;</li><li>post-execution settlement into a durable usage ledger;</li><li>continuous reconciliation between fast operational state and accounting evidence.</li></ol><p>Terms such as <em>usage reservation</em>, <em>agent-run budget envelope</em> and <em>phantom exhaustion</em> are introduced here for clarity and are not established standards. “Denial of wallet” is informal industry shorthand.</p><p>The architectural mistake is to treat quota enforcement as a single gateway feature. The practical design is a layered capability that admits quickly, measures actual work, and remains recoverable when its hot state is incomplete or lost.</p><h3>Three controls, three enforcement points</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ivOCkhgfx3gR7r079aoY1A.png" /><figcaption><em>Table 1. Three controls, three different questions</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h0EIYDtg4Vb_KfTu0KYdpg.png" /><figcaption><em>Where each control sits on the request path: rate at the front door, quota before work is admitted, concurrency when execution capacity is allocated, provider limits at the external boundary.</em></figcaption></figure><p>Consider a <strong>document-analysis agent</strong>. A tenant submits only five requests in ten minutes, well below a conventional rate limit. Each request contains a 500-page file and triggers retrieval, classification, extraction, summarization, and several tool calls. The request rate looks harmless. The work is not. A useful policy might include:</p><ul><li>30 API requests per minute to absorb bursts;</li><li>8 concurrent document jobs to protect workers and downstream systems;</li><li>2 million input tokens and 250,000 output tokens per billing cycle;</li><li>20,000 processed pages and 10 GB of retained artifacts per billing cycle;</li><li>1,000 calls to a premium model or governed tool.</li></ul><p>The units should represent what is scarce, chargeable or risky in the workload, not merely what the front door can count.</p><h3>Modern AI gateways help, but they do not close the problem.</h3><p>Request-count throttling is no longer the whole gateway landscape. Azure API Management enforces LLM token rates and quotas per key. Kong’s AI Rate Limiting Advanced plugin calculates limits from the token usage the provider returns. LiteLLM provides budgets and token and request limits, and its documentation describes estimating a request’s maximum cost, reserving it, and rejecting the request before it reaches the provider, with spend persisted in a database. These capabilities are valuable and should be used where they fit. (<a href="https://learn.microsoft.com/en-us/azure/api-management/llm-token-limit-policy">Azure APIM</a>, <a href="https://developer.konghq.com/plugins/ai-rate-limiting-advanced/">Kong</a>, <a href="https://docs.litellm.ai/docs/proxy/users">LiteLLM</a>)</p><p>The same documentation shows where the problem remains open. Azure notes that concurrent requests can briefly exceed a limit, because actual consumption is not known until responses arrive. Beyond that, based on the documentation reviewed for this article, none of these products is described as combining all of the following: non-token units such as pages and tool calls under one atomic reservation; tenant, workspace and user hierarchies with delegated allocations; run-level envelopes with top-ups; and a provider-independent, audit-grade ledger with reconciliation. Capabilities change quickly, so verify against current versions. A gateway can be one enforcement point within the design without being the entire design.</p><p>AWS API Gateway adds a caveat: usage-plan throttling and quotas “are not hard limits, and are applied on a best-effort basis.” That is a statement about AWS; extending the caution to any enforcement built on distributed counters and asynchronous replication is this article’s inference. (<a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html">AWS usage plans</a>, <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html">AWS throttling</a>)</p><h3>AI quota enforcement is a two-phase decision</h3><p>Traditional request quotas can often be decided before execution: increment a counter, compare it with a threshold, then admit or reject. AI consumption is harder because the final cost is not known at admission. Input tokens may be counted in advance, but output tokens are known only when generation ends, and some providers include reasoning tokens in reported output usage, so check each provider’s semantics. An agent may branch, retry, call more tools, or process more pages than expected. If the platform checks the balance and records usage later, concurrent requests can all observe the same remaining allowance and overspend it.</p><p>The missing concept is a <strong>usage reservation</strong>. Before execution, the platform estimates or bounds the chargeable work and atomically reserves the allowance. After execution, it settles the reservation using actual usage and releases the unused portion. This resembles payment authorization and capture: a hold that expires if never captured, and a partial capture that releases the remainder. The analogy should not be mistaken for financial settlement semantics; it is a way to separate pre-execution exposure control from post-execution accounting. (<a href="https://docs.stripe.com/payments/place-a-hold-on-a-payment-method">Stripe: place a hold</a>)</p><p>The core invariant for each dimension:</p><pre>available = limit - committed - reserved<br>admit only when committed + reserved + requested &lt;= limit</pre><h3>Reserve at the agent-run level</h3><p>For a single model call, one reservation may be enough. For a multi-step agent, the most useful scope is an <strong>agent-run budget envelope</strong>. The run reserves an initial allowance for tokens, pages, tool calls, and elapsed execution, and individual steps consume from it. When the remainder becomes too small, the runtime requests an idempotent top-up. Policy can approve it, degrade the run, pause for human approval, or stop execution.</p><p>This handles branching and retries without pretending every future step is knowable at admission. It also bounds a runaway loop or prompt-injection-driven tool sequence, which would otherwise become a denial-of-wallet attack.</p><h3>Conservative reservation has a cost.</h3><p>Reserving the maximum possible output for every concurrent job protects the ceiling but can create <strong>phantom exhaustion</strong>: capacity appears unavailable even though most jobs will use far less than their worst case. Make the trade-off explicit in reservation_strategy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SK6mn-BMEsGBMYfDEIKLnw.png" /><figcaption><em>Reservation strategies trade precision for utilization</em></figcaption></figure><h3>Reference architecture: fast admission, durable truth</h3><p>Quota enforcement sits on the synchronous path and must be low-latency. Audit, billing, and recovery require durable evidence. One datastore rarely optimizes both concerns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*guHmciiaNC_86kDThjqSig.png" /><figcaption><em>Logical architecture; deployment topology (regions, clusters, queues) will differ. Redis answers “may this work start now?” The usage ledger answers “what actually happened?” The settlement worker commits and releases into Redis; the reconciler compares, repairs and rebuilds Redis from durable evidence.</em></figcaption></figure><p>The responsibilities:</p><ul><li><strong>API gateway:</strong> authenticates the caller and applies request or token-rate controls.</li><li><strong>Policy service:</strong> resolves tenant, plan, workspace, user, and entitlement, and calculates versioned effective rules and the required reservation.</li><li><strong>Redis hot state:</strong> performs atomic reservation and concurrency-lease decisions with bounded latency.</li><li><strong>Agent runtime:</strong> executes model and tool steps within the run envelope.</li><li><strong>Usage collector:</strong> normalizes provider and application measurements into canonical events.</li><li><strong>Usage ledger:</strong> stores immutable, idempotent evidence for audit, recovery, and cost attribution.</li><li><strong>Settlement worker:</strong> commits actual usage and releases unused reservations.</li><li><strong>Reconciler:</strong> compares counters with ledger events and open reservations and repairs or rebuilds hot state.</li><li><strong>Governance plane:</strong> exposes usage, forecasts, overrides, alerts, and policy changes.</li></ul><p>This yields two complementary truths: <strong>operational truth</strong> (can this request start now?) in Redis and <strong>accounting truth</strong> (what was consumed, by whom, under which policy?) in the ledger. Traces and metrics cannot replace the ledger, because they may be sampled, aggregated, or retained for shorter periods. The ledger must preserve complete chargeable events according to the organization’s contractual, audit, and regulatory record-keeping obligations.</p><h3>Making Redis safe for reservations</h3><h3>Atomicity needs a script.</h3><p>A multi-dimensional reservation is a check-then-act operation. Reading five counters and then issuing five increments from application code is unsafe, because concurrent callers can pass the same check before either update becomes visible.</p><p>The check and every mutation must run as one Redis Lua script or function. MULTI/EXEC serializes queued commands but cannot express a conditional multi-key read-decide-write. Redis documents that scripts and functions execute atomically, calls out the race between them, INCR and setting an expiry, and uses Lua in its rate-limiting tutorial. (<a href="https://redis.io/docs/latest/develop/programmability/eval-intro/">Lua</a>, <a href="https://redis.io/docs/latest/develop/programmability/functions-intro/">Functions</a>, <a href="https://redis.io/docs/latest/commands/incr/">INCR</a>, <a href="https://redis.io/tutorials/howtos/ratelimiting/">rate-limiting tutorial</a>) A reservation script should:</p><ol><li>load every applicable hard-limit counter;</li><li>Check committed + reserved + requested for each dimension and scope;</li><li>reject without mutation if any check fails;</li><li>Otherwise, increment every reserved counter;</li><li>Create the reservation record with expiry and idempotency key;</li><li>Return one decision with the remaining allowances and the policy version.</li></ol><p>In Redis Cluster, every key the script touches must share a hash slot, for example through hash tags such as quota:{tenant-123}:.... That shapes the hierarchy: atomic reservation across platform, plan, tenant, workspace and user keys cannot be assumed if they live in different slots. Choose one atomic allocation boundary, pre-delegate parent capacity into tenant-local pools, or use stronger coordination. (<a href="https://redis.io/docs/latest/operate/oss_and_stack/management/scaling/">Redis scaling and hash tags</a>)</p><h3>Hot state is not truth</h3><p>Redis replication is commonly asynchronous; acknowledged writes can be lost during failover, and Redis Cluster does not guarantee strong consistency. WAIT &amp; stronger persistence reduces exposure but does not make Redis a globally consistent accounting system. (<a href="https://redis.io/docs/latest/operate/oss_and_stack/management/replication/">Redis replication</a>, <a href="https://redis.io/docs/latest/operate/oss_and_stack/management/scaling/">Redis Cluster consistency</a>) So hot counters must be reconstructable from the ledger, open reservations must be durably discoverable and not only present as volatile keys, and recovery must define whether traffic stays closed, degraded, or temporarily allowed while state is rebuilt. The ledger is the source of accounting truth because it makes replay possible, not because Redis is unreliable in ordinary operation.</p><h3>Outage behavior is policy</h3><p>“Fail open or fail closed?” has no universal answer. Decide per metric and capability:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IuI84cqM2ZFhhaF8ZjFk-Q.png" /><figcaption><em>Outage posture is decided per protected boundary</em></figcaption></figure><p>Keep a local fallback allowance small, short-lived, and outside claims of strict enforcement; during partitions, each instance could otherwise issue its own allowance and multiply the ceiling. Distinguish exhaustion from control-plane failure: return 429 Too Many Requests with Retry-After when a retry window is meaningful, and an availability error when the enforcement service itself is down. (<a href="https://www.rfc-editor.org/rfc/rfc6585">RFC 6585</a>)</p><h3>Hierarchy and multi-tenant fairness</h3><p>Enterprise limits rarely exist at one level. A useful logical hierarchy is:</p><p><strong>Platform → provider/model → plan → tenant → workspace → user → agent → resource</strong></p><p>A lower level may narrow a parent entitlement but should not silently expand it. Overrides must be explicit, time-bound, attributable, and auditable. Fairness then needs an allocation policy, not just a hierarchy:</p><ul><li><strong>Dedicated caps:</strong> guaranteed isolation, lower utilization.</li><li><strong>Shared pool:</strong> better utilization, greater noisy-neighbor risk.</li><li><strong>Base allocation plus burst borrowing:</strong> every tenant gets a floor and may borrow unused capacity within a bounded burst.</li><li><strong>Weighted fair scheduling:</strong> work is queued and dispatched by tenant weight rather than arrival order.</li><li><strong>Oversubscribed workspace allocations:</strong> child allocations may exceed the tenant plan on paper, but admission still checks the tenant’s real remaining pool.</li></ul><p>Concurrency controls also protect shared provider capacity. Providers impose their own limits, and the platform must apportion that capacity so one high-volume tenant cannot starve the rest. Anthropic’s API, for example, measures limits in requests, input tokens, and output tokens per minute for each model class, sets them at the organization level (workspace limits can be lower, but organization limits always apply), and replenishes capacity with a token bucket. Its accounting also differs from a worst-case reservation: output-token limits are evaluated on tokens actually produced, and max_tokens does not count toward them. Provider semantics differ, so normalize measurements while retaining the provider&#39;s original numbers. (<a href="https://platform.claude.com/docs/en/api/rate-limits">Anthropic rate limits</a>)</p><h3>Policy and event contracts</h3><p>A quota policy needs more than a limit and period.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ROqX7Lb9IoOFxnuEqi6Xhw.png" /><figcaption><em>A quota policy is more than a limit and a period</em></figcaption></figure><p>If the atomic check fails, no counters are partially reserved. The policy then selects the next action: reject, queue, request approval or retry with a smaller degraded reservation. “No partial admission” describes atomic state mutation, not an obligation to return an immediate rejection.</p><p><strong>Degrade before you reject.</strong> Assign behavior per dimension: observe-only while validating assumptions; a soft warning at 70% or 80% or at a forecast exhaustion date; an approval threshold that routes to a tenant administrator or cost owner; a degraded mode (cheaper model, shorter output, deferred work, an optional tool disabled); and a hard limit where contractual, safety, or cost exposure demands certainty. When you do reject, return the exhausted metric, scope, remaining allowance, reset time, and a correlation ID, without exposing other tenants or internal policy. Status codes vary by product; Azure’s token policy, for example, returns 429 for rate limits and 403 for quota exhaustion. Dashboards should show committed usage, active reservations, remaining entitlement, and projected exhaustion separately, because a single combined number hides the races the system exists to control.</p><p><strong>A quota is not a budget.</strong> A quota is an enforceable entitlement in operational units. A budget is a financial threshold that may trigger alerts, approvals, or policy changes. Token quotas support cost control but do not replace model-aware cost attribution, because prices vary by model, provider, input and output class, and caching.</p><p>Every chargeable action should emit a canonical usage event:</p><pre>{<br>  &quot;event_id&quot;: &quot;01J...&quot;,<br>  &quot;occurred_at&quot;: &quot;2026-10-20T08:15:23Z&quot;,<br>  &quot;tenant_id&quot;: &quot;tenant-123&quot;,<br>  &quot;workspace_id&quot;: &quot;claims-ops&quot;,<br>  &quot;principal_id&quot;: &quot;user-456&quot;,<br>  &quot;agent_id&quot;: &quot;document-review-agent&quot;,<br>  &quot;agent_run_id&quot;: &quot;run-789&quot;,<br>  &quot;operation&quot;: &quot;document.summarize&quot;,<br>  &quot;model&quot;: &quot;provider/model-class&quot;,<br>  &quot;reservation_id&quot;: &quot;res-789&quot;,<br>  &quot;admission_idempotency_key&quot;: &quot;claim-8472-attempt-1&quot;,<br>  &quot;cycle_id&quot;: &quot;2026-10&quot;,<br>  &quot;policy_version&quot;: &quot;quota-policy-18&quot;,<br>  &quot;usage&quot;: {<br>    &quot;input_tokens&quot;: 18420,<br>    &quot;output_tokens&quot;: 1260,<br>    &quot;reasoning_output_tokens&quot;: 340,<br>    &quot;pages&quot;: 73,<br>    &quot;tool_calls&quot;: 4<br>  },<br>  &quot;outcome&quot;: &quot;succeeded&quot;,<br>  &quot;trace_id&quot;: &quot;4bf92f...&quot;<br>}</pre><p>In this schema, output_tokens includes reasoning_output_tokens, which is a breakdown, because providers differ in how they report it. Define the same rule in your own contract.</p><p>Reservation creation must be idempotent as well as finalization. If a client times out after admission and retries, the same idempotency key must return the existing reservation instead of consuming capacity again. Stripe’s API documentation is a well-known example of idempotency keys making retries safe, although quota reservations need their own domain semantics. (<a href="https://docs.stripe.com/api/idempotent_requests">Stripe idempotency</a>)</p><p>The OpenTelemetry GenAI semantic conventions repository defines common agent, model, and token-usage attributes, including a reasoning-output-token attribute. The conventions are still evolving, so adopt them deliberately and version your mapping. Extend them with tenant, reservation, and policy context in the ledger, without recording raw prompts, secrets, or private reasoning. (<a href="https://github.com/open-telemetry/semantic-conventions-genai">OpenTelemetry GenAI semantic conventions</a>, <a href="https://github.com/open-telemetry/semantic-conventions-genai/blob/main/docs/registry/attributes/gen-ai.md">attribute registry</a>)</p><h3>BFSI example: claims-document processing</h3><p>An insurer offers agent-assisted claims review to several business units. The tenant is on a plan with 50,000 pages and 3 million tokens per month, and it is late in the billing cycle. The motor-claims workspace has a delegated page allocation. A high-risk extraction tool is capped at 2,000 calls per month and requires approval for new reservations once committed usage crosses 80% (1,600 calls).</p><p>A user uploads a case bundle that cheap ingress inspection counts as 600 pages. That inspection is not free, so it has its own small upload-byte, CPU-time and request-rate protections. Because embedded attachments cannot be counted until OCR, the run reserves 650 pages. The agent run is admitted only after a multi-dimensional reservation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ZVnFEz_UynsVNpQQ6iA5w.png" /><figcaption><em>Worked example: one claims bundle, five dimensions</em></figcaption></figure><p>While this job runs, a second job requests 500 pages. Only 350 pages are unreserved (1,000 − 650), so the atomic check fails, and nothing is mutated, even though the first job has committed no actual page usage. A balance-then-record design would have shown 1,000 available to both jobs. Even after the first job settles, 413 pages remain, still fewer than 500, so queueing would not help; the response should offer a smaller batch or an allocation-increase request.</p><p>The first run completes within its envelope. At settlement, committed high-risk tool usage is 1,613 calls (1,590 + 23), above the 80% threshold. The run was already admitted and is unaffected, but the next reservation for that tool now requires approval. Settlement commits actual values, releases the unused reservation and frees the concurrency lease, and the ledger records one idempotent event per chargeable operation.</p><h3>Reservation state, retries and recovery</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VJJhBO9y5lEkJ8cNGfkfww.png" /></figure><p><em>A reservation is not merely a counter. It is a recoverable state machine in which every path ends in a terminal state, and terminal transitions are idempotent and auditable. “Released” means returned with no usage recorded; “committed” includes releasing the unused portion.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sTwZSgSy412xgl7EU61qXw.png" /><figcaption><em>Every failure mode needs a named control</em></figcaption></figure><p>The transactional outbox pattern persists state and publishes an event without a distributed transaction; consumers still need idempotency because delivery may repeat. (<a href="https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/transactional-outbox.html">AWS transactional outbox</a>)</p><p>Treat the quota service as part of the control plane, with its own service-level objectives: admission latency and error rate; decisions by outcome and metric; active and expired reservations; finalization lag; Redis-versus-ledger drift; duplicate or missing events; policy-cache age; and projected exhaustion by tenant. Avoid high-cardinality tenant identifiers in metric labels, and keep tenant-level evidence in traces, logs, and the ledger under access controls and retention.</p><h3>Limits of this reference design</h3><p>This pattern improves control; it does not create perfect global certainty.</p><ul><li><strong>Multi-region consistency:</strong> active-active regions cannot enforce one strict global ceiling without coordination, partition trade-offs, or regionally delegated budgets.</li><li><strong>Estimate accuracy:</strong> agent paths and streaming outputs remain uncertain, so top-ups, truncation, and safety margins are operational necessities.</li><li><strong>Provider measurement:</strong> token accounting and pricing categories vary; normalize them while retaining the provider’s original numbers for dispute and replay.</li><li><strong>Strictness versus availability:</strong> every fail-closed choice can reduce service availability, and every fail-open choice weakens the ceiling.</li><li><strong>Operational cost:</strong> atomic multi-key reservation, lease management, and bidirectional reconciliation are real burdens. Enforce only the dimensions whose risk justifies them.</li></ul><h3>Implementation checklist</h3><ol><li>Define canonical consumption units and owners, and instrument usage events in observe-only mode.</li><li>Separate gateway rate, runtime concurrency, and cumulative quota policies.</li><li>Choose the atomic allocation boundary and Redis Cluster key strategy.</li><li>Make reservation creation and finalization idempotent.</li><li>Add agent-run envelopes with top-up and stop behavior.</li><li>Define fail-open or fail-closed posture per metric.</li><li>Persist open reservations and build ledger-driven reconstruction.</li><li>Add per-tenant allocation, burst borrowing or fair scheduling.</li><li>Test lost admission responses, Redis failover, cycle rollover, leaked leases and streaming aborts.</li><li>Expose committed, reserved, available, and projected exhaustion separately, and map ledger immutability and retention to contractual and regulatory obligations.</li></ol><h3>Architect’s takeaway</h3><p>Rate limits protect arrival speed. Concurrency limits protect scarce execution capacity. Quotas protect cumulative entitlement and economic boundaries. For multi-step AI agents, those controls become reliable only when reservations, idempotent settlement, durable evidence, and recovery are designed together.</p><p><strong>Admit quickly. Measure precisely. Settle idempotently. Reconcile continuously.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dae38686a87a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Harness Behind the Agent]]></title>
            <link>https://kindlingknowledge.medium.com/the-harness-behind-the-agent-59dbb7115f29?source=rss-1888a8d4ce78------2</link>
            <guid isPermaLink="false">https://medium.com/p/59dbb7115f29</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[agent-harness]]></category>
            <dc:creator><![CDATA[Krishna Kumar Akurathi]]></dc:creator>
            <pubDate>Tue, 08 Sep 2026 13:38:04 GMT</pubDate>
            <atom:updated>2026-09-08T13:38:04.917Z</atom:updated>
            <content:encoded><![CDATA[<p>What actually turns a language model into a working AI agent—and what breaks when that layer is missing?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YFiURaVYlgBuKWGTDwWJmg.png" /></figure><p>Every few weeks, another AI agent demo goes viral: one that files a support ticket, refactors a codebase, or approves a loan application end-to-end. Then someone tries to run the same thing in production, against real systems, with real consequences for a wrong move, and it falls apart. The model didn’t get dumber. Nobody built the layer that sits between the model and the real world.</p><p>That layer has a name now: the <strong>agent harness</strong>. Understanding it is the key to understanding why some AI agents stay demos and others become products.</p><h3>The one-line definition</h3><p>Ask a language model to “fix the bug in checkout.py” and, on its own, it will do exactly one thing: generate text describing how it would fix it. It won’t open the file. It won’t run the tests. It has no hands.</p><p>The industry has settled on a compact way to say this:</p><blockquote><strong><em>Agent = Model + Harness</em></strong></blockquote><p>The model is the reasoning engine: it decides what to do next. The harness is everything that turns that decision into a real, verified action — the loop that keeps the task moving, the tools the model is allowed to call, the memory of what’s happened so far, and the guardrails that stop it from doing something it shouldn’t. Take the harness away, and what’s left is a very articulate autocomplete.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YcoEzS13_4GK5tgwcQHNGg.png" /><figcaption>The model proposes. The harness is what actually does anything.</figcaption></figure><h3>Is this a new idea?</h3><p>Mostly not, though one part of it genuinely is. The underlying mechanics have existed since 2023: the “reason, act, observe” loop known as ReAct, and models that could call external tools, described in the Toolformer paper. AutoGPT was the public face of “AI agents” running loose on the internet not long after.</p><p>What’s new is treating this layer as its own engineering discipline rather than glue code written once and forgotten. The term “harness engineering” only became common currency in 2026, and it came with an argument: as models from different labs converge on similar raw capability, the model stops being the differentiator. The harness around it — how well it manages context, how it recovers from failure, how tightly it’s scoped — becomes what decides whether an agent can be trusted to run unattended.</p><p>The shorthand making the rounds puts it bluntly:</p><blockquote>The model is a commodity. The harness is the moat.</blockquote><p>One team reported removing 80% of their agent’s available tools and getting better results — not from a smarter model, but from a better-designed harness.</p><h3>What’s actually inside a harness</h3><p>Strip away the branding, and a harness is doing four distinct jobs. None of them are the model’s job.</p><p><strong>A loop that keeps score.</strong> Call the model, interpret what it asked for, act on it, feed the result back, and decide whether to continue, retry, or stop. Without this, every model response is a one-shot guess with nobody checking whether it landed.</p><p><strong>A tool interface.</strong> A defined, bounded set of things the model is allowed to touch—a file editor, an API, a database query—each with real permissions and real limits, not just a name in a prompt.</p><p><strong>Context management.</strong> Long tasks generate more transcript than fits in any model’s context window. Something has to actively decide what stays, what gets summarized, and what gets dropped — the model itself can’t do this from inside the conversation it’s having.</p><p><strong>Control, independent of the model’s cooperation.</strong> Approval gates before a risky action runs, validation after it runs, and hard limits that hold even if the model tries to talk its way past them. This is the part that separates a demo from something you’d trust with production data.</p><p>Put those four together and scaffold them around one agent doing one job, and you get something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6G2rvEVrZYURce0dsd8IRA.png" /><figcaption>One agent’s complete harness: every proposal from the model passes through a policy check before it executes and through validation after — nothing is taken on faith.</figcaption></figure><h3>What happens when it isn’t there</h3><p>This is the part worth sitting with, because it’s rarely visible until something has already gone wrong. A model with no harness — or a badly built one — doesn’t fail loudly. It fails by <em>seeming</em> to succeed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x5Rn40StOuv3cyVeanM5Ig.png" /><figcaption><em>Same request, same model. The difference is entirely the layer wrapped around it.</em></figcaption></figure><p>Without a harness, or with a thin one, an agent can report a task complete when the underlying action silently failed — there’s no independent step checking its work. It can burn through its context window mid-task and start hallucinating steps it never took. It can be handed a tool it barely understands and misuse it confidently. And with no guardrails between “the model decided to” and “the action happened,” a capable model with real access can take an irreversible action — deleting a file, sending a message, moving money — with nothing standing between the decision and the consequence. Good harness design isn’t paranoia. It’s the difference between an agent you can leave unattended and one you have to watch every second.</p><h3>Beyond one agent: the Graph and the Meta-Harness</h3><p>Everything above describes a single agent doing a single job well. Real work rarely stays that contained. A loan application isn’t handled by one agent: it gets extracted by one, scored by another, and routed to a compliance specialist only if it’s flagged. That requires two more layers above the harness itself.</p><p>The <strong>Graph</strong> decides what runs next: which agent handles this step, what happens on a branch, what gets retried, and what state carries forward to the next hop. The <strong>Meta-Harness</strong> sits above the Graph and governs the whole fleet rather than any single task: which agents are allowed to exist, which agent may share data with which other agent, when a human has to sign off, and how every agent’s actions get stitched into one auditable trail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E9RpyzvKR137DBV7kbNJXg.png" /><figcaption><em>The Graph decides what runs next. The Meta-Harness decides what’s allowed to run at all — and it’s never on the critical path of getting the task done, only on the path of keeping it accountable.</em></figcaption></figure><p>This split matters because it maps directly onto how failures get diagnosed. “The workflow picked the wrong next step” is a Graph problem. “An agent was allowed to see data it had no business seeing” is a Meta-Harness problem. Collapse the two into one undifferentiated layer, and it becomes much harder to tell which part of the system actually broke.</p><h3>The takeaway</h3><p>An AI agent isn’t a smarter chatbot. It’s a model wrapped in engineering that most people never see: a loop that verifies instead of assumes, a deliberately narrow tool surface, a context window that’s actively managed rather than left to fill up, and controls that hold even when the model would rather they didn’t. None of this is exotic. Most of it is the same discipline that has always separated a working system from a clever prototype. It has simply gained a name — and in 2026, it’s where the real competitive advantage in agentic AI is being built.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59dbb7115f29" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Architecture Tax: Why Security, Scalability, and Stability Can’t Be Retrofitted]]></title>
            <link>https://systemweakness.com/the-architecture-tax-why-security-scalability-and-stability-cant-be-retrofitted-b01b3042a882?source=rss-1888a8d4ce78------2</link>
            <guid isPermaLink="false">https://medium.com/p/b01b3042a882</guid>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[stability]]></category>
            <category><![CDATA[technical-debt]]></category>
            <category><![CDATA[scalability]]></category>
            <dc:creator><![CDATA[Krishna Kumar Akurathi]]></dc:creator>
            <pubDate>Mon, 29 Dec 2025 11:17:47 GMT</pubDate>
            <atom:updated>2026-02-09T09:58:00.484Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Features win demos. Security, scalability, and stability win years.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pD0LmOomwFscOTw6s0YRKg.jpeg" /></figure><p>As 2025 comes to a close, I’ve been reflecting less on <em>features shipped</em> and more on <em>systems that survived</em>.</p><p>Across years of building cloud-native platforms, identity layers, document pipelines, and distributed systems, one truth has become impossible to ignore:</p><blockquote>The most expensive mistake in software engineering isn’t bad code. It’s treating foundational pillars as <em>“non-functional requirements”</em> that can be bolted on later.</blockquote><p>I call this the <strong>Architecture Tax</strong>. This article is not a checklist. It’s a philosophy shaped in incident calls, postmortems, and long nights in the 3 AM war room.</p><h3>1. The Three Pillars That Decide a System’s Lifespan</h3><p>Most systems don’t fail because the business logic was wrong. They fail because the <strong>foundations were never designed to hold pressure</strong>.</p><p>Security, Scalability, and Stability define:</p><ul><li><em>how safely a system operates</em></li><li><em>how confidently it grows</em></li><li><em>how predictably it behaves under stress</em></li></ul><p>These are not optimizations. They are <strong>architectural decisions with long half-lives</strong>.</p><h3>2. Security: A Design Constraint, Not a Feature</h3><p>Security is often postponed with phrases like:</p><ul><li><em>“We’ll lock it down later.”</em></li><li><em>“It’s internal, so it’s safe.”</em></li><li><em>“Auth can be added anytime.”</em></li></ul><p>In reality, <strong>security is a constraint that shapes architecture</strong>, not a feature that can be layered on later.</p><h3>What Happens When Security Is an Afterthought?</h3><ul><li><em>Over-privileged users and services</em></li><li><strong><em>Hard-coded secrets and long-lived credentials</em></strong></li><li><strong><em>Authorization logic scattered across services</em></strong></li><li><strong><em>Tight coupling between identity and application code</em></strong></li></ul><p>These issues rarely hurt on day one.</p><p>They surface during audits, incidents, acquisitions, or scale — when fixing them is no longer cheap or isolated.</p><blockquote>If security isn’t designed early, you don’t save time — you accumulate invisible risk with compound interest.</blockquote><h3>3. Scalability: Architecture, Not Optimization</h3><p>Scalability is often misunderstood as:</p><blockquote>“We’ll optimize when traffic increases.”</blockquote><p>But scalability is <strong>decided long before traffic arrives</strong>.</p><h4>Early Decisions That Create Scalability Debt</h4><ul><li><em>Synchronous calls everywhere</em></li><li><em>Shared mutable state</em></li><li><em>Tight coupling between services</em></li><li><em>No rate limits or quotas</em></li><li><em>Assuming today’s load is tomorrow’s norm</em></li></ul><p>These choices feel harmless early on. At scale, they become <strong>structural blockers</strong>.</p><h3>The Foundational Cure: Asynchrony</h3><p>Scalable systems lean heavily on:</p><ul><li><strong><em>Asynchronous communication</em></strong></li><li><strong><em>Event-driven architecture</em></strong></li><li><strong><em>Loose coupling via queues, streams, and events</em></strong></li></ul><p>Asynchrony isn’t just about performance — it’s about <strong>absorbing variability without collapsing</strong>.</p><blockquote>Scalability debt doesn’t show up as errors. It shows up as <strong>fear of releasing changes</strong>.</blockquote><h3>4. Stability: The Size of Your Blast Radius</h3><p>Stability is rarely celebrated.</p><p>It only becomes visible when it’s missing. Stability is not uptime.</p><p>It is the ability of a system to:</p><ul><li><em>fail in isolation</em></li><li><em>degrade gracefully</em></li><li><em>recover automatically</em></li><li><em>remain observable under stress</em></li><li><strong><em>Limit the impact of a single service failure to its own domain</em></strong></li></ul><h3>How Systems Actually Go Down</h3><p>Most major outages aren’t caused by a single bug. They’re caused by an <strong>uncontrolled blast radius</strong>:</p><ul><li><em>Unbounded retries</em></li><li><em>Missing timeouts</em></li><li><em>Cascading synchronous dependencies</em></li><li><em>Shared infrastructure without isolation</em></li><li><em>Invisible failures across async boundaries</em></li></ul><blockquote>These are not bugs. They are <strong>design omissions</strong>.</blockquote><p>High stability is impossible without observability. Without metrics, logs, and traces, teams are flying blind — relying on guesswork instead of diagnosis.</p><blockquote>Stability is the delta between an incident happening and the system (or the team) knowing <strong>exactly why</strong> it happened.</blockquote><h3>5. Technical Debt: The Interest You Didn’t Know You Were Paying</h3><h3>Why Call It an “Architecture Tax”?</h3><p>The term <em>Architecture Tax</em> is intentional.</p><p>Just like real-world tax, security, scalability, and stability are the <strong>mandatory price of operating in a professional production environment</strong>.</p><p>You can avoid paying it early to “move fast” or “save cost.” But the <em>Internal Revenue Service of production</em> always comes to collect, usually at the worst possible time, and always with heavy interest.</p><p>That interest shows up as:</p><ul><li><em>emergency rewrites</em></li><li><em>long outages</em></li><li><em>frozen roadmaps</em></li><li><em>burned-out teams</em></li><li><em>loss of trust that is painfully hard to recover</em></li></ul><blockquote>The choice is never <strong>whether</strong> you’ll pay this tax. The only choice is <strong>when</strong>.</blockquote><h3>Architectural Debt in Practice</h3><p><strong>Security</strong></p><ul><li><em>Short-term gain</em>: Faster delivery</li><li><em>Long-term cost</em>: Breaches, audits, redesigns</li></ul><p><strong>Scalability</strong></p><ul><li><em>Short-term gain</em>: Simpler systems</li><li><em>Long-term cost</em>: Rewrites, outages, growth ceilings</li></ul><p><strong>Stability</strong></p><ul><li><em>Short-term gain</em>: Less upfront effort</li><li><em>Long-term cost</em>: Firefighting, burnout, trust erosion</li></ul><p>Architectural debt compounds because:</p><ul><li><em>Every new feature builds on weak foundations</em></li><li><em>fixes become invasive instead of isolated</em></li><li><em>Fewer people fully understand the system over time</em></li></ul><blockquote>Eventually, the system starts controlling the team.</blockquote><h3>6. Why These Can Never Be Afterthoughts</h3><p>Here’s the uncomfortable truth:</p><blockquote><strong>It is always cheaper to design these early than to retrofit them later.</strong></blockquote><p>Early investment:</p><ul><li><em>adds thinking, not complexity</em></li><li><em>creates clean boundaries</em></li><li><em>enables confident scaling</em></li><li><em>reduces long-term cognitive load</em></li></ul><p>Late fixes:</p><ul><li><em>touch multiple components</em></li><li><em>introduce regressions</em></li><li><em>slow delivery permanently</em></li><li><em>consume senior engineering attention repeatedly</em></li></ul><h3>7. The Mindset Shift: Designing for Failure First</h3><p>High-performing teams don’t ask:</p><blockquote>“Is this secure, scalable, and stable?”</blockquote><p>They ask:</p><blockquote><strong>“What failure mode are we consciously accepting?”</strong></blockquote><p>One powerful practice is a <strong>Pre-Mortem</strong>:</p><ul><li><em>Assume the system has already failed</em></li><li><em>Work backward to identify why</em></li><li><em>Design guardrails before production teaches the lesson painfully</em></li></ul><blockquote>This turns postmortems from reactive documents into proactive design tools.</blockquote><h3>8. Principles I Carry Forward</h3><p>As I close the year, these principles are non-negotiable for me:</p><ol><li><em>Security must be explicit, never implicit</em></li><li><em>Scalability must be architectural, not reactive</em></li><li><em>Stability must be intentional, not assumed</em></li><li><em>Observability is part of the system contract</em></li><li><em>Every shortcut must be conscious — and documented</em></li></ol><h3>9. Closing Thoughts</h3><p>Great systems aren’t defined by how fast they are built, but by <strong>how calmly they behave under pressure</strong>.</p><p>Security, scalability, and stability do not slow teams down.</p><p>They protect momentum, preserve trust, and extend system life.</p><p>In a world of distributed systems, AI workflows, and autonomous components, these pillars are no longer optional.</p><p>They are the <strong>Architecture Tax</strong>, and paying it upfront is always cheaper than paying it later.</p><blockquote><strong>Final Thought:</strong></blockquote><blockquote>Anyone can ship features. Security, scalability, and stability are what separate systems that impress from systems that endure.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b01b3042a882" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/the-architecture-tax-why-security-scalability-and-stability-cant-be-retrofitted-b01b3042a882">The Architecture Tax: Why Security, Scalability, and Stability Can’t Be Retrofitted</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From API-First to AI-First: The Next Evolution in Digital Product Strategy]]></title>
            <link>https://kindlingknowledge.medium.com/from-api-first-to-ai-first-the-next-evolution-in-digital-product-strategy-949dc8af47ea?source=rss-1888a8d4ce78------2</link>
            <guid isPermaLink="false">https://medium.com/p/949dc8af47ea</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[product-strategy]]></category>
            <category><![CDATA[genai]]></category>
            <dc:creator><![CDATA[Krishna Kumar Akurathi]]></dc:creator>
            <pubDate>Thu, 10 Jul 2025 14:33:47 GMT</pubDate>
            <atom:updated>2025-07-10T14:33:47.761Z</atom:updated>
            <content:encoded><![CDATA[<p>Your APIs are feature-proof. But are they future-proof?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oZAQ_Xb6a2iLct6ZvnSShQ.png" /></figure><h3>What was API-First, and Why was It Important?</h3><p>API-first design puts APIs at the center of software development. Instead of building monolithic applications and exposing APIs afterward, teams design APIs upfront as primary products. This approach brings:</p><ul><li>Clear contract boundaries between services</li><li>Scalable microservice architectures</li><li>Developer ecosystems and integrations</li><li>Better maintainability and version control</li></ul><p>In the API-first world, everything is a well-defined request-response interface. However, this model has its limitations when we enter the world of AI.</p><h3>What Does AI-First Mean?</h3><p>AI-First goes beyond exposing functionality via APIs. It embeds intelligence directly into user interactions, business workflows, and decision-making processes.</p><p>In an AI-first system:</p><ul><li>The system doesn’t just respond; it understands, predicts, recommends, and adapts.</li><li>The primary interface may not even be API calls — it could be natural language, images, or multi-modal inputs.</li><li>Instead of returning fixed outputs, the system generates context-sensitive, often non-deterministic results.</li></ul><p>AI-first thinking is about making intelligence a core capability, not an afterthought.</p><h3>API-First vs AI-First — Key Differences</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B1ZJVwfE-3iVEZx72SxKyg.png" /></figure><h3>AI APIs vs Non-AI APIs</h3><p>Even in an API-first world, not all APIs are the same. The nature of AI APIs introduces new design considerations:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sM1ITXOQ3TD2xG-c-q-dqQ.png" /></figure><blockquote><em>AI-first doesn’t mean eliminating APIs. It means rethinking what kind of APIs we design, how they behave, and how we govern them.</em></blockquote><h3>Why the Transition is Happening</h3><p>AI-first systems unlock capabilities that API-first designs alone cannot achieve:</p><ul><li>Conversational interfaces (chatbots, voice assistants)</li><li>Intelligent agents (copilots, autonomous agents)</li><li>Personalized recommendations</li><li>Predictive analytics and forecasting</li><li>Summarization and document understanding</li><li>Visual search, image generation, code generation</li></ul><p>These are no longer “nice-to-have” features. They are becoming core business differentiators.</p><h3>Architecture Evolution — From API-First to AI-First</h3><h3>Stage 1: API-First Architecture</h3><ul><li>Microservices with RESTful APIs</li><li>Stateless request-response flows</li><li>Clear contracts and versioned interfaces</li></ul><h3>Stage 2: AI-Augmented API-First</h3><ul><li>APIs wrapping AI models</li><li>AI-enhanced endpoints (personalization, recommendations)</li><li>Hybrid monitoring (API uptime plus model performance)</li></ul><h3>Stage 3: AI-First Architecture</h3><ul><li>AI models as primary execution engines</li><li>Context orchestration (RAG pipelines, agent frameworks)</li><li>Natural language and multimodal user interfaces</li><li>Continuous learning pipelines with feedback loops</li></ul><h3>Visual Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3t9en1fTnoOWUo9-xQIshw.png" /></figure><h3>New Challenges in AI-First Systems</h3><ul><li><strong>Explainability</strong>: Can users and regulators understand model decisions?</li><li><strong>Trust &amp; Safety</strong>: Can we prevent hallucinations or biased outputs?</li><li><strong>Data Privacy</strong>: How is data used, shared, and secured?</li><li><strong>Model Governance</strong>: How are models monitored, retrained, and versioned?</li><li><strong>Security Threats</strong>: Prompt injection, adversarial attacks</li></ul><h3>Real-World Examples</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jlqxDqF6LaEjodxVUdAtjw.png" /></figure><h3>How to Prepare for AI-First</h3><ul><li>Start small: Experiment with AI augmentation around existing APIs.</li><li>Build high-quality data pipelines for model training.</li><li>Establish evaluation pipelines with human-in-the-loop feedback.</li><li>Shift monitoring to include model accuracy and drift detection.</li><li>Educate teams on prompt engineering and AI safety.</li><li>Create ethical AI governance processes.</li></ul><h3>Conclusion</h3><p>API-first enabled us to modularize, scale, and integrate faster. But the next generation of products won’t just connect services — they will understand, decide, and adapt in real-time.</p><p><strong>AI-first is not about replacing APIs. It’s about evolving the role of APIs to enable intelligent, adaptive, and human-centered systems.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=949dc8af47ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chatbots to Agentic AI: Evolution of Intelligent Systems]]></title>
            <link>https://kindlingknowledge.medium.com/chatbots-to-agentic-ai-evolution-of-intelligent-systems-8fdcf50e533c?source=rss-1888a8d4ce78------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fdcf50e533c</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[future-of-technology]]></category>
            <category><![CDATA[evolution-of-ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Krishna Kumar Akurathi]]></dc:creator>
            <pubDate>Sun, 01 Jun 2025 10:55:20 GMT</pubDate>
            <atom:updated>2025-06-01T10:56:34.425Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xmNAYkaCWFz-HSWj4-EjNw.png" /></figure><h3>Introduction</h3><p>The evolution of intelligent systems — from simple chatbots to agentic AI — has transformed how we interact with technology. While these terms often overlap, they differ in autonomy, reasoning, and capability. This article explores each category, clarifies its characteristics, and provides real-world examples to help you understand where we are and where we’re headed in the AI landscape.</p><h3>Goal vs Task: Understanding the Difference</h3><p>Before we dive into the different types of AI agents, let’s first understand two foundational concepts that underpin them all: goals and tasks.</p><p>Understanding the distinction between a <strong>goal</strong> and a <strong>task</strong> is essential in designing agent-based systems.</p><h3>Goal</h3><p>A high-level desired outcome or objective. It answers <strong>why</strong> something needs to be done, often defined by the user or environment.</p><p>Example: “Write a blog on AI safety”</p><h3>Task</h3><p>A specific, atomic action or step taken to fulfill a goal. It answers <strong>how</strong> the goal is achieved, often created and executed by the agent.</p><p>Example: <em>“Research articles on AI safety”</em>, <em>“Draft introduction”</em>, “Generate outline”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dCbGhfdernklpRzNE-WcvA.png" /></figure><h3>1. Chatbot</h3><h3>What is a Chatbot?</h3><p>A chatbot is a rule-based or intent-based software application designed to simulate human-like conversations, typically in text or voice. Most are narrow in scope and follow predefined scripts.</p><h3>Key Characteristics</h3><ul><li>Scripted responses or simple intent recognition</li><li>No reasoning or autonomy</li><li>Ideal for FAQs, simple workflows, or menu-driven interactions</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bw8_KBZN2JlXfsPhxsveaw.png" /><figcaption>Chatbot Real-world Examples</figcaption></figure><h3>2. AI Agent</h3><h3>What is an AI Agent?</h3><p>An AI agent can perceive inputs, reason or plan based on those inputs, and take actions to achieve goals. Unlike chatbots, AI agents often work with broader contexts and can adapt over time.</p><h3>Key Characteristics</h3><ul><li>Goal-oriented behavior</li><li>Uses reasoning or ML to decide actions</li><li>May use APIs, databases, or tools</li><li>Often reactive (responds to stimuli)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KVbxPIHv60fku2frDtaM7Q.png" /><figcaption>AI Agent Real-world Examples</figcaption></figure><h3>3. Autonomous AI Agent</h3><h3>What is an Autonomous AI Agent?</h3><p>Autonomous agents operate with minimal human input. They can set goals, plan and execute multi-step tasks, utilize tools, learn from outcomes, and sometimes even reflect on errors.</p><h3>Key Characteristics</h3><ul><li>End-to-end task execution</li><li>Decision-making with minimal intervention</li><li>Often includes memory and self-healing logic</li><li>Used in automation, research, or exploration</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2apVDm2BvvqyX0jh8qUng.png" /><figcaption>Autonomous AI Real-world Examples</figcaption></figure><h3>4. Agentic AI</h3><h3>What is Agentic AI?</h3><p>Agentic AI refers to AI systems that demonstrate purposeful, goal-driven behavior with the ability to reflect, retry, and adapt their strategies, bringing them closer to true artificial agency.</p><h3>Key Characteristics</h3><ul><li>Self-reflection and learning</li><li>Long-term goal planning</li><li>May use memory, tools, APIs, and collaborate with other agents</li><li>Often part of multi-agent ecosystems</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*um7TmHFmE4VWhWCgBd9LyQ.png" /><figcaption>Agentic AI Real-world Examples</figcaption></figure><h3>Feature Comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TMP9ROSsGxZtu-SM8jplLQ.png" /><figcaption>Feature comparison</figcaption></figure><h3>Agentic AI: A Paradigm, Not a Framework</h3><p>It’s important to understand that <strong>Agentic AI is not a tool or library</strong> — it’s a <strong>design paradigm</strong> or <strong>approach</strong>, much like <strong>Agile in software development</strong>.</p><blockquote><em>Just like Agile is a set of values and principles that can be implemented via Scrum or Kanban, Agentic AI is a philosophy realized through tools like </em><strong><em>LangGraph</em></strong><em>, </em><strong><em>CrewAI</em></strong><em>, or </em><strong><em>AutoGen</em></strong><em>.</em></blockquote><h3>Think of it like this:</h3><ul><li><strong>Agentic AI = the “how to think”</strong></li><li><strong>CrewAI, LangGraph = the “how to build”</strong></li></ul><p>This mindset helps you design systems where agents aren’t just reactive — they are <strong>purposeful</strong>, <strong>reflective</strong>, and <strong>autonomous</strong> in their behaviors.</p><h3>Understanding Intent and Intent Recognition</h3><h3>What is Intent?</h3><p>Intent refers to the user’s underlying goal when they interact with a system.</p><h3>What is Intent Recognition?</h3><p>The process of analyzing input and determining what the user wants to do, typically using NLP.</p><h3>Recognized Intent Examples:</h3><ul><li>“What’s the weather in Delhi?” → GetWeather</li><li>“Remind me to call Mom” → SetReminder</li><li>“Cancel my flight booking” → CancelBooking</li></ul><h3>Importance of Intent</h3><ul><li><strong>Chatbots</strong> — Crucial for mapping messages to workflows</li><li><strong>AI Agents</strong> — Guides task selection and reasoning</li><li><strong>Autonomous AI</strong> — Needed to define initial goals</li><li><strong>Agentic AI</strong> — Drives planning and tool invocation</li><li><strong>RPA</strong> — Optional; used when NLP is involved</li></ul><h3>Autonomy vs Agency: Can AI Reflect and Adapt?</h3><p><strong>Key Insight:</strong><br>Autonomous agents can act independently, but only <strong>agentic AI</strong> is designed to reflect, retry, and adapt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*cn4NRSJf2nNP0OkwLE04aQ@2x.jpeg" /></figure><h3>Analogy</h3><p><strong>Autonomous Agent</strong> = Skilled intern with a checklist<br><strong>Agentic AI</strong> = Proactive team member who reflects, learns, and improves the plan</p><p><strong>Conclusion:</strong><br>Autonomy enables action.<br>Agency enables <em>intelligent, reflective, and adaptive</em> action — and that’s the future of AI.</p><h3>The Agent Intelligence Loop:</h3><h3>Perceive → Reason → Act</h3><h3>Example: AI Calendar Assistant</h3><ul><li><strong>Perceive</strong>: Detects event conflict</li><li><strong>Reason</strong>: Evaluates importance</li><li><strong>Act</strong>: Suggests rescheduling</li></ul><h3>Conclusion</h3><p>From basic chatbots to self-aware agentic AI, we’re seeing an evolution in both capability and autonomy. Understanding this progression helps us design better systems — ones that go from simply answering questions to driving complex decision-making and goal completion. The future isn’t just conversational; it’s agentic, where AI doesn’t just respond but thinks, adapts, collaborates, and acts with purpose.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fdcf50e533c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Agents vs Agentic AI: Detailed Analysis]]></title>
            <link>https://kindlingknowledge.medium.com/ai-agents-vs-agentic-ai-detailed-analysis-e8d492062d26?source=rss-1888a8d4ce78------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8d492062d26</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Krishna Kumar Akurathi]]></dc:creator>
            <pubDate>Sun, 18 May 2025 05:52:09 GMT</pubDate>
            <atom:updated>2025-05-18T05:52:09.775Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CGCF9B-vftjdhuAdUhU-KA.png" /><figcaption>AI Agents — Agentic AI</figcaption></figure><h3>1. Introduction</h3><p>Not all AI is created equal.</p><p>In a world buzzing with AI copilots, chatbots, and digital assistants, there’s a silent revolution happening — the rise of <strong>Agentic AI</strong>.</p><p>It’s not just about responding to prompts anymore. It’s about <strong>understanding goals</strong>, <strong>planning</strong>, and <strong>acting with autonomy</strong>. While <strong>AI Agents</strong> are here to help, <strong>Agentic AI</strong> is here to <strong>own the outcome</strong>.</p><p>This article breaks down the difference, with real-world examples, diagrams, side-by-side comparisons, and a look into what makes Agentic AI <em>truly intelligent</em>.</p><p>If you’ve ever wondered why one system just answers… while another <strong>orchestrates</strong> — you’re in the right place.</p><p>In the evolving landscape of Artificial Intelligence, the concepts of <strong>AI Agents</strong> and <strong>Agentic AI</strong> are gaining prominence. Though they sound similar, they differ fundamentally in their scope, complexity, and behavior.</p><h3>2. What is an AI Agent?</h3><p>An <strong>AI Agent</strong> is a system that performs a specific, well-defined task in response to input, often with limited or no memory, planning, or autonomy. These agents may appear goal-driven, but their “goal” is limited to the scope of a <strong>single interaction or task</strong>, not an overarching mission or outcome.</p><h3>Clarified Characteristics:</h3><ul><li>Task-oriented with short-lived objectives</li><li>Stateless or limited memory</li><li>Reactive (waits for instructions)</li><li>Executes a function or calls a tool/API when triggered</li><li>Not capable of multi-step reasoning or planning</li></ul><h3>Examples:</h3><ul><li>Chatbots that reply to a single question</li><li>Personal Assistants (e.g., Siri, Alexa)</li><li>Rule-based automation bots (e.g., RPA)</li><li>LLM-based tools that execute plugin calls</li></ul><h3>3. What is Agentic AI?</h3><p><strong>Agentic AI</strong> refers to an architectural paradigm where AI systems are <em>agent-like</em>, but enhanced with <em>planning, memory, reflection, tool use, and autonomy</em>. It allows AI to take initiative, plan multi-step tasks, and evolve over time.</p><h3>Characteristics:</h3><ul><li>Embodies true agency: Initiates and executes tasks</li><li>Maintains memory across sessions</li><li>Involves long-term planning and decision making</li><li>Uses tools and APIs autonomously</li><li>Often built using multi-agent systems</li></ul><h3>Examples:</h3><ul><li>AutoGPT, BabyAGI, Devin</li><li>CrewAI multi-agent orchestration</li><li>AI project managers or R&amp;D copilots</li></ul><h3>4. Self-Reflection in Agentic AI</h3><p>A defining characteristic of Agentic AI is its ability to <strong>self-reflect</strong> — to assess its own actions, evaluate output quality, and adapt future decisions accordingly.</p><h3>What is Self-Reflection?</h3><p>In AI terms, self-reflection is the process of reviewing whether the intended goal has been achieved, and if not, re-planning or retrying autonomously.</p><h3>Why It Matters:</h3><p>Without reflection, agents are just reactive. With reflection, they become strategic, adaptive, and more intelligent.</p><h3>Example:</h3><p>Imagine an Agentic AI tasked with booking a flight. It doesn’t just return a list — it checks if flights are available, re-plans when necessary, and may even alert you if the ticket price drops after booking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K0Vk_Bm0g5MMnFGMjh-TdA.png" /><figcaption>Self-Reflection Agentic AI</figcaption></figure><p><em>This feedback loop is what makes Agentic AI robust, autonomous, and iterative.</em></p><h3>4. Key Differences</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Nw69vmnoem81R2JGtV2pg.png" /></figure><h3>5. Task vs Goal:</h3><p>AI Agents and Agentic AI both work toward goals, but the <strong>scope, duration, and behavior differ drastically</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vFZHlny23WSA8qDC85HMVg.png" /></figure><h3>6. Real-World Example: Booking a Flight</h3><h3>Scenario: User says, “Book me a flight to Mumbai.”</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yv9hC8aSYqvgvqiLgWI7IA.png" /></figure><h3>7. Lifecycle Comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gOkfdLprXapQJWBN9F3w9w.png" /></figure><h3>8. Summary Table</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IY4aO2OnBV5gxCzHJyZKSw.png" /></figure><h3>9. Final Thought</h3><ul><li><strong>AI Agents</strong> are ideal for reactive, simple, or API-connected tasks.</li><li><strong>Agentic AI</strong> is the next evolution, especially for enterprises needing autonomous orchestration, research workflows, or multi-task coordination.</li><li>The line between the two is blurring with advancements in LLMs, memory, and tool integration.</li></ul><p>#aiagents #agenticai #ai #agenticai-selfreflection #agenticai-planning</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8d492062d26" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Speak AI: A Beginner’s Guide to Essential GenAI Terms]]></title>
            <link>https://kindlingknowledge.medium.com/speak-ai-a-beginners-guide-to-essential-genai-terms-6a99ca52b1ec?source=rss-1888a8d4ce78------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a99ca52b1ec</guid>
            <category><![CDATA[keyword-ai]]></category>
            <category><![CDATA[genai-terms]]></category>
            <category><![CDATA[ai-cheatsheet]]></category>
            <category><![CDATA[ai-terminologies]]></category>
            <dc:creator><![CDATA[Krishna Kumar Akurathi]]></dc:creator>
            <pubDate>Tue, 13 May 2025 12:36:05 GMT</pubDate>
            <atom:updated>2025-05-13T12:36:05.388Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction: Demystifying AI, One Term at a Time</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*r6euiJszM0o6gibXCfusaA.png" /></figure><p><strong>Artificial Intelligence (AI)</strong> and <strong>Generative AI (GenAI)</strong> have rapidly moved from research labs into our everyday lives, powering chatbots, writing assistants, code generators, and much more. Yet for many, the language of AI still feels complex and intimidating, full of unfamiliar terms like “tokens,” “temperature,” and “context window.”</p><p>This article is designed to bridge that gap.</p><p>We’ll explore essential AI and GenAI terms in simple, easy-to-understand language — no technical jargon, no confusion.<br>By the end, you’ll have the clarity and confidence to not only understand how AI works but also to use it more effectively in your own world.</p><p>Whether you’re a beginner, a tech enthusiast, or simply curious, this guide will unlock the concepts that make AI magic happen. Let’s dive in!</p><h3>AI vs. GenAI—What’s the Difference?</h3><h4><strong>AI</strong></h4><p>•	Broad field of computer science</p><p>•	Focuses on logic, prediction, decision-making, perception</p><p>•	Includes traditional ML, rule-based systems, computer vision</p><p>•	Examples: fraud detection, image classification</p><h4><strong>GenAI (Generative AI)</strong></h4><p>•	A specialized branch of AI focused on content creation</p><p>•	Generates text, images, audio, and code</p><p>•	Uses large models like GPT, Claude, Gemini</p><p>•	Examples: ChatGPT, image generation, code completion</p><h3>1. Core Building Blocks</h3><h3>Tokens</h3><p>A <em>token</em> is a small text, like a word or part of a word, that an AI processes at once.<br><strong>Why it matters</strong>: Tokens decide how much AI can read, remember, and respond at a time.</p><pre>Sentence: &quot;AI is amazing.&quot;<br>Tokens: [ &quot;AI&quot;, &quot; is&quot;, &quot; amazing&quot;, &quot;.&quot; ]</pre><h3>Context Length</h3><p>The maximum number of tokens AI can keep in memory during one conversation.<br><strong>Why it matters</strong>: Longer context = deeper understanding over longer conversations.</p><h3>Context Window</h3><p>The “moving window” of tokens that the AI focuses on to predict the next word.<br><strong>Why it matters</strong>: Larger context windows allow the AI to handle books or long chats.</p><pre>[ AI is amazing. GenAI powers the future. ]<br>      ^^^^^<br>Context Window</pre><h3>Context Length vs Context Window</h3><ul><li><strong>Context Length</strong>: The total number of tokens an LLM can consider at once (e.g., 4k, 8k, 32k tokens).</li><li><strong>Context Window</strong>: The moving “focus area” within that context length that the model uses to predict the next token.</li></ul><p><strong>Why it matters</strong>: A longer context window allows for more coherent long-form outputs.</p><pre>[AI][is][amazing][.][GenAI][powers][the][future][.]</pre><pre>First window → [AI][is][amazing][.] → Predicts: GenAI  <br>Next window → [is][amazing][.][GenAI] → Predicts: powers</pre><h3>2. Fine-Tuning the Output: Creativity and Control</h3><h3>Temperature</h3><p>Controls how creative vs. predictable the AI’s output is.</p><ul><li>Low temperature (e.g., 0.2) → predictable, safe answers.</li><li>High temperature (e.g., 0.8) → creative, surprising answers.</li></ul><pre>Low Temperature --&gt; &quot;AI is transforming the world.&quot;<br>High Temperature --&gt; &quot;AI is a wild ocean painting dreams.&quot;</pre><h3>Top-P (Nucleus Sampling)</h3><p>Instead of considering all possible next words, the AI picks from the most probable top “P” percent.<br><strong>Why it matters</strong>: Balances creativity with accuracy.</p><h3>Top-K Sampling</h3><p>Limits the next word choice to the top <em>K</em> most likely words.<br><strong>Why it matters</strong>: Another way to fine-tune output diversity.</p><h3>3. LLMs at Work</h3><h3>What is an LLM (Large Language Model)?</h3><p>A massive AI trained on huge datasets to understand and generate human-like text.<br><strong>Why it matters</strong>: LLMs are the engines behind ChatGPT, Gemini, Claude, and more.</p><h3>Parameters</h3><p>Parameters are the internal settings that an AI model learns during training — millions or even billions of tiny numbers (weights) that control how the model predicts the next word.</p><p><strong>Why it matters</strong>:<br>The more parameters a model has, the more complex patterns it can learn — but also the heavier (and sometimes slower) it becomes.</p><p>Example:</p><ul><li>GPT-2: 1.5 billion parameters</li><li>GPT-3: 175 billion parameters</li><li>Modern models like GPT-4, Claude 3 Opus have even more.</li></ul><pre>Model Size Examples:<br>- Small: 7 billion parameters<br>- Medium: 13 billion parameters<br>- Large: 175+ billion parameters</pre><pre>(Each parameter = a tiny knob that AI adjusts during learning.)</pre><h3>LLM as a Judge</h3><p>Using an LLM not to create but to <em>evaluate</em> other AI-generated outputs.</p><h3>LLM as a Jury</h3><p>Multiple LLMs independently evaluate, and a majority vote determines the outcome.<br><strong>Why it matters</strong>: Improves reliability and reduces single-model bias.</p><h3><strong>LLM as Judge vs Jury</strong></h3><h4>LLM as Judge:</h4><ul><li>One single LLM model evaluates content and makes a decision</li><li>Faster, simpler, but more prone to individual model bias</li></ul><h4>LLM as Jury:</h4><ul><li>Multiple LLMs evaluate the same content and vote or form a consensus</li><li>Slower, more robust, and reduces single-model bias</li></ul><h3>4. Prompting and Instruction Techniques</h3><h3>What is a Prompt?</h3><p>The input or instruction you give to an AI.</p><h3>Prompt Engineering</h3><p>Crafting smart, effective prompts to get better, clearer, or more accurate AI outputs.</p><h3>Prompt Injection</h3><p>A security risk where attackers insert hidden instructions inside prompts to manipulate the AI.</p><h3>Query</h3><p>A query is a request for information, typically factual and concise.</p><p><strong>Examples:</strong></p><ul><li>“Who is the CEO of Google?”</li><li>“Population of India 2024”</li></ul><h3>Prompt vs. Query— What’s the Difference?</h3><h4><strong>Prompt:</strong></h4><ul><li>A structured instruction to the model to generate or transform content</li><li>Usually includes more context or task-specific framing</li><li>Example: “Write a blog post about AI in education.”</li></ul><h4><strong>Query:</strong></h4><ul><li>A direct request to retrieve factual information</li><li>Typically short and aimed at finding an answer</li><li>Example: “Who is the CEO of Google?”</li></ul><h3>5. Smarter Thinking: AI Reasoning Patterns</h3><h3>Chain of Thought (CoT)</h3><p>Encouraging the AI to show intermediate reasoning steps before answering.<br><strong>Why it matters</strong>: Helps solve complex problems and improves transparency.</p><h3>Few-Shot Learning</h3><p>Teaching the AI by giving it a few examples inside the prompt.</p><h3>Zero-Shot Learning</h3><p>Asking the AI to perform a task without any examples, purely based on its understanding.</p><h3>6. Beyond Basic LLMs: How GenAI Applications Work (Bonus Section)</h3><h3>Retrieval-Augmented Generation (RAG)</h3><p>In RAG, before answering, the AI <strong>retrieves</strong> real-world information (from documents, databases, etc.).<br>It makes answers more accurate and up-to-date.</p><h3>Knowledge Base (KB)</h3><p>A structured collection of information that AI can search to find factual data.</p><h3>Chunking</h3><p>Splitting large documents into smaller pieces so AI can read and process them efficiently.</p><h3>Embeddings and Vectors</h3><ul><li><strong>Embedding</strong>: A way to convert text into a list of numbers based on meaning.</li><li><strong>Vector</strong>: The numerical list itself.</li></ul><p><strong>Why it matters</strong>: Embeddings and vectors allow AI to search and match meanings, not just exact words.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bT_bpk2Ikntrw4Ee1rKRWA.png" /><figcaption>RAG flow</figcaption></figure><h3>7. AI Safety and Limitations</h3><h3>Alignment</h3><p>Ensuring AI follows human values, ethics, and intended behavior.</p><h3>Hallucination</h3><p>When AI generates information that sounds correct but is wrong.<br><strong>Why it matters</strong>: You should always fact-check critical AI outputs.</p><h3>Quick Glossary</h3><ul><li><strong>Token:</strong> A unit of text processed by an LLM (e.g., words, subwords)</li><li><strong>Prompt:</strong> An instruction given to an LLM</li><li><strong>Query:</strong> A factual question expecting a direct answer</li><li><strong>Parameters:</strong> Internal weights in the model (more = more learning capacity)</li><li><strong>Temperature:</strong> Controls randomness of AI responses</li><li><strong>Context Window:</strong> The chunk of text AI considers at once</li><li><strong>Top-K:</strong> Picks the next word from the top K likely options</li><li><strong>Top-P:</strong> Picks from top cumulative probability mass (e.g., 90%)</li><li><strong>Judge:</strong> Single model evaluation</li><li><strong>Jury:</strong> Multi-model voting</li></ul><h3>Conclusion: Knowledge Unlocks Power in the Age of AI</h3><p>Understanding the fundamentals — tokens, temperature, context windows, parameters, and beyond — gives you more than just vocabulary.<br>It gives you control.</p><p>You now know how AI models think, how they generate, and how small changes can produce drastically different outcomes.<br>You’ve also glimpsed how advanced systems use retrieval, chunking, and embeddings to push GenAI beyond simple conversations.</p><p>In a world increasingly shaped by AI, knowledge is your superpower.<br>Stay curious, keep experimenting — and you’ll not just use AI, you’ll shape how it evolves.</p><p><strong>Remember: Behind every great AI interaction is a human who knows how it works. That human is now you.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a99ca52b1ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Future of AI is Collaborative: Building Multi-Agent Systems with Caching and Orchestration]]></title>
            <link>https://kindlingknowledge.medium.com/the-future-of-ai-is-collaborative-building-multi-agent-systems-with-caching-and-orchestration-94654eb81a80?source=rss-1888a8d4ce78------2</link>
            <guid isPermaLink="false">https://medium.com/p/94654eb81a80</guid>
            <category><![CDATA[multi-agent-ai]]></category>
            <category><![CDATA[multi-agent-systems]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Krishna Kumar Akurathi]]></dc:creator>
            <pubDate>Mon, 05 May 2025 16:42:15 GMT</pubDate>
            <atom:updated>2025-05-05T16:42:15.552Z</atom:updated>
            <content:encoded><![CDATA[<p>In the evolving landscape of AI, we’re seeing a significant shift from single monolithic models to <strong>multi-agent systems</strong>. These systems are autonomous, specialized agents working together — each with defined roles, tools, memory, and focus — coordinated through structured tasks and shared goals.</p><p>This article walks through the <strong>key components</strong>, <strong>task design</strong>, <strong>collaborative patterns</strong>, and a fully mapped <strong>real-world example</strong>, highlighting how <strong>caching</strong> enhances performance and scalability.</p><h3>What is an AI Agent?</h3><p>An <strong>AI Agent</strong> is a system that can <strong>perceive, reason, and act autonomously</strong> toward a defined goal.</p><p>Unlike traditional AI models that simply generate outputs when asked, an agent <strong>decides what action to take next</strong>, often based on memory, planning, and a broader context of tasks.</p><blockquote><strong><em>In simple terms:</em></strong><em><br>AI Models = Static responders.<br>AI Agents = Active decision-makers.</em></blockquote><p><strong>Example:</strong></p><ul><li>A text summarizer model simply compresses input text.</li><li>A summarizer agent decides <em>which document to summarize</em>, <em>how much detail is needed</em>, <em>what format is best</em>, and <em>whether to retry</em> if an error occurs.</li></ul><h3>What Is a Multi-Agent AI System?</h3><p>​At a high level, a multi-agent AI system is a coordinated team of AI agents, where each agent is assigned a specific role or task, and they work together, just like a team of humans would. This structure enables large tasks to be broken down into smaller, manageable parts, with specialized agents tackling each segment efficiently.</p><h3>The Four Pillars of a Multi-Agent AI System</h3><h3>1. Agents</h3><p>Agents are autonomous entities assigned with specific roles like researcher, planner, or coder.<br>Each agent exhibits</p><ul><li><strong>Role-playing</strong>: Defined responsibilities (e.g., analyst, summarizer)</li><li><strong>Focus</strong>: Maintains contextual awareness</li><li><strong>Memory</strong>: Short-term, long-term, and entity-level memory</li><li><strong>Tools</strong>: Skillsets and capabilities to perform actions</li><li><strong>Guardrails</strong>: Ensures safe and predictable behavior</li><li><strong>Cooperation</strong>: Ability to work with others toward a common goal</li></ul><p><strong>Example:</strong><br>In a research and writing assistant system:</p><ul><li><strong>Research Agent</strong>: Searches and gathers information from trusted sources.</li><li><strong>Outline Agent</strong>: Organizes key ideas into a logical document structure.</li><li><strong>Writer Agent</strong>: Drafts detailed sections based on the outline.</li><li><strong>Reviewer Agent</strong>: Reviews the final document for accuracy and style.</li></ul><h3>2. Tasks</h3><p>Tasks act as blueprints for what needs to be done.<br>Well-defined tasks include:</p><ul><li>Clear objective and input-output expectations</li><li>Tools assigned at the <strong>task level</strong> override agent-level tools</li><li>Sequential, parallel, or hierarchical execution logic</li><li>Support for <strong>fault tolerance</strong> and <strong>resilience</strong></li></ul><p><strong>Example:</strong><br>Typical tasks include:</p><ul><li><strong>Researching</strong>: Collect background information.</li><li><strong>Structuring</strong>: Organize the collected data into a structured outline.</li><li><strong>Writing</strong>: Develop the structured points into detailed sections.</li><li><strong>Reviewing</strong>: Validate, proofread, and enhance the final article.</li></ul><h3>3. Tools</h3><p>Tools are extensions that empower agents to perform actions (e.g., web scraping, API querying, database access).<br>Key qualities:</p><ul><li><strong>Composable</strong>: Usable by multiple agents/tasks</li><li><strong>Fault-tolerant</strong>: Gracefully handles errors</li><li><strong>Caching-enabled</strong>: Reduces redundant computations, improves latency, and cuts API costs</li></ul><p><strong>Example:</strong><br>In the research assistant system:</p><ul><li><strong>Search API Tool</strong>: Used by the Research Agent.</li><li><strong>Summarizer Tool</strong>: Assists the Outline Agent.</li><li><strong>Writing Assistant Tool</strong>: Helps the Writer Agent.</li><li><strong>Grammar Checker Tool</strong>: Supports the Reviewer Agent.</li></ul><p>Caching ensures faster performance by reusing intermediate data across tasks.</p><h3>4. Orchestration</h3><p>The orchestrator (or coordinator) defines:</p><ul><li>Flow of tasks between agents</li><li>Handling of agent outputs and failure recovery</li><li>Scheduling logic and memory routing</li><li>Tool resolution (agent vs. task level)</li></ul><p><strong>Example:</strong><br>In the assistant system, the orchestrator:</p><ul><li>Triggers research → caches results</li><li>Feeds research outputs into the outlining task</li><li>Assigns outline sections to writing agents in parallel</li><li>Routes final drafts to reviewing agents</li></ul><p>It handles retries and maintains workflow resilience.</p><h3>Caching: The Unsung Hero</h3><p>In multi-agent workflows, repeated requests, such as fetching documents or APIs, can quickly become expensive and slow.</p><p><strong>How caching helps:</strong></p><ul><li><strong>Improves performance</strong> by storing intermediate results</li><li><strong>Reduces latency</strong> for repetitive queries (e.g., search, summaries)</li><li><strong>Decreases cost</strong> when using rate-limited APIs</li><li><strong>Enables the reuse</strong> of partial results across agents in collaborative tasks</li></ul><blockquote><strong><em>Example:</em></strong><em> If the Research Agent fetches articles via an API, caching avoids re-fetching during both outline creation and content writing.</em></blockquote><h3>Collaboration Patterns in Multi-Agent Systems</h3><p>Multi-agent collaboration can follow different execution patterns depending on task complexity and design:</p><ul><li><strong>Sequential</strong>: Agent A finishes, then Agent B starts<br><em>(e.g., planner → executor)</em></li><li><strong>Parallel</strong>: Multiple agents operate simultaneously<br><em>(e.g., writers drafting multiple sections at once)</em></li><li><strong>Hierarchical</strong>: Parent agent delegates sub-tasks to child agents<br><em>(e.g., a lead reviewer coordinating junior reviewers)</em></li></ul><h3>Real-World Example: Multi-Agent Research and Writing Assistant in Action</h3><p>Imagine the system receives a request:<br><strong>“Create a detailed research article on Climate Change impacts.”</strong></p><p>The <strong>Orchestrator</strong> kicks off the flow:</p><p><strong>Research Task</strong> → Assigned to <strong>Research Agent</strong></p><ul><li><strong>Tool Used</strong>: Search API + Summarizer</li><li>The Research Agent queries trusted sources, fetches articles, and summarizes findings.</li><li><strong>Caching</strong>: Search results and summaries are cached to avoid redundant future queries.</li></ul><p><strong>Outline Task</strong> → Assigned to <strong>Outline Agent</strong></p><ul><li><strong>Tool Used</strong>: Summarizer + Content Organizer</li><li>The Outline Agent reads the cached research summaries and builds a structured outline (Introduction, Causes, Effects, Solutions).</li></ul><p><strong>Writing Task</strong> → Assigned to <strong>Writer Agent</strong></p><ul><li><strong>Tool Used</strong>: Writing Assistant</li><li>Based on the structured outline, the Writer Agent drafts detailed paragraphs for each section.</li><li>Tasks are <strong>parallelized</strong> — different writers can work on different sections simultaneously for faster output.</li></ul><p><strong>Reviewing Task</strong> → Assigned to <strong>Reviewer Agent</strong></p><ul><li><strong>Tool Used</strong>: Grammar Checker + Fact Validator</li><li>The Reviewer Agent proofreads the full article, checks facts, validates coherence, and ensures tone and quality.</li></ul><p>Throughout this process:</p><ul><li><strong>The Orchestrator</strong> monitors progress, retries failed tasks if needed, and ensures smooth task hand-offs.</li><li><strong>Caching</strong> dramatically boosts performance — summarized research, outlines, and drafts are reused without re-fetching or reprocessing.</li></ul><p>By the end, the system generates a polished, fact-checked research article autonomously and efficiently.</p><blockquote><strong>Important:</strong> The example shared above illustrates just <strong>one way</strong> of designing and orchestrating a multi-agent AI system. Depending on the domain, tools, agent capabilities, and system goals, there are many other possible architectures and collaboration strategies.</blockquote><h3>Orchestration Tools for AI Agents</h3><p>As AI systems grow more complex, orchestration becomes essential for reliability, scalability, and collaboration across multiple agents.</p><p>Here are some popular orchestration frameworks and tools used with AI agents:</p><ul><li><strong>CrewAI</strong><br><em>Best for</em>: Simple multi-agent task orchestration.<br><em>Notes</em>: Designed around agents, tasks, and crews.</li><li><strong>LangGraph</strong><br><em>Best for</em>: Graph-based agent orchestration.<br><em>Notes</em>: Useful for complex flows, parallelism, and flexible paths.</li><li><strong>AutoGen (Microsoft Research)</strong><br><em>Best for</em>: Multi-agent conversations among LLMs.<br><em>Notes</em>: Focused on collaborative dialog orchestration.</li><li><strong>AWS Step Functions</strong><br><em>Best for</em>: Serverless orchestration of cloud-native AI workflows.<br><em>Notes</em>: Great for chaining Lambda functions and microservices.</li><li><strong>Temporal.io</strong><br><em>Best for</em>: Durable workflow orchestration at scale.<br><em>Notes</em>: Supports retries, stateful tasks, and long-running workflows.</li><li><strong>Apache Airflow</strong><br><em>Best for</em>: Batch processing and scheduled orchestration.<br><em>Notes</em>: Ideal for periodic agent-driven pipelines like data aggregation.</li></ul><blockquote><strong><em>Note:</em></strong><em><br>Choosing the right orchestrator depends on system size, agent complexity, fault tolerance needs, and scalability goals.</em></blockquote><h3>Final Thoughts</h3><p>Multi-agent systems represent the next generation of AI automation: specialized, coordinated, and efficient.<br>By designing with roles, tasks, tools, and memory in mind — and by leveraging smart orchestration and caching — you can build powerful, scalable, and collaborative AI systems that reflect human-like teamwork.</p><p>#AIAgents #AI #MultiAgentSystems #GenerativeAI #Orchestration #Caching #Research #TechWriting #FutureOfWork</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94654eb81a80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OAuth 2.0 Token Exchange with Keycloak]]></title>
            <link>https://kindlingknowledge.medium.com/understanding-oauth-2-0-token-exchange-mechanisms-and-use-cases-a203e9a74d68?source=rss-1888a8d4ce78------2</link>
            <guid isPermaLink="false">https://medium.com/p/a203e9a74d68</guid>
            <category><![CDATA[security-token-exchange]]></category>
            <category><![CDATA[keycloak]]></category>
            <category><![CDATA[oauth2]]></category>
            <dc:creator><![CDATA[Krishna Kumar Akurathi]]></dc:creator>
            <pubDate>Sun, 17 Nov 2024 09:43:25 GMT</pubDate>
            <atom:updated>2024-11-17T11:48:34.783Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>This article outlines the OAuth 2.0 token exchange and how to configure and enable it in Keycloak.</p><h4>Pre-requisites</h4><p>Keycloak 21.1.x</p><p>Before we discuss token exchange and how to configure it in Keycloak, let’s give a brief overview of the OAuth 2.0 framework, token exchange, etc.</p><h3>Section 1: The OAuth 2.0 Framework</h3><p>OAuth 2.0 is an open standard for authorization that allows third-party applications to gain limited access to user resources without exposing user credentials. It enables secure delegated access, allowing users to grant applications permission to act on their behalf without sharing their passwords. OAuth 2.0 operates through a series of tokens, which represent the user’s authorization and can be used to access resources from a resource server. This protocol is widely used in various applications and services, facilitating secure interactions in a user-friendly manner.</p><h4>Basic Concepts:</h4><p>• Resource Owner: The user who owns the data.</p><p>• Resource Server: The server hosting the user’s data.</p><p>•	Client: The application requesting access to the data.</p><p>•	Authorization Server: The server that issues access tokens.</p><p>Token Types:</p><p>•	Access Tokens: Used to access resources.</p><p>• Refresh Tokens: These are used to obtain new access tokens.</p><p>•	ID Tokens: Used in OpenID Connect to represent user identity.</p><h4>OAuth 2.0 flow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*iwUQjkFCHb1vnevVytAyJw.png" /><figcaption>OAuth 2.0 framework flow</figcaption></figure><h3>Section 2: Token Exchange in Detail</h3><p>OAuth 2.0 Token Exchange is a process that allows an application to request a different access token using an existing one. This is useful when the application needs to access other resources or services without requiring the user to re-authenticate.</p><p>The Token Exchange flow in OAuth 2.0 allows a client application to exchange one type of token for another, typically to enhance security or access different resources.</p><p>Here’s how it works in easy terms:</p><p><strong>1. Initial Authorization:</strong> The resource owner (user) grants permission to the client application, allowing it to request an access token from the authorization server. This usually involves the user logging in and consenting to share specific information.</p><p><strong>2. Access Token Issuance:</strong> After the client receives the authorization code from the authorization server, it exchanges this code for an access token (and often a refresh token). The access token allows the client to access the user’s resources on the resource server.</p><p><strong>3. Token Exchange:</strong> If the client needs a different token (for example, to access a different scope or service), it can send the existing access token to the token exchange endpoint. The token exchange process validates the original token and issues a new access token that may have different permissions or expiration characteristics.</p><p><strong>4. Accessing Resources:</strong> The client then uses the new access token to interact with the resource server, retrieving or modifying the user’s data as authorized.</p><p>This flow enhances flexibility and security, allowing clients to adapt their access based on the user’s permissions while minimizing risks associated with token leakage or misuse.</p><h4>OAuth 2.0 Token exchange flow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*jU91l9i0UbjX_6OPm1m93g.png" /></figure><p>In summary, OAuth 2.0 Token Exchange makes it easier for apps to access different data on your behalf by swapping existing tokens for new ones, all while keeping your information secure and minimizing the need for repeated logins.</p><p><strong>Use Cases:</strong></p><p>•	Delegated Authorization: How it enables third-party applications to access resources.</p><p>•	Inter-Service Communication: How microservices can communicate securely using exchanged tokens.</p><h3>Section 3: Security Considerations</h3><h4>Best Practices:</h4><p>•	Always use HTTPS to protect token exchange.</p><p>•	Scope and Lifetime: Define token scopes and lifetimes to minimize risk.</p><p>•	Audience Restriction: Tokens should be restricted to specific audiences.</p><h4>Common Vulnerabilities:</h4><p>• Token Leakage: Discuss how tokens can be intercepted and how to prevent this.</p><p>• Replay Attacks: Explain the risks and mitigation strategies.</p><h3>Section 4: What is Keycloak?</h3><p>Keycloak is a powerful open-source identity and access management solution that simplifies the implementation of authentication and authorization for applications and services. Its rich feature set, including SSO, identity brokering, and support for standard protocols, makes it a popular choice for organizations looking to enhance their security posture while providing a seamless user experience. By leveraging Keycloak, developers can focus on building their applications without worrying about the complexities of user management and security.</p><h4>Key Features of Keycloak</h4><p><strong>Single Sign-On (SSO):</strong></p><ul><li>Keycloak enables users to log in once and gain access to multiple applications without the need to re-enter credentials. This enhances user experience and reduces the burden of managing multiple usernames and passwords.</li></ul><p><strong>Identity Brokering:</strong></p><p>• Keycloak supports identity federation, allowing users to log in using their existing credentials from external identity providers (e.g., Google, Facebook, etc.). This simplifies user onboarding and provides flexibility in authentication methods.</p><p><strong>User Federation:</strong></p><p>• Keycloak can integrate with existing user databases or directories (such as LDAP or Active Directory). This allows organizations to leverage their current user management systems while adding advanced security features.</p><p><strong>Centralized User Management:</strong></p><p>• Administrators can manage users, roles, and permissions from a single admin console. This centralized approach simplifies user lifecycle management and improves security oversight.</p><p><strong>Support for Standard Protocols:</strong></p><p>• Keycloak fully supports industry-standard protocols like OAuth 2.0, OpenID Connect, and SAML. This ensures compatibility with a wide range of applications and services, enabling secure authorization and authentication flows.</p><p><strong>Customizable Authentication Flows:</strong></p><p>• Keycloak allows the creation of custom authentication flows and policies, enabling organizations to tailor the authentication experience to their specific requirements.</p><p><strong>Social Login:</strong></p><p>• Users can log in using their social media accounts, providing a seamless and familiar login experience.</p><p><strong>Multi-Factor Authentication (MFA):</strong></p><p>• Keycloak supports MFA, adding an extra layer of security by requiring users to verify their identity through additional methods (such as SMS or authenticator apps).</p><p><strong>User Self-Service:</strong></p><p>• Users can manage their accounts, including password resets and profile updates, through a self-service interface. This reduces the administrative burden on IT teams.</p><p><strong>Audit and Logging:</strong></p><p>• Keycloak provides comprehensive logging and auditing capabilities, allowing administrators to monitor user activities and security events effectively.</p><p><strong>Extensibility:</strong></p><p>• Keycloak supports custom extensions and themes, enabling organizations to adapt the platform to their branding and functional needs.</p><p><strong>High Availability and Scalability:</strong></p><ul><li>Keycloak can be deployed in clustered environments, ensuring high availability and scalability to handle large user bases and high traffic.</li></ul><h4>References</h4><ul><li>Keycloak Documentation: Keycloak Official Documentation<br> • Keycloak GitHub Repository: Keycloak GitHub<br> • Community and Support: Keycloak has an active community, and support can be accessed through forums and discussion groups.</li></ul><h3>Section 5: Configuring Token Exchange in Keycloak</h3><p>Token exchange in Keycloak is a preview feature and by default, Preview features are not enabled. Hence, before we start any Token exchange configurations it must be enabled using the below command</p><pre>kc.bat start-dev --features=&quot;token-exchange,admin-fine-grained-authz&quot;<br>kc.sh start-dev --features=&quot;token-exchange,admin-fine-grained-authz&quot;</pre><h4>Token exchange with Internal realms</h4><p>This token exchange happens between two Keycloak realms. First, we obtain an access token generated via the source realm and then use that token to get another access token for another realm( target ). For demo purposes, I’m using the password grant type to get the source access token.</p><p>List of configuration steps for token exchange between two realms in the same Keycloak instance.</p><ol><li>Create two realms in Keycloak( if not already done )</li><li>Create a client in each realm</li><li>Enable Permissions for client</li><li>Enable token exchange policies</li><li>Create Identity provider</li><li>Enable Permissions for IdP</li><li>Test</li><li>Access the Keycloak Admin Console:</li></ol><h4>Create two realms in Keycloak( if not already done )</h4><p>• Log in to the Keycloak Admin Console.</p><p><a href="https://localhost/auth/admin/master/console/">https://&lt;keycloak-host&gt;/admin/master/console/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S_VB7mSWP1iYfKDm5cAtTg.png" /><figcaption>Create a realm</figcaption></figure><p>Create a source realm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FAos5um9xKkPLVhujctMFA.png" /><figcaption>Create source realm</figcaption></figure><p>Create a new client in the source realm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BmqrhpaiVD4mpWGMCzk2Ag.png" /><figcaption>Create a new client</figcaption></figure><p>Enable Client authentication</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nyx-K4-PWupBXP45OhfpaA.png" /><figcaption>Enable Client authentication option</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_JXPEqyxNmkD2P8QpjhwvQ.png" /><figcaption>Continue with default values</figcaption></figure><p>Now create a user in the source realm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCY4S-JKtzGyOB2mYG8OOw.png" /><figcaption>Create a new user</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*isjR6jkCGpZuWhNCAtjZNA.png" /><figcaption>Set password for tokenexchangeuser</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qjT_8a8o2cS6Th4qKHvf3A.png" /><figcaption>Generate access token with source realm user pwd credentials</figcaption></figure><p>Create a target realm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fhrP93jmctlWY0EJtswjcg.png" /><figcaption>Create a new target realm</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p_GoBBMmRIVY3VRIx0jabg.png" /><figcaption>Create a new client in target realm</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J6HtWSa38wW7whnyaei6SQ.png" /><figcaption>Enable client authentication</figcaption></figure><p>Enable permissions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oxwpYllOYMGaAAIjr0kbFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9H39XPdX3Zw-a2X_97eTgQ.png" /><figcaption>Toggle to On</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MNo0kon-VcCplDzTxKahRg.png" /><figcaption>Select token-exchange scope</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3nvJJBtX6_Nn4E0k8P1Ctg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dnr_veokBsLyOS7roLTo5Q.png" /><figcaption>Click on client details</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8R_5aZAOlheS8VEV_Dl7yA.png" /><figcaption>Click on Policies</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RKJZhMyHF4FcM60J9lNNXg.png" /><figcaption>Choose Client from the list</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mnkbykYJSoYX-CpmL0izlQ.png" /><figcaption>Select target client from the clients list</figcaption></figure><p>Now Go to Clients -&gt; tokenexchange-blog-target-realm-cli -&gt; Permissions -&gt; token-exchange scope</p><p>Attach newly created policy to it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wEse2qiK0EBQYF4jAsxbKw.png" /><figcaption>Attach policy</figcaption></figure><p>Now create a Identity provider in target realm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ih6h60Rq0g--GCyoclLSAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M3DNw-L_lpk63tFMP0Zflw.png" /><figcaption>Create Identity provider</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WD3E0r_8Jpv41vogMMhtVg.png" /><figcaption>Enter Auth, token, user info URLs</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KWHQ-loYZ2K_6SN6grNVhQ.png" /><figcaption>Enter JWKS URL</figcaption></figure><p>Enable Permissions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BeWj4RFf84UUNOnXQaOPSw.png" /><figcaption>Enable permissions</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rus3pXAueRQ4YAug8_aGTw.png" /><figcaption>select token-exchange scope</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8uKeaHANtQrOfu3ANF4iOQ.png" /><figcaption>select policy from the list</figcaption></figure><p>Using the below command the source realm access token can be exchanged for target realm.</p><pre>curl --location &#39;http://localhost:8080/auth/realms/tokenexchange-blog-target-realm/protocol/openid-connect/token&#39; \<br>--header &#39;Content-Type: application/x-www-form-urlencoded&#39; \<br>--data-urlencode &#39;client_id=tokenexchange-blog-target-realm-cli&#39; \<br>--data-urlencode &#39;client_secret=&lt;tokenexchange-blog-target-realm-cli-secret&gt;&#39; \<br>--data-urlencode &#39;grant_type=urn:ietf:params:oauth:grant-type:token-exchange&#39; \<br>--data-urlencode &#39;subject_token=&lt;source-access-token&gt;&#39; \<br>--data-urlencode &#39;requested_token_type=urn:ietf:params:oauth:token-type:access_token&#39; \<br>--data-urlencode &#39;audience=tokenexchange-blog-target-realm-cli&#39; \<br>--data-urlencode &#39;subject_issuer=tokenexchange&#39;</pre><h3>References</h3><p>• RFC 6749 — The OAuth 2.0 Authorization Framework: <a href="https://oauth.net/2/">https://oauth.net/2/</a></p><p>• RFC 8693 — OAuth 2.0 Token Exchange: <a href="https://www.rfc-editor.org/rfc/rfc8693.html">https://www.rfc-editor.org/rfc/rfc8693.html</a></p><p>• Keycloak Documentation: <a href="https://www.keycloak.org/securing-apps/token-exchange">https://www.keycloak.org/securing-apps/token-exchange</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a203e9a74d68" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>