Tejas AI Agentic AI Builder Framework

Design, build, and deploy production-grade AI agent systems by applying the complete Agentic AI methodology — from core loop architecture through RAG, vector memory, multi-agent topologies, and safety guardrails.

// TL;DR

The Tejas AI Agentic AI Builder Framework is a complete methodology for designing, building, and deploying production-grade AI agent systems. It covers the core agent loop (Perceive → Think → Act → Observe), ReAct reasoning, tool design, four-layer memory, RAG pipelines, multi-agent topologies, MCP connectivity, cost optimization, and safety guardrails. Use it whenever you need an AI system that pursues goals autonomously rather than simply responding to prompts — including decisions about architecture, memory strategy, retrieval design, tool selection, multi-agent structure, or safety policy. It's the go-to reference for anyone moving beyond chatbots into true agentic applications.

// When should you use the Tejas AI Agentic AI Builder Framework?

Use this skill whenever you need to design or evaluate an AI system that must pursue goals autonomously rather than simply respond to prompts — including when deciding architecture, memory strategy, retrieval design, tool selection, multi-agent topology, or safety policy for any agentic application.

// What do you need before designing an agent with this framework?

  • task_goalrequired
    The high-level goal or problem the agent system must solve (not a step-by-step instruction — a result to achieve)
  • knowledge_sources
    Documents, databases, or APIs the agent needs access to that are outside its training data
  • available_tools
    List of tool categories or specific APIs/services the agent can call (web search, code execution, email, file I/O, etc.)
  • scale_and_environment
    Prototype vs. production, expected volume, cost sensitivity, and whether any actions are irreversible
  • number_of_agents
    Whether you expect a single-agent or multi-agent design, and any known specialisations required

// What are the core principles of building agentic AI systems?

Chatbot vs. Agent Distinction

A chatbot is reactive — it responds. An agent is autonomous — it pursues goals. The five properties that make something truly agentic are: Perception, Reasoning, Planning, Action, and Adaptation. A system missing any of these is not a true agent.

The Core Agent Loop (Perceive → Think → Act → Observe)

Every AI agent runs on a continuous loop: perceive input, think using everything in the context window, act by calling a tool or delivering a final answer, then observe the result and loop back to think. This loop is the foundation of all agent design, debugging, and improvement.

ReAct (Reasoning + Acting)

Before every action, the agent explicitly writes out its thought process. This prevents impulsive tool calls, creates an auditable paper trail of logic, and makes failures diagnosable. Format: Thought → Action → Observation → Thought → … → Final Answer.

Tools as Superpowers

An LLM alone is a genius locked in a room with no phone and no internet. Tools — web search, code execution, file I/O, communication APIs, meta-tools — are how you give that genius access to the world. Tool description quality is as important as tool capability: a vague description causes wrong tool selection every time.

Four-Layer Memory Architecture

Agents need four memory types: Sensory Memory (raw current input, single-step), Working Memory (active context window), Episodic Memory (long-term event history, stored externally), and Semantic Memory (long-term facts and preferences, stored externally). Episodic and Semantic memory require vector databases.

RAG (Retrieval Augmented Generation)

Instead of baking proprietary or recent knowledge into the model, retrieve it at the moment it is needed. Index documents as vector chunks, convert the user query to a vector, retrieve the most similar chunks, inject them into the prompt, and generate a grounded answer. This eliminates hallucination about unknown or outdated information.

Minimal Footprint & Preference for Reversibility

Agents should only request permissions they actually need and, when two paths achieve the same result, always prefer the one that can be undone. When uncertain, escalate to a human rather than guess. Safety is foundational, not optional.

The 60-30-10 Cost Rule

Route 60% of tasks (simple classification, basic formatting) to cheap fast models, 30% (moderate research, synthesis) to mid-tier models, and reserve the top 10% (complex orchestration, high-stakes decisions) for your most powerful models. This keeps costs sane while maintaining quality where it matters.

// How do you build a production AI agent step by step?

  1. 1

    Classify the task as chatbot-suitable or truly agentic

    Check the five agentic properties: Perception, Reasoning, Planning, Action, Adaptation. If the task only needs the first two partially, a chatbot suffices. If it requires multi-step planning, real-world actions, or adaptation over time, proceed as an agent design.

  2. 2

    Choose and document the agentic architecture pattern

    Select from: ReAct (general-purpose, unpredictable paths), Chain of Thought (math/logic/multi-step reasoning), Plan and Execute (predictable workflows), Tree of Thoughts (creative/strategic problems), Reflection (tasks with verifiable outputs like code), or LATS (high-stakes optimisation). Most production systems use ReAct + Reflection. Document your choice and rationale.

  3. 3

    Define and describe all tools the agent will use

    Categorise tools: Information (search, APIs), Computation (code execution, calculators), File (read/write), Communication (email, Slack), Meta (sub-agents, image gen). Write precise, unambiguous descriptions for each tool — the LLM selects tools based solely on these descriptions. Enable parallel tool calling wherever tasks are independent.

  4. 4

    Design the memory architecture for the task duration and knowledge requirements

    Working Memory is always active (context window). For tasks spanning sessions, add Episodic Memory. For persistent user preferences or domain facts, add Semantic Memory. Both require an external vector database. Choose Chroma for prototyping (5-minute local setup), Pinecone or Qdrant for production.

  5. 5

    Build a RAG pipeline if the agent needs access to private or recent knowledge

    Three phases: (1) Indexing — chunk documents, embed with a chosen embedding model, store in vector DB. (2) Retrieval — embed the query, run similarity search (cosine similarity for text), pull top-k chunks. (3) Generation — inject retrieved chunks into the prompt alongside the question. Critical rule: always use the same embedding model for indexing and querying. Experiment with hierarchical chunking (small precise chunks + larger parent chunks) for best precision-context balance. Consider Agentic RAG — letting the agent treat retrieval as a tool and iterate if the first retrieval is insufficient.

  6. 6

    Decide on single-agent vs. multi-agent topology

    Use a single agent for tasks that fit within one context window and don't require deep simultaneous specialisation. Move to multi-agent when: context would overflow, parallelism would save significant time, or specialist expertise is needed. Topology options: Sequential Pipeline (assembly line), Parallel + Aggregator (independent subtasks), Hierarchical Manager-Worker (orchestrator delegates to specialised subagents — most common in production), Debate Pattern (proposer + critic + judge for high-quality outputs).

  7. 7

    Select a framework appropriate to the complexity level

    LangChain + LangGraph for complex stateful multi-agent workflows with loops and conditional branching. LlamaIndex for RAG-heavy, knowledge-base systems. AutoGen for autonomous multi-agent conversations and coding tasks. CrewAI for beginner-friendly role-based (researcher, writer, analyst) multi-agent setups. Do not build all infrastructure from scratch — choose a framework and extend it.

  8. 8

    Evaluate MCP (Model Context Protocol) for tool connectivity

    If the agent needs to connect to standard services (GitHub, Notion, Slack, Google Drive, PostgreSQL, Brave Search, AWS, Sentry), check whether an MCP server already exists. MCP is the universal standard (created by Anthropic) for AI-to-tool connections — build one integration once, works with any MCP-compatible model. Use MCP to avoid bespoke per-service integrations.

  9. 9

    Implement advanced cost and efficiency patterns

    Apply the 60-30-10 Cost Rule for model routing. Apply the Iceberg Technique: keep only core rules in the context window and give the agent grep/read tools to surgically retrieve additional context — this cuts token costs 60-80% on complex tasks. Enable parallel tool calling wherever tasks are independent. Set a hard maximum number of steps on every agent to prevent infinite loops and runaway API costs.

  10. 10

    Build safety guardrails into the design before first run

    Implement: Input Guardrails (validate what enters the agent), Output Guardrails (validate what the agent is about to do before it acts), Human-in-the-Loop Checkpoints (pause before irreversible actions), Sandboxing (isolate all code execution), and Rate Limiting (cap runaway API calls). Defend against Prompt Injection — malicious content in external data (websites, files) that attempts to hijack agent instructions. Apply Minimal Footprint (only request needed permissions) and Preference for Reversibility at every design decision.

  11. 11

    Instrument observability and define success metrics before deploying

    Track: success rate (did the agent achieve the goal?), step efficiency (how many loop iterations per task?), latency (end-to-end time), and cost (tokens and API calls per task). Log every ReAct thought-action-observation triple so failures are diagnosable. Start small: one agent, one task, a few tools, working end-to-end, then add complexity on a working foundation.

// What do real agentic AI builds look like in practice?

A company wants an agent to monitor competitor pricing and produce a weekly summary report emailed to the leadership team.

Classify as agentic (requires Perception of live web data, Planning across steps, Action via email). Choose ReAct architecture. Define tools: web search (Information), email sender (Communication). No private knowledge base needed so RAG is optional. Single agent sufficient for this task volume. Apply the 60-30-10 rule: route the search summarisation to a mid-tier model, final synthesis and email drafting to a top-tier model. Add Output Guardrails to validate email content before send, and a Human-in-the-Loop checkpoint for the first few runs. Set a max-step limit. Deploy with full ReAct logging so every reasoning step is auditable.

A legal firm wants to answer questions about its internal case files, which total hundreds of PDFs not in any LLM's training data.

This is a RAG use case. Index phase: chunk all PDFs (use hierarchical chunking — small chunks for precise retrieval, parent chunks for full context), embed with a consistent model (e.g. text-embedding-3-large), store in Qdrant for production-grade filtering. Retrieval phase: embed each user query, run cosine similarity search, pull top-k chunks. Generation phase: inject retrieved chunks into the LLM prompt with the question. Use Agentic RAG so the agent can do a second retrieval round if the first pass is insufficient for complex legal questions. Apply the same embedding model for indexing and querying without exception.

A software team wants an AI system that can take a feature request and produce tested, documented code with no human writing a single line.

This requires a Hierarchical Manager-Worker multi-agent topology. Orchestrator agent receives the feature request, breaks it into subtasks, and delegates. Architect subagent designs the system. Coder subagents (parallel) implement components. Test subagent writes and runs tests. Review subagent checks code quality and security. Documentation subagent writes docs. Use AutoGen or LangGraph for stateful coordination. Apply the Reflection architecture pattern so agents that produce failing tests revise and retry. Sandbox all code execution. Use the Debate Pattern (proposer + critic) for the architecture design phase to improve output quality. Apply the Iceberg Technique to avoid loading the entire codebase into context — give agents grep/read tools instead.

// What mistakes should you avoid when building AI agents?

  • Treating an agent like a chatbot — giving it step-by-step instructions instead of a goal, which defeats the purpose of autonomy.
  • Writing vague tool descriptions — the LLM selects tools based entirely on descriptions, so imprecision causes wrong tool selection on every call.
  • Using different embedding models for indexing and querying — the vectors become completely incompatible and retrieval results will be garbage.
  • Skipping a maximum step limit — a single bug can cause an infinite loop resulting in thousands of API calls and catastrophic cost.
  • Ignoring Prompt Injection — malicious text embedded in external content (websites, files) can hijack agent instructions and cause real, irreversible harm.
  • Granting excessive permissions — violates Minimal Footprint; agents should only have the permissions they actually need for the current task.
  • Choosing irreversible action paths when reversible alternatives exist — always prefer reversibility by design.
  • Loading the entire knowledge base or codebase into the context window — use the Iceberg Technique with surgical read/grep tools instead, saving 60-80% in token costs.
  • Skipping observability — without logging every ReAct thought-action-observation triple, failed agent runs are impossible to diagnose.
  • Building complex multi-agent systems before validating a single-agent baseline — always get one agent working end-to-end before adding agents or complexity.
  • Assuming a larger context window is always better — more tokens means higher cost, slower responses, and potential loss of focus on earlier context.

// What are the key terms in agentic AI you need to know?

Agentic AI
An autonomous AI system that can perceive its environment, reason about goals, plan multi-step approaches, take actions using tools, and adapt based on results — all with minimal human hand-holding. Distinguished from a chatbot by possessing all five properties: Perception, Reasoning, Planning, Action, Adaptation.
Core Agent Loop (Perceive → Think → Act → Observe)
The fundamental operating cycle of every AI agent: perceive input, think using the full context window, act by calling a tool or returning a final answer, observe the result, then loop back to think. Also called the Perceive-Reason-Act loop or Think-Act-Observe loop.
ReAct (Reasoning + Acting)
An agentic architecture pattern where the agent explicitly writes its thought process before every action, creating a Thought → Action → Observation chain. Prevents impulsive tool calls and produces an auditable reasoning trail.
Context Window
The model's working memory — the total amount of information (measured in tokens) the LLM can see and use at once. Everything outside the context window the model simply does not know about.
Token
The basic unit of text an LLM processes, roughly three-quarters of a word. LLMs predict the next token given all previous tokens.
Temperature
A setting controlling how creative or predictable an LLM's token predictions are. Zero means always pick the most likely next token (factual tasks); higher values introduce creative, sometimes surprising choices (brainstorming).
Function Calling / Tool Use
The ability of modern LLMs (Claude, GPT-4, etc.) to decide which tool to call, when to call it, and with what arguments. The mechanism that makes agents capable of real-world action.
RAG (Retrieval Augmented Generation)
A technique for grounding LLM answers in private or recent knowledge without retraining. Three phases: Index (chunk documents, embed, store in vector DB), Retrieve (embed query, find similar chunks), Generate (inject chunks into prompt, produce grounded answer).
Agentic RAG
A RAG pattern where the agent treats retrieval as a tool, can trigger multiple retrieval rounds if initial results are insufficient, and decides when and what to retrieve rather than following a fixed pipeline.
Embedding
A representation of text meaning as a high-dimensional numerical vector. Similar meanings produce vectors that are close together in mathematical space, enabling semantic search — finding conceptually related content even when different words are used.
Vector Database
A specialised database for storing, indexing, and searching high-dimensional embedding vectors using approximate nearest-neighbour algorithms (e.g. HNSW) and cosine similarity. Essential for RAG and long-term agent memory.
Cosine Similarity
The similarity metric used for text vectors, measuring the angle between two vectors. A small angle means high semantic similarity. The standard metric for text retrieval in vector databases.
HNSW (Hierarchical Navigable Small World)
The indexing algorithm used by most vector databases to find approximate nearest neighbours quickly — navigates a smart graph structure instead of comparing every stored vector, trading a negligible accuracy loss for massive speed gains.
Hierarchical Chunking
A RAG chunking strategy that stores small precise chunks for accurate retrieval and larger parent chunks for full context. Combines the precision of small chunks with the contextual completeness of large ones.
MCP (Model Context Protocol)
An open standard created by Anthropic defining a universal way for AI models to connect to external tools, data sources, and services. The USB port for AI — build one integration once and it works with any MCP-compatible model.
Four-Layer Memory Architecture
The agent memory model comprising: Sensory Memory (raw current input), Working Memory (active context window), Episodic Memory (long-term event history, external DB), and Semantic Memory (long-term facts and preferences, external DB).
Orchestrator (Manager) Agent
In a Hierarchical Manager-Worker multi-agent topology, the agent that receives a high-level goal, breaks it into subtasks, delegates to specialised subagents, and synthesises their outputs.
Debate Pattern
A multi-agent adversarial collaboration pattern: one agent proposes a solution, a second critiques it, the first revises, and a third judge agent selects the best version. Consistently produces higher-quality outputs than any single agent.
Reflection Architecture
An agentic pattern where the agent tries a task, explicitly analyses what went wrong or was imperfect, then retries with that reflection incorporated. Enables self-improvement through failure, particularly effective for coding and verifiable tasks.
Tree of Thoughts
An agentic architecture where the agent branches out and explores multiple lines of reasoning simultaneously, evaluates which branch is most promising, and selects accordingly. Analogous to a chess player considering multiple moves at once.
LATS (Language Agent Tree Search)
An advanced agentic architecture combining tree search (like AlphaGo), ReAct, and Reflection. The agent explores a tree of possible actions, evaluates branches, and learns from failures. Expensive but powerful for high-stakes optimisation.
Prompt Injection
A security attack where malicious instructions embedded in external content (websites, files, API responses) attempt to hijack the agent's behaviour by overriding its original instructions. A real production threat, not theoretical.
Minimal Footprint
A safety design principle: agents should only request the permissions they actually need for the current task, minimising the blast radius of any mistake or attack.
Preference for Reversibility
A safety design principle: when two paths achieve the same result, always choose the one whose effects can be undone over a permanent action.
Iceberg Technique
A cost management pattern where only core essential rules are kept in the context window and the agent uses grep/read tools to surgically pull in additional knowledge as needed. Can reduce token costs by 60-80% on complex tasks.
60-30-10 Cost Rule
A model routing strategy: 60% of tasks (simple, fast) go to cheap models, 30% (moderate research/synthesis) to mid-tier models, 10% (complex orchestration, high-stakes decisions) to the most powerful models.
Transformer Architecture
The neural network design introduced in Google's 2017 'Attention Is All You Need' paper, which powers all major LLMs (GPT, Claude, Gemini). Key innovation: the attention mechanism, which lets the model calculate how every word relates to every other word in a sequence simultaneously rather than sequentially.
Attention Mechanism
The core innovation of the Transformer: for every token in a sequence, the model calculates a weighted relationship to every other token, enabling context-sensitive word meaning (e.g. 'bank' near 'river' vs. 'bank' near 'money').
Parallel Tool Calling
The ability of modern agents to fire off multiple tool requests simultaneously rather than sequentially, then synthesise all results at once. A major efficiency gain for tasks with independent subtasks.

// FREQUENTLY ASKED QUESTIONS

What is the Tejas AI Agentic AI Builder Framework?

The Tejas AI Agentic AI Builder Framework is an end-to-end methodology for building production-grade AI agents. It covers the core agent loop, ReAct reasoning, tool design, four-layer memory, RAG, multi-agent topologies, MCP connectivity, cost rules, and safety guardrails. It gives you a repeatable process for taking an agent from concept to deployed, observable, cost-controlled system.

What is the difference between an AI agent and a chatbot?

A chatbot is reactive — it responds to prompts. An agent is autonomous — it pursues goals. The five properties that make something truly agentic are Perception, Reasoning, Planning, Action, and Adaptation. If a system lacks any of these, it is not a true agent. Use an agent only when the task needs multi-step planning, real-world actions, or adaptation over time.

How do I decide if my task needs an agent or just a chatbot?

Check the five agentic properties: Perception, Reasoning, Planning, Action, and Adaptation. If your task only needs partial perception and reasoning — like answering a single question — a chatbot suffices. If it requires multi-step planning, taking real-world actions through tools, or adapting over time, build an agent. Always validate a simple version before adding complexity.

How do I build a RAG pipeline for my AI agent?

Build a RAG pipeline in three phases: Index (chunk documents, embed with a chosen model, store in a vector database), Retrieve (embed the query, run cosine similarity search, pull top-k chunks), and Generate (inject retrieved chunks into the prompt with the question). The critical rule: always use the same embedding model for indexing and querying, or your vectors become incompatible and retrieval fails.

How does agentic AI compare to prompt engineering?

Prompt engineering optimizes a single response from a model; agentic AI designs an autonomous system that loops, uses tools, remembers, and adapts across many steps. Prompt engineering is one component inside an agent (tool and thought formatting), but the framework adds memory architecture, retrieval, multi-agent topologies, cost routing, and safety guardrails that a single prompt cannot provide.

When should I use a multi-agent system instead of a single agent?

Use a single agent when the task fits in one context window and needs no deep specialization. Move to multi-agent when context would overflow, parallelism would save significant time, or specialist expertise is needed. Common topologies include Sequential Pipeline, Parallel + Aggregator, Hierarchical Manager-Worker (most common in production), and the Debate Pattern for high-quality outputs.

What results can I expect from applying this framework?

Expect agents that reliably achieve goals, cost far less to run, and are diagnosable when they fail. The 60-30-10 cost rule and Iceberg Technique can cut token costs 60-80%, ReAct logging makes failures auditable, and safety guardrails prevent runaway costs and irreversible mistakes. You get production readiness — measurable success rate, step efficiency, latency, and cost per task.

What is the core agent loop in agentic AI?

The core agent loop is the fundamental operating cycle of every AI agent: perceive input, think using the full context window, act by calling a tool or returning a final answer, observe the result, then loop back to think. Also called Perceive → Think → Act → Observe. It is the foundation of all agent design, debugging, and improvement.

How do I stop my AI agent from running up huge API costs?

Set a hard maximum step limit on every agent to prevent infinite loops, apply the 60-30-10 cost rule to route simple tasks to cheap models, use the Iceberg Technique to keep only core rules in context while grepping for more, and enable parallel tool calling for independent tasks. Add rate limiting as a final safety cap.

What is MCP and when should I use it for my agent?

MCP (Model Context Protocol) is an open standard created by Anthropic for connecting AI models to external tools and data sources — the USB port for AI. Use it when your agent needs to connect to standard services like GitHub, Notion, Slack, Google Drive, or PostgreSQL. Build one integration once and it works with any MCP-compatible model, avoiding bespoke per-service code.

What are the four types of memory an AI agent needs?

Agents need four memory types: Sensory Memory (raw current input, single-step), Working Memory (the active context window), Episodic Memory (long-term event history stored externally), and Semantic Memory (long-term facts and preferences stored externally). Episodic and Semantic memory both require a vector database. Choose your memory layers based on task duration and knowledge persistence needs.

// GET THIS SKILL — FREE

Use this skill in your AI

Every skill on SkillForge is free. Drop your email and copy this skill straight into Claude, ChatGPT, or any LLM.

We'll email you when new skills drop. Unsubscribe anytime.