Frequently Asked Questions About Papy's Agentic AI Systems Builder

24 answers covering everything from basics to advanced usage.

// Basics

What exactly makes an AI system 'agentic' versus just automated?

An agentic system reasons about its own plan — it decomposes a goal into sub-tasks, selects which tool to call at each step via LLM reasoning, adapts when conditions change, and decides when to ask for human help. Traditional automation follows hard-coded if-then logic. Agentic systems delegate decision-making to an LLM-brain within bounded permission scopes, so the control flow is reasoned, not scripted.

What is the knowledge cutoff problem and why does it matter?

The knowledge cutoff is the date up to which an LLM was trained. Any question about events or data after that date can't be answered from the model's weights alone. This matters because many real-world tasks involve current information — live news, prices, availability. RAG partially solves it for static private data, but agents connected to live tools solve it fully by fetching real-time data on demand.

What is the role of the LLM in an agentic system?

The LLM is the brain — the reasoning engine of every agent. It performs goal decomposition, tool selection, decision-making, and decides HITL timing. Without a capable LLM the agent cannot reason about when to call a tool versus answer directly, or when to pause for human approval. The quality of reasoning scales directly with the capability of the chosen model.

What are the different types of LangGraph workflows?

There are four: sequential (nodes run one after another in fixed order), parallel (multiple nodes run simultaneously via async Python), conditional (the next node depends on current state, enabling branching), and iterative (a node loops until a condition is met, like retrying until enough applications arrive). You choose the pattern based on whether sub-tasks depend on each other, can run independently, or need looping.

// How To

How do I set up short-term and long-term memory in an agent?

Store short-term memory — current task state, tool responses, intermediate outputs — in the LangGraph state object, which is in-memory and session-scoped. Persist long-term memory — full conversation history, goal metadata, progress markers — to a database like PostgreSQL via SQLAlchemy or a vector store. Use LangGraph's checkpointer to persist state between runs so the agent can resume from its last state after interruption.

How do I register tools so the agent can use them?

List every external API, service, or resource the agent may need — search engines, calendars, job platforms, databases, email, file systems — and register each as a LangChain tool. The LLM-brain then uses reasoning to decide which tool to call at which step. Avoid hard-coding tool calls to specific steps unless absolutely required; the agent's value comes from reasoned tool selection.

How do I design multiple candidate plans instead of one?

Decompose the goal into an ordered list of sub-tasks, then generate Plan A and Plan B where feasible. Evaluate each on efficiency (which is faster), cost (which is cheaper), risk (what happens if it fails), and alignment with constraints. Present plans to the human for selection when cost or risk is significant. Never hard-code a single plan — the agent must be able to revise it.

How do I use Pydantic throughout an agentic system?

Use Pydantic models for input validation (goal objects, user prompts), tool output validation (API responses before passing to the LLM), state schema validation (LangGraph state objects), and LLM output parsing (structured agent responses). Pydantic prevents malformed data from silently propagating through multi-step workflows, where a single bad value can cause hard-to-debug downstream failures.

How do I deploy an agentic system to production?

Package the system with Docker, expose it via a FastAPI backend, and set environment variables for all API keys and database URLs. Configure a GitHub Actions CI/CD pipeline and deploy to AWS for scalable production or Render for simpler managed hosting. Implement production folder structure, logging, and monitoring from day one — not as an afterthought.

// Troubleshooting

My agent keeps looping and never finishes — how do I fix it?

First, instrument with LangSmith to trace every reasoning step and state transition, which reveals where the loop forms. Common causes are missing or incorrect exit conditions in iterative workflows and the agent reselecting the same failing tool. Add explicit stop conditions to iterative nodes, validate tool outputs with Pydantic, and ensure conditional edges have a terminating branch that routes to the End node.

Why is my agent selecting the wrong tool?

Usually because tool descriptions are vague or the LLM-brain lacks the reasoning capacity for the task. Use LangSmith traces to see the reasoning behind each selection. Improve the tool descriptions so the LLM understands when each applies, consider a more capable model, and avoid overlapping tools that do similar things. Never hard-code tool routing as a workaround unless the step genuinely requires it.

My agent took an irreversible action I didn't approve — what went wrong?

You gave it autonomy without permission scopes or skipped a HITL checkpoint at a high-risk step. Identify every irreversible or consequential action — sending emails, spending money, writing to production — and insert HITL pauses where the agent presents its action and waits for approval. Add permission scopes limiting what the agent can execute independently, and implement override controls to pause or halt it anytime.

My agent can't answer 'what's the status?' after a session gap — why?

Because it's missing long-term memory. Short-term state lives only in-session and is lost after interruption. Persist goal metadata, progress markers, and conversation history to a database, and use LangGraph's checkpointer to save state between runs. With persistent memory and a checkpointer, the agent can resume from its last state and accurately report current progress.

Why does my parallel workflow run sequentially despite using LangGraph?

LangGraph relies on asynchronous Python to run nodes in parallel. If your node functions are synchronous or contain blocking calls, execution falls back to sequential, defeating the parallel design. Convert node functions to async, use async-compatible tool clients, and avoid blocking I/O inside nodes so independent sub-tasks can genuinely run simultaneously.

// Comparisons

Agentic AI vs a plain LLM call — when is each right?

Use a plain LLM call when the answer is already in the model's training data and the task is a single reasoning step. Use agentic AI when the task is real-time, multi-step, tool-dependent, or requires autonomous decision-making and adaptation. Agentic systems carry significant complexity — memory, tools, HITL, guardrails, deployment — so reach for them only when a simpler approach genuinely can't solve the problem.

RAG vs agentic systems — which handles real-time data better?

Agentic systems handle real-time data far better. RAG retrieves from a static knowledge base you must manually update, so it fails on continuously changing information like live news, weather, or stock prices. An agent reasons about when internal knowledge is insufficient and calls a live search API or tool instead. RAG still fits static private documents, and agents can use RAG as one tool among many.

LangGraph vs raw Python for agent workflows — what's the difference?

You cannot practically build a production agentic system with raw Python alone. LangGraph provides graph-based workflow management — nodes, edges, conditional routing, state schemas, and a checkpointer for persistent memory — that would be fragile and unmaintainable to hand-roll. LangChain handles LLM loading and prompts beneath it. Raw Python forces you to reinvent orchestration, memory persistence, and branching logic from scratch.

Single-agent vs multi-agent architecture — when do I need multiple agents?

Use a single agent when one reasoning loop with a set of tools can cover the goal. Move to a multi-agent system when the goal is too large or spans multiple domains for one agent — then split work across specialized agents, each a node in a LangGraph, running sequentially, in parallel, or conditionally. Multi-agent adds coordination complexity, so only split when specialization clearly improves reliability.

// Advanced

How do guardrails differ from HITL checkpoints?

Guardrails are hard rules the agent can never violate regardless of reasoning — enforced above the LLM layer and not overridable by any prompt, like 'never exceed budget X.' HITL checkpoints are designed pauses where the agent requests human approval before proceeding on a specific action. Guardrails prevent certain actions outright; HITL defers judgment to a human. Robust systems use both together.

How should an agent detect and recover from a failing plan?

Design the agent to monitor outcome metrics against the goal — for example, too few job applications received. When a threshold signals failure, route through a conditional edge to a revision node that changes strategy: rewrite the job description, switch platforms, or adjust parameters, while staying aligned with the original goal. The core value of agentic systems is this adaptability; never treat the first plan as fixed.

How do I decide when the agent should query RAG versus a live API versus its own weights?

Let the LLM-brain decide via reasoning, not hard-coded routing. Give it the vector store as a knowledge-base tool and live APIs as separate tools, with clear descriptions. The agent reasons: is this in my training data (answer directly), in private documents (query RAG), or real-time (call the live API)? Clear tool descriptions and a capable model make this routing reliable.

What should I monitor with LangSmith in production?

Log every tool call, LLM reasoning step, state transition, and HITL interaction. Use traces to spot incorrect tool selections, unnecessary reasoning loops, and silent API failures. In production, agents fail in non-obvious ways, so step-by-step tracing is how you diagnose and fix issues. Set up LangSmith from day one rather than retrofitting observability after failures appear.

How do I validate tool outputs before the LLM acts on them?

Wrap every tool output in a Pydantic model that defines the expected structure and types, and validate the API response before passing it to the LLM. If validation fails, route to an error-handling node instead of feeding malformed data forward. This prevents a bad API response from silently corrupting reasoning several steps downstream in a multi-step workflow.

Can one agent answer directly for some questions and use tools for others?

Yes — that's the intended behavior. For pre-cutoff knowledge like Python basics, the agent's LLM-brain reasons that no tool is needed and answers directly. For post-cutoff or real-time questions like breaking news, it reasons that internal weights are insufficient, selects the web search tool, retrieves sources, and returns a cited answer. The decision is made by reasoning, not fixed routing.