Data Science + GenAI
Data Analytics + GenAI
Programs from ₹5,000
New Batch Starts: Coming Soon

Agentic AI

AI agents, multi-agent systems, and autonomous AI workflows.

Practice Questions

AI Agents are autonomous systems that can perceive their environment, make decisions, and take actions to achieve specific goals. They use LLMs as their reasoning engine, combined with tools (APIs, databases, web search), memory systems, and planning capabilities to solve complex multi-step problems without constant human intervention.

Agentic AI refers to AI systems that can pursue a goal with a degree of autonomy: they plan steps, decide which actions or tools to use, execute them, observe the results and adjust until the task is done. Unlike a single chatbot response, an agentic system works in a loop and can complete multi-step tasks such as researching a topic, booking meetings or fixing code.

A chatbot mainly responds to messages in a conversation, usually in a single turn, based on its knowledge or provided context. An AI agent is goal-driven: it can break a task into steps, call tools and APIs, take actions in other systems, remember progress and iterate until the goal is achieved. Many modern assistants combine both.

• LLM (the 'brain'): reasoning and decision-making • Instructions/goal: what the agent must achieve and its constraints • Tools: APIs, search, databases, code execution, email, etc. • Memory: short-term (current conversation/task) and long-term (stored knowledge) • Planning: breaking goals into steps • Execution loop: act, observe the result, decide the next step • Guardrails: permissions, limits and human approval for risky actions

ReAct (Reason + Act) is a prompting pattern where the model alternates between reasoning and acting: it writes a Thought about what to do next, takes an Action (calls a tool), receives an Observation (the tool's result) and repeats until it can give a Final Answer. Interleaving reasoning with real tool results reduces hallucinations and lets the agent adapt its plan.

The developer describes available tools to the LLM (name, description, input schema). When the model decides a tool is needed, it outputs a structured tool call with arguments. The application runs the tool — e.g., a web search, SQL query or API call — and returns the result to the model, which then decides the next step. Clear tool descriptions and strict input validation are key to reliable behaviour.

• Short-term (working) memory: the current conversation and intermediate results kept in the context window. • Long-term memory: information stored outside the model (e.g., in a vector database or key-value store) and retrieved when relevant, such as user preferences or past decisions. • Episodic memory: records of past tasks and outcomes. • Procedural memory: learned instructions or workflows. Summarising old context helps keep the context window manageable.

Planning is how an agent breaks a complex goal into smaller, ordered steps before or during execution. Approaches include plan-then-execute (create a full plan, then run each step), iterative planning (decide the next step after each observation), and task decomposition into sub-tasks assigned to specialised agents. Good planning improves reliability on long tasks and makes the agent's behaviour easier to inspect.

A multi-agent system uses several specialised agents that collaborate on a task — for example a researcher agent, a writer agent and a reviewer agent. Agents communicate by passing messages or results, often coordinated by a supervisor/orchestrator agent. Benefits: separation of concerns, specialised prompts and tools, and parallel work. Drawbacks: more cost, latency and complexity to debug.

• LangGraph: builds agents as stateful graphs of nodes and edges; strong control over flows, loops, branching and human-in-the-loop steps. • CrewAI: role-based multi-agent framework where you define agents with roles, goals and tasks that collaborate as a 'crew'. • AutoGen (Microsoft): focuses on multi-agent conversations where agents (and humans) chat to solve tasks. Other options include the OpenAI Agents SDK, LlamaIndex agents and n8n/low-code automation tools.

An AI workflow follows predefined steps written by a developer (e.g., extract → summarise → email), where the LLM is used at certain steps. An agent decides its own steps dynamically based on the goal and observations. Workflows are more predictable, cheaper and easier to test; agents are more flexible for open-ended tasks. Many production systems start with workflows and add agentic steps only where needed.

Guardrails are controls that keep an agent safe and on-task: • Input validation and filtering of harmful or off-topic requests • Restricting tools and permissions to the minimum needed (least privilege) • Output validation (schemas, policy checks, PII redaction) • Limits on steps, time and spend to prevent runaway loops • Human approval before sensitive actions (payments, deletions, sending emails) • Logging and monitoring for auditing

Human-in-the-loop means a person reviews, approves or corrects the agent at key points — for example approving a drafted email before it is sent, confirming a purchase, or resolving ambiguous cases. It reduces risk, builds trust and provides feedback that can improve the agent. It is essential for high-impact or irreversible actions.

• Task success rate on a benchmark set of realistic tasks • Correctness and quality of final outputs • Tool-use accuracy (right tool, right arguments) • Efficiency: number of steps, latency and cost per task • Safety: policy violations, unwanted actions • Trace review: inspect step-by-step logs to find failure patterns Tools like LangSmith, Langfuse or custom logging help capture traces.

• Infinite or repetitive loops • Choosing the wrong tool or passing wrong arguments • Hallucinating tool results or facts • Losing track of the goal in long tasks (context overflow) • Over-confidence and not asking for clarification • Being manipulated by prompt injection from web pages or documents • High cost due to too many LLM calls Mitigations: step limits, better tool descriptions, validation, memory summaries and human checkpoints.

MCP is an open protocol, introduced by Anthropic, that standardises how AI applications connect to external tools and data sources. An MCP server exposes tools, resources and prompts (for example, access to a database, GitHub or a CRM), and any MCP-compatible client or agent can use them. It works like a common 'plug' so integrations don't have to be rebuilt for every AI app.

In a multi-agent system, the orchestrator receives the overall goal, breaks it into sub-tasks, assigns them to specialised worker agents, collects their results, checks quality and decides what to do next or when the task is complete. It keeps the system coordinated and avoids agents working at cross purposes.

Self-reflection is a technique where the agent reviews its own output or plan, identifies mistakes or gaps, and revises before finalising — for example, writing code, running tests, reading the errors and fixing the code. A separate 'critic' agent or step can also evaluate the work. It improves quality on complex tasks at the cost of extra LLM calls.

• Persist state (progress, intermediate results) in a database so tasks can resume after failures • Break the work into checkpoints • Summarise history to stay within the context window • Run steps asynchronously or in background queues • Add timeouts, retries and step limits • Notify users of progress and when approval is needed

• Least-privilege access: give each tool only the permissions it needs • Use scoped, revocable credentials and never expose secrets to the model • Treat all external content (web pages, emails, files) as untrusted to reduce prompt-injection risk • Require approval for destructive or financial actions • Sandbox code execution • Log every action for auditing and alert on unusual behaviour • Rate-limit and cap spending

• Customer support agents that look up orders and process refunds • Sales agents that research leads and draft personalised outreach • Coding agents that write, test and fix code • Research agents that search the web and produce reports with sources • Data analysis agents that query databases and build charts • IT/ops agents that triage tickets and run diagnostics • Personal assistants that manage email and calendars

A function schema defines a tool's name, description and the exact structure and types of its arguments. The LLM uses it to decide when to call the tool and how to format arguments correctly. Precise schemas with clear descriptions, required fields and enums reduce errors, and the application should still validate arguments before executing the tool.

Completion can be determined by: the LLM judging that the goal has been met and returning a final answer; explicit success criteria in the instructions (e.g., 'all tests pass', 'report contains 5 sources'); a verification step or critic agent checking the result; or hard limits on steps, time or cost. Clear stopping criteria prevent endless loops.

Autonomous agents complete tasks end-to-end without human involvement once given a goal. Semi-autonomous agents work independently on routine steps but pause for human input or approval at defined checkpoints. In business settings, semi-autonomous designs are usually preferred because they balance efficiency with control, especially for actions that are costly or hard to undo.

• Use smaller, cheaper models for simple steps and a stronger model only for complex reasoning • Limit the number of steps and tool calls • Keep prompts and context concise; summarise history • Cache tool results and repeated LLM calls • Use deterministic code instead of the LLM where logic is simple • Prefer workflows over open-ended agents when the steps are known

Task decomposition is breaking a large, complex goal into smaller sub-tasks that can be solved one at a time or by different agents. For example, 'write a market report' becomes: gather data, analyse competitors, summarise findings, create charts and write the report. It makes problems manageable and improves accuracy and traceability.

The system prompt defines the agent's role, goal, available tools and when to use them, rules and constraints, the output format and how to behave when uncertain (e.g., ask for clarification). A well-written system prompt is one of the biggest factors in agent reliability; it should be specific, include examples where helpful, and be tested against realistic tasks.

1. Give the agent the database schema (tables, columns, descriptions) or a tool to inspect it. 2. Provide a tool that runs read-only SQL queries with a row limit. 3. The agent translates the question into SQL, runs it, observes results or errors and retries with corrections. 4. It summarises results in plain language and optionally creates a chart. 5. Guardrails: read-only credentials, query timeouts, blocking of destructive statements, and logging of all queries.

Knowledge retrieval (RAG) gives the agent information to read — documents and passages relevant to the question. Tools let the agent take actions or fetch live data — calling APIs, running code, sending messages or updating records. RAG is often itself exposed as one of the agent's tools (a 'search knowledge base' tool).

Observability means capturing detailed traces of each agent run: prompts, model outputs, tool calls with arguments and results, latency, token usage and errors. This makes it possible to debug failures, find where the agent goes wrong, measure cost and compare versions. Tools include LangSmith, Langfuse, Arize Phoenix and OpenTelemetry-based logging.

• Python programming and working with APIs (REST, JSON) • Fundamentals of LLMs, prompt engineering and function calling • RAG basics: embeddings and vector databases • An agent framework such as LangGraph, CrewAI or the OpenAI Agents SDK • Basic databases and SQL • Deployment (FastAPI, Docker, cloud) and evaluation/monitoring practices Building small real projects is the fastest way to learn.