Living Reference — v2.0 — April 2026

The Agentic AI
Field Guide

A complete, shareable reference for building, deploying, and operating AI agent systems. Every concept explained, every trade-off quantified, cost calculators included.

24
Topics covered
6
Domain areas
4
Cost calculators
12+
Frameworks & checklists
V
Vinit Metange
Built & maintained by
All Topics

Click any card to read the full explanation, see code examples, patterns, and decision frameworks for that topic.

Foundation & Architecture
Context Engineering
Context anatomy, lifecycle, multi-agent handoff, loop mechanics. What goes into the window and when.
context windowassemblyloop
→
Token, Cost & Latency Optimization
Prompt compression, caching, model routing, parallelism, iteration budgets.
cachingroutingparallelism
→
Memory Architecture
Episodic, semantic, procedural, and working memory. Storage patterns, retrieval, and forgetting.
episodicsemanticvector DB
→
Planning Strategies
ReAct, Plan-and-Execute, Tree of Thoughts, Reflexion, MCTS, LLM Compiler. When to use each.
ReActToTReflexion
→
Retrieval & Knowledge
RAG Strategies
Chunking, hybrid search, re-ranking, HyDE, iterative retrieval, embedding selection.
chunkingre-rankingHyDE
→
Knowledge Graphs & GraphRAG
Entities, relationships, GraphRAG, structured vs unstructured retrieval, when graphs beat vectors.
GraphRAGNeo4jentities
→
Agent Memory Stores
Vector DBs, KV stores, read/write patterns, cache invalidation, TTL, tiered storage.
pgvectorPineconeRedis
→
Multi-Agent Systems
Multi-Agent Topologies
Orchestrator-subagent, peer-to-peer, blackboard, pipeline, debate, critic-generator patterns.
orchestratordebatepipeline
→
Agent Communication Protocols
Message formats, shared state, pub-sub, event-driven coordination, A2A and MCP standards.
A2AMCPpub-sub
→
Role Specialization Design
Researcher, critic, executor, validator roles. Responsibility boundaries and overlap prevention.
researchercriticexecutor
→
Safety, Security & Trust
Prompt Injection & Security
Indirect injection via tools/docs, jailbreaking, data exfiltration through agents, defense strategies.
injectionsandboxingdefense
→
Human-in-the-Loop (HITL)
When to pause and confirm, escalation triggers, approval gate design, minimal interruption principles.
approval gatesescalation
→
Least-Privilege & Sandboxing
Tool permission scoping, reversible vs irreversible actions, blast radius limits, agent isolation.
permissionsreversible
→
Trust Hierarchies
Agent identity verification, instruction source trust, rogue agent prevention, cryptographic signing.
identitysigning
→
Performance, Tuning & Reliability
Model Performance & Accuracy
CoT, fine-tuning, DPO, self-critique, structured output validation, best-of-N sampling.
CoTDPOfine-tuning
→
Degradation & Drift
Data drift, knowledge staleness, context degradation, model version drift, remediation playbook.
data driftstaleness
→
Evals & Observability
Eval taxonomy, tracing, dashboards, CI/CD gates, alert playbook, tooling landscape.
LLM-judgetracing
→
Error Handling & Resilience
Retry strategies, exponential backoff, fallback chains, circuit breakers, partial failure recovery.
retrycircuit breaker
→
Parameter Tuning
Temperature, top_p, top_k, max_tokens, frequency penalty. What each does and when to use it.
temperaturetop_p
→
Deployment & Operations
Deployment Architectures
Stateless vs stateful agents, serverless vs long-running, session management, horizontal scaling.
statelessserverless
→
Rate Limiting & Quota Management
API rate limits, token budgets, request queuing, priority scheduling, multi-tenant isolation.
rate limitsqueuing
→
Versioning & Rollout
Prompt versioning, agent graph versioning, blue-green deploys, canary rollouts, rollback paths.
canaryblue-green
→
FinOps & Cost Governance
Per-tenant attribution, budget alerts, cost anomaly detection, model tier allocation policies.
attributionbudgets
→
Foundation & Architecture

Core building blocks of any agentic system.

Context Engineering
Assembly, lifecycle, multi-agent handoff, loop mechanics.
→
Token, Cost & Latency
Caching, routing, compression, parallelism, budgets.
→
Memory Architecture
Four memory types, storage patterns, retrieval mechanics.
→
Planning Strategies
ReAct, Plan-and-Execute, ToT, Reflexion, MCTS, Compiler.
→
Cost Hub

Interactive calculators covering every cost layer of an agentic system — LLM tokens, embeddings, vector DB, infra, and retries. Update any price field to keep calculations accurate as models change.

Full-Stack Per-Request Cost Calculator
Every cost layer included: LLM tokens, prompt caching, embedding lookups, vector DB queries, retry overhead, and multi-agent multiplier. Select a model preset or edit prices directly.
Input $/M tokens
Output $/M tokens
Cache input $/M tokens
Embedding $/M tokens
✏️ Edit to use current pricing
🧠 LLM Token Layers
500tokens — static, cacheable
1,500tokens — retrieved chunks
300tokens
500tokens
3LLM calls per agent request
70%of system prompt served from cache
🔍 Retrieval & Embedding Layers
300tokens — query embedding at inference
3× $0.00004 each (e.g. Pinecone)
⚙️ Overhead & Infra Layers
0.2avg extra LLM calls per request
00 = single agent mode
$0.50compute, storage, egress per 1K reqs
Cost Breakdown
LLM token cost / request
all iterations, after caching
-
Embedding cost / request
query embedding at inference
-
Vector DB cost / request
read operations
-
Retry overhead cost
avg extra calls
-
Multi-agent overhead
sub-agent calls
-
Totals
Total cost / request
all layers combined
-
Cost per 1,000 requests
-
Monthly (100K req/day)
-
Infra cost / month
100K req/day × 30 days
-
Cache saves vs no cache
per 1,000 requests
-
LLM % of total cost
-
Monthly Budget Projector
Forecast monthly spend across LLM, embedding, vector DB, and infra — with model mix routing factored in.
1,000users/day
5requests
0.20¢use value from calculator above
20%rest use standard/cheap model
0.03¢embedding + vector DB + infra
$100vector DB base, hosting, logging
Monthly Projections
Daily requests
-
Monthly requests
-
LLM spend (blended routing)
-
Non-LLM spend
embedding + vector DB + infra
-
Fixed infra costs
-
Total monthly spend
-
Cost per user per month
-
LLM as % of total
-
Model Pricing Reference

Defaults used in the calculators above. Prices change frequently — verify at provider before budgeting and update the fields above.

Verify: Anthropic · OpenAI · Google

ModelInput $/MOutput $/MCache input $/MContextBest for
Claude Haiku 3.5$0.80$4.00$0.08200KClassification, routing, simple extraction
Claude Sonnet 4.5$3.00$15.00$0.30200KMost production tasks, agents, RAG
Claude Opus 4$15.00$75.00$1.50200KComplex reasoning, high-stakes decisions
GPT-4o$2.50$10.00$1.25128KGeneral purpose, vision tasks
GPT-4o mini$0.15$0.60$0.075128KHigh-volume simple tasks, filtering
Gemini 1.5 Flash$0.075$0.30—1MLong context, document processing
Llama 3.3 70B (self-hosted)~$0.20~$0.20—128KData privacy, cost control, high volume
Embedding Model Pricing

Embedding costs are often overlooked but add up at scale — especially during ingestion. Verify at provider.

Model$/M tokensDimensionsBest for
text-embedding-3-small (OpenAI)$0.021536General purpose, high volume
text-embedding-3-large (OpenAI)$0.133072Higher accuracy, production RAG
voyage-3 (Anthropic/Voyage)$0.181024Best-in-class retrieval quality
voyage-3-lite$0.02512Cost-sensitive, high throughput
Gemini text-embedding-004$0.00768Free tier, Google ecosystem
BGE-M3 (self-hosted)~$0.001024Zero marginal cost, multilingual
Vector DB Cost Reference

Query and storage costs at scale. The default $0.00004/read in the calculator above is based on Pinecone serverless. Verify at provider.

ProviderRead costStorageFree tierNotes
Pinecone Serverless~$0.00004/read$0.33/GB/mo2GBZero idle cost, scales to zero
Weaviate CloudIncluded$0.095/GB/mo14-day trialHybrid search built-in
Qdrant CloudIncluded$0.13/GB/mo1GB freeBest price/performance
pgvector (self-hosted)~$0Server cost onlyUnlimitedBest if already on Postgres
Chroma (local)$0$0UnlimitedDev/prototype only
Top Cost Reduction Strategies
Model routing by complexity
Up to 10x savings
Route simple tasks to cheap fast models. Reserve expensive models for genuine complex reasoning. A routing call costs fractions of a cent and can cut 60–80% of total LLM spend.
1
Classify request complexity at intake using a cheap model
2
Route: simple → cheapest model tier, complex → mid tier, critical → premium tier
3
Track per-route quality scores; tune thresholds with eval data
Prompt caching
Up to 90% input savings
Static content (system prompt, tool schemas, reference docs) can be cached. Cached input costs ~90% less than regular input. Critical for agents with long system prompts.
1
Identify static content: system prompt, tools, reference docs
2
Add cache_control: ephemeral to those blocks in API calls
3
Monitor cache_read_input_tokens in API response to verify savings
Batch API for async work
50% cost reduction
Any work that doesn't need real-time response (evals, reports, bulk analysis) can use the Batch API. Most providers offer ~50% discount for async processing.
1
Identify tasks tolerant of up to 24-hour turnaround
2
Submit as JSONL via Batch API, poll for completion
3
Retrieve, validate quality, process downstream
Embedding cost control
90%+ ingestion savings
Embedding costs dominate ingestion pipelines. Use smaller models for bulk ingestion, larger for quality-critical queries. Cache query embeddings for repeated queries.
1
Use a small/cheap model for document ingestion (bulk)
2
Use a higher-quality model for query embeddings at inference
3
Cache query embeddings in Redis with short TTL for popular queries
RAG context compression
40–60% input savings
Retrieved chunks are often the biggest token cost per request. Compress before inserting: extract only the relevant sentences, not the full chunk.
1
After retrieval, run contextual compression: extract relevant sentences only
2
Set a result_budget token limit per chunk in your retrieval system
3
Measure compression ratio vs quality impact on your eval set
Tool result compression
Reduce loop cost 50%+
Tool results grow the context window every iteration — this compounds across all loop calls. Summarize tool outputs before reinserting them into the context.
1
After each tool call, summarize result with a cheap model or regex
2
Insert the summary (not raw output) back into the agent context
3
Track context growth per iteration — alert if >500 tokens/step
Launch Checklists

Use these before shipping any agentic system to production. Click items to mark complete.

Pre-Production Agent Checklist
0 / 12
Context management: Rolling summarization implemented when context exceeds 80% of limit
Iteration budget: Hard max on LLM calls per invocation is set and enforced
Tool error handling: Every tool call has error handling and retry with exponential backoff
Model version pinned: Using exact model string, not a floating alias like "latest"
Golden eval set: At least 50 representative test cases with verified expected outputs
Output validation: Schema validation on all structured outputs with auto-retry on failure
Safety evals: Adversarial test suite passing before every deploy
Observability: Traces, spans, and tool call logs going to an observability platform
Cost limits: Per-request token budget enforced; cost anomaly alerts configured
Rollback plan: Previous model version retained; rollback procedure documented and tested
Secrets management: API keys in secrets manager, not hardcoded or in plaintext env vars
PII handling: Confirmed no PII in logs, traces, or episodic memory store
RAG System Checklist
0 / 7
Chunking validated: Chunk size and overlap tested on representative documents for your domain
No-context baseline: Retrieval value delta measured (RAG score minus parametric-only score)
Faithfulness monitoring: LLM-judge faithfulness scoring on sampled production traffic
Index freshness policy: TTL and refresh schedule defined and automated
Embedding model locked: Model version tracked per record; re-embedding plan exists for upgrades
Hybrid search: Both dense vector and sparse BM25 retrieval enabled and fused
Query latency SLA: Retrieval p95 latency measured and within acceptable threshold
Multi-Agent System Checklist
0 / 6
Context isolation: Sub-agents receive task brief only, not the orchestrator's full history
Agent identity: Each agent has a defined role, tool scope, and permission level
Shared state store: Inter-agent state uses external store (Redis/DB), not shared context windows
Prompt injection defense: Tool outputs sanitized before reinsertion into any agent context
Escalation path: Defined conditions that route to human review before irreversible actions
System-wide iteration cap: Total LLM calls across all agents in one invocation is bounded
Metrics Reference

Every metric worth tracking, what it measures, and what healthy looks like.

RAG Quality Metrics
MetricWhat it measuresHow to computeTarget
Retrieval Precision@KOf top-K chunks, fraction relevantLabeled query-doc pairs>0.70
Retrieval Recall@KOf all relevant docs, fraction in top-KGround truth set comparison>0.80
MRRRank of first relevant result1/rank of first hit, averaged>0.75
FaithfulnessAnswer claims grounded in retrieved contextLLM NLI judge per claim>0.85
Answer RelevanceAnswer addresses the question askedLLM judge: query + answer>0.80
Context UtilizationModel actually used retrieved chunksCitation overlap check>0.75
No-Context DeltaRetrieval value over parametric knowledgeRAG score minus no-RAG score>+0.15
Agent Performance Metrics
MetricWhat it measuresHow to computeTarget
Task Completion Rate% invocations reaching successful answerTerminal state logging>0.90
Tool Selection AccuracyCorrect tools chosen per stepVs reference trajectory>0.85
Step EfficiencyActual vs minimum iterations neededactual / min steps ratio<1.5x
Tool Error Rate% tool calls resulting in errorsPer-tool error count / total<5%
Cost per TaskTotal tokens x pricing per completed taskToken usage x model pricesTrack trend
Iteration Budget Hit Rate% hitting max iteration limitbudget_exceeded / total<2%
Production Health Metrics
MetricFrequencyAlert thresholdIndicates
LLM Judge Quality ScoreDaily (golden set)Drop >10% vs 7-day baselineQuality regression
p95 LatencyContinuousDoubles vs baselineInfra or model issue
User Thumbs-Down RateDaily+20% week-over-weekLeading quality signal
Safety Guardrail Trigger RateContinuous>0.1% of requestsP0: rollback immediately
Token Cost per Request (trend)Daily+30% over 7 daysContext bloat / loop issue
Embedding Centroid Drift (PSI)WeeklyPSI >0.25Data drift in production
Cache Hit RateDailyDrop >15%Static content changed
Retrieval & Knowledge

RAG patterns, knowledge graphs, and memory stores.

RAG Strategies
Full guide: chunking, hybrid search, re-ranking, HyDE.
→
Knowledge Graphs & GraphRAG
When graphs beat vectors, entity linking, multi-hop.
→
Agent Memory Stores
pgvector, Pinecone, Redis, tiered storage patterns.
→
Multi-Agent Systems

Topologies, communication protocols, and role design.

Multi-Agent Topologies
Orchestrator, peer-to-peer, blackboard, debate patterns.
→
Agent Communication Protocols
A2A, MCP, pub-sub, event-driven coordination.
→
Role Specialization Design
Researcher, critic, executor, validator role patterns.
→
Safety, Security & Trust

Defenses, controls, and trust architecture for production agents.

Prompt Injection & Security
Indirect injection, jailbreaks, exfiltration, defenses.
→
Human-in-the-Loop (HITL)
Approval gates, escalation triggers, minimal interruption.
→
Least-Privilege & Sandboxing
Permission scoping, blast radius, agent isolation.
→
Trust Hierarchies
Identity verification, rogue agent prevention, signing.
→
Performance, Tuning & Reliability

Model accuracy, drift, evals, error handling, and parameter tuning.

Model Performance & Accuracy
CoT, DPO, fine-tuning, self-critique, best-of-N.
→
Degradation & Drift
Six failure modes, detection, and remediation playbook.
→
Evals & Observability
Eval taxonomy, CI/CD gates, tracing, alert playbook.
→
Error Handling & Resilience
Retry, circuit breakers, fallback chains, recovery.
→
Parameter Tuning
Temperature, top_p, sampling strategies.
→
Deployment & Operations

Architectures, rate limiting, versioning, and FinOps.

Deployment Architectures
Stateless vs stateful, serverless, horizontal scaling.
→
Rate Limiting & Quota
API limits, token budgets, priority queues, throttling.
→
Versioning & Rollout
Canary deploys, blue-green, prompt versioning, rollback.
→
FinOps & Cost Governance
Attribution, budgets, anomaly detection, tier allocation.
→
About This Guide

A living reference for engineers, architects, and practitioners building production AI agent systems. Use it as a field reference, share it with your team, or walk through the checklists before your next launch.

🗂️
How to use it
Browse all 24 topics from All Topics, or jump to a domain via the top navigation. Click any card to expand the full deep-dive with code patterns. Use the search bar to find topics instantly.
✅
Before you ship
Head to the Checklists tab and work through the pre-production, RAG, and multi-agent checklists. Each item is clickable — track progress before every deploy.
💰
Estimate your costs
The Cost Hub has an interactive per-request cost calculator and monthly budget projector. Adjust sliders to model your usage pattern across five major models.
📊
What to measure
The Metrics tab has every KPI worth tracking — RAG quality, agent performance, and production health — with target values and alert thresholds.
🔗
Share with your team
Share directly on LinkedIn, copy the URL, or post on X. All content is self-contained — no login, no paywall, works on any device.
🔄
Living document
Built and maintained by Vinit Metange. Current version: v2.0 — April 2026. Coverage spans current frontier models from Anthropic, OpenAI, Google, and open-source alternatives. The Cost Hub price fields are editable to stay accurate as models change.
Coverage map
DomainTopicsDepth
Foundation & ArchitectureContext Engineering, Token/Cost/Latency, Memory Architecture, Planning StrategiesFull deep-dive with code patterns
RAG & RetrievalRAG Strategies, Knowledge Graphs & GraphRAG, Agent Memory StoresFull deep-dive with code patterns
Multi-Agent SystemsTopologies, Communication Protocols, Role SpecializationFull deep-dive with decision guides
Safety & SecurityPrompt Injection, HITL, Least-Privilege, Trust HierarchiesFull deep-dive with code patterns
Performance & ReliabilityModel Performance, Drift Detection, Evals & Observability, Error Handling, Parameter TuningFull deep-dive with formulas
Deployment & OperationsArchitectures, Rate Limiting, Versioning & Rollout, FinOps & Cost GovernanceFull deep-dive with frameworks
Cost HubPer-request calculator, Monthly projector, Model pricing reference, Top optimization strategiesInteractive calculators
ChecklistsPre-production agent, RAG system, Multi-agent systemInteractive with progress tracking
MetricsRAG quality, Agent performance, Production healthTables with targets & alert thresholds
Keyboard shortcuts
/  Focus search
Esc  Clear search