FOUNDATIONS · 4 MIN READ

A map of the agent development stack

Understand the responsibilities before choosing product names.

Jump to a section 6 sections

EXAMPLE USE CASE

Select a minimal stack for a policy-answering assistant

A developer needs document retrieval and grounded answers without adding every product in the ecosystem.

Input
Approved policy documents, authenticated users, a query and a requirement to return source IDs.
Expected output
An owned application layer, one agent SDK, one retrieval store, source parsing, traces and an evaluation gate.
  • Success check: Every selected component has a named responsibility and an integration example; existing infrastructure is reused where it meets the task.
  • Try a failure: If the policies can be answered by one database query, compare that simpler application before adding an agent loop.

Example scope: A reference architecture and selection guide. The linked pages contain the actual installation and integration code.

LangChain exampleQdrant exampleDocling exampleGiskard example
SEE HOW THE SYSTEM FITS TOGETHERSELECT A COMPONENT
taskinvokecontextenforceevidencestateApplication + identityOwn the task boundaryAgent SDKControl the loopModels + toolsPerform the workRecords + retrievalSupply scoped evidenceRuntime + isolationRun within limitsEvaluation + telemetryProve useful behavior
  1. Authenticate the caller and define which business operations are permitted.

  2. Choose an execution abstraction and make its tool, state, and stopping behavior explicit.

  3. Models select actions; services enforce and execute the operations.

  4. Keep authoritative records distinct from derived search indexes and recalled preferences.

  5. Choose process, container, or sandbox boundaries, network policy, and task lifetime.

  6. Measure task completion and record enough redacted evidence to explain failures.

    Result or stopping point
Agent SDK

Choose an execution abstraction and make its tool, state, and stopping behavior explicit.

Follow the arrows, then select a component to inspect its responsibility. On mobile, downward arrows connect the next step; bent arrows identify branches and return paths. Select a destination to jump to that component.

Worked stack: answer a returns-policy question

  • User task: “Can I return this after 20 days?” The answer must come from the authorized store’s current policy and preserve its source ID.
  • Ingestion: Docling or Unstructured turns an approved document into text. Keep the source identifier, policy version and tenant on every chunk.
  • Retrieval: Qdrant or pgvector selects authorized evidence. A vector result is an input to the answer, not proof that the answer is correct.
  • Agent: LangChain or OpenAI Agents SDK calls retrieval only when necessary and returns the policy with its source.
  • Operations: OpenTelemetry or Langfuse captures the path; Giskard or Ragas checks known questions and unsupported claims.

Assign each component one job

JSON · responsibility map
{
  "application": "authentication, tenant scope, tool authorization",
  "parsing": "documents → text + source IDs",
  "retrieval": "query + tenant → ranked authorized evidence",
  "agent": "question + evidence → answer + sources",
  "memory": "only selected preferences needed on a later visit",
  "evaluation": "fixtures + actual behavior → pass/block",
  "runtime": "process lifetime, secrets, retries and resource limits"
}

Reuse existing infrastructure deliberately

  • Already using PostgreSQL? Try pgvector before operating another database. Need a dedicated retrieval service? Compare the same corpus and filters in Qdrant, Pinecone or another candidate.
  • A one-shot fact lookup may need only an authenticated query and a template. Add model-directed tool selection only when the task has variable paths.
  • Add long-term memory when a later interaction benefits from a retained fact or preference. Conversation history alone is not a retention policy.

Build in this order

  • First: one authorized record lookup with a reliable missing-data result.
  • Second: an SDK example that calls that lookup and reports evidence.
  • Third: source parsing and retrieval, with a fixed evaluation set.
  • Fourth: tracing, budgets and restart behavior. Add more components only when a measured failure requires them.
Parse a policyRetrieve a scoped recordConnect an agentCheck the outcome

Keep exploring

A layered architecture for agent memoryWorkflow, single agent, or multiple agents?