Frequently Asked Questions About Tejas AI Agentic AI Builder Framework
23 answers covering everything from basics to advanced usage.
// Basics
What makes an AI system 'agentic'?
An AI system is agentic when it possesses all five properties: Perception (sensing its environment or inputs), Reasoning (thinking about goals), Planning (breaking goals into multi-step approaches), Action (using tools to affect the real world), and Adaptation (adjusting based on results). Missing any one of these means it is not a true agent — it's a chatbot or a scripted workflow.
What is ReAct and why does it matter?
ReAct (Reasoning + Acting) is an architecture pattern where the agent explicitly writes its thought process before every action, forming a Thought → Action → Observation chain. It prevents impulsive tool calls, creates an auditable paper trail of logic, and makes failures diagnosable. Most production systems combine ReAct with the Reflection pattern for reliability and self-correction.
What is an embedding in the context of RAG?
An embedding is a representation of text meaning as a high-dimensional numerical vector. Similar meanings produce vectors that sit close together in mathematical space, enabling semantic search — finding conceptually related content even when different words are used. RAG indexes document chunks as embeddings, then embeds queries to find the closest matching chunks via cosine similarity.
What is a vector database and why do agents need one?
A vector database stores, indexes, and searches high-dimensional embedding vectors using approximate nearest-neighbor algorithms like HNSW and cosine similarity. Agents need one for RAG and for long-term memory — both Episodic and Semantic memory require external vector storage. Use Chroma for prototyping (5-minute local setup) and Pinecone or Qdrant for production.
// How To
How do I write good tool descriptions for my agent?
Write precise, unambiguous tool descriptions because the LLM selects tools based solely on these descriptions. State exactly what the tool does, when to use it, and what arguments it takes. A vague description causes wrong tool selection on every call. Categorize tools as Information, Computation, File, Communication, or Meta, and describe each one's specific purpose clearly.
How do I choose which agentic architecture pattern to use?
Match the pattern to the task: ReAct for general-purpose unpredictable paths, Chain of Thought for math and logic, Plan and Execute for predictable workflows, Tree of Thoughts for creative or strategic problems, Reflection for tasks with verifiable outputs like code, and LATS for high-stakes optimization. Most production systems use ReAct + Reflection. Always document your choice and rationale.
How do I implement hierarchical chunking in a RAG pipeline?
Hierarchical chunking stores small precise chunks for accurate retrieval alongside larger parent chunks for full context. When a small chunk matches a query, you retrieve its parent to give the model complete surrounding context. This combines the precision of small chunks with the contextual completeness of large ones — the best balance for complex documents like legal or technical files.
How do I add long-term memory to an agent across sessions?
For tasks spanning sessions, add Episodic Memory (long-term event history) stored in an external vector database. For persistent user preferences or domain facts, add Semantic Memory. Working Memory (the context window) is always active but resets each session. Embed and store important events or facts, then retrieve relevant ones via similarity search when the agent needs them.
How do I make my agent's failures diagnosable?
Log every ReAct thought-action-observation triple so you can trace exactly what the agent reasoned, which tool it called, and what it observed at each step. Instrument observability before deploying and track success rate, step efficiency, latency, and cost per task. Without this logging, failed agent runs are impossible to diagnose after the fact.
// Troubleshooting
Why is my agent retrieving irrelevant chunks from my vector database?
The most common cause is using different embedding models for indexing and querying — the vectors become completely incompatible and results are garbage. Always use the same embedding model for both. If models match, check your chunking strategy (try hierarchical chunking), verify you're using cosine similarity for text, and consider Agentic RAG so the agent can retry retrieval when results are insufficient.
My agent keeps making impulsive wrong tool calls — how do I fix it?
Enforce the ReAct pattern so the agent must write out its thought process before every action. This prevents impulsive tool calls and surfaces flawed reasoning. Also audit your tool descriptions — vague descriptions cause wrong tool selection every time. Make each description precise about what the tool does and when to use it.
My multi-agent system is too complex and unreliable — what went wrong?
You likely built a multi-agent system before validating a single-agent baseline. Always get one agent working end-to-end with one task and a few tools first, then add complexity on a working foundation. If you genuinely need multiple agents, start with a Hierarchical Manager-Worker topology and add observability so you can diagnose which subagent fails.
My agent ran up thousands of API calls unexpectedly — how do I prevent this?
You skipped a maximum step limit — a single bug can cause an infinite loop resulting in thousands of calls and catastrophic cost. Set a hard max-step limit on every agent, add rate limiting to cap runaway calls, and apply the 60-30-10 cost rule plus the Iceberg Technique to reduce per-task cost. Monitor cost per task from day one.
// Comparisons
How does RAG compare to fine-tuning a model?
RAG retrieves knowledge at the moment it's needed by injecting relevant chunks into the prompt, so you can update knowledge instantly by changing documents. Fine-tuning bakes knowledge into model weights, which is expensive, slow to update, and prone to hallucination about specifics. For private or frequently changing knowledge, RAG is almost always the better choice — no retraining required.
How does the Hierarchical Manager-Worker topology compare to a Sequential Pipeline?
A Sequential Pipeline processes tasks like an assembly line, each stage passing output to the next — good for predictable linear workflows. The Hierarchical Manager-Worker topology has an orchestrator that breaks a goal into subtasks and delegates to specialists, enabling parallelism and dynamic routing. The Manager-Worker pattern is the most common in production because it handles complex, variable goals more flexibly.
How does building agents from scratch compare to using a framework?
Building from scratch means reimplementing loops, memory, tool calling, and coordination that frameworks already provide. Use LangChain + LangGraph for complex stateful workflows, LlamaIndex for RAG-heavy systems, AutoGen for autonomous multi-agent coding, and CrewAI for beginner-friendly role-based setups. Choose a framework and extend it rather than building all infrastructure yourself — you'll ship faster and inherit battle-tested patterns.
How does Agentic RAG differ from standard RAG?
Standard RAG follows a fixed pipeline: embed query, retrieve top-k, generate answer. Agentic RAG treats retrieval as a tool the agent can call multiple times — if the first retrieval is insufficient, the agent decides to retrieve again with a refined query. This makes it far better for complex, multi-part questions where a single retrieval pass misses key context.
// Advanced
What is the Iceberg Technique and how much does it save?
The Iceberg Technique keeps only core essential rules in the context window and gives the agent grep/read tools to surgically pull in additional knowledge as needed. Instead of loading an entire codebase or knowledge base, the agent fetches only what's relevant. This can reduce token costs by 60-80% on complex tasks while keeping the agent focused on relevant context.
What is the Debate Pattern and when should I use it?
The Debate Pattern is a multi-agent adversarial collaboration: one agent proposes a solution, a second critiques it, the first revises, and a third judge agent selects the best version. It consistently produces higher-quality outputs than any single agent. Use it for high-stakes outputs like architecture design or critical decisions where quality matters more than speed or cost.
How do I defend an agent against prompt injection?
Prompt injection is malicious text embedded in external content (websites, files, API responses) that tries to hijack agent instructions. Defend with Input Guardrails (validate what enters), Output Guardrails (validate actions before they execute), Human-in-the-Loop checkpoints before irreversible actions, sandboxing for code execution, and Minimal Footprint permissions. Treat all external data as untrusted — it's a real production threat, not theoretical.
What is the Reflection architecture and why is it effective for coding?
The Reflection architecture has the agent try a task, explicitly analyze what went wrong or was imperfect, then retry with that reflection incorporated. It's particularly effective for coding and verifiable tasks because outputs can be tested — failing tests provide concrete feedback the agent reflects on and corrects. This enables self-improvement through failure without human intervention.
When is a larger context window actually a bad idea?
A larger context window is not always better — more tokens mean higher cost, slower responses, and potential loss of focus on earlier context. Instead of dumping everything into context, use the Iceberg Technique: keep core rules in context and let the agent grep or read for additional information surgically. This keeps the agent focused, fast, and affordable.
How do I apply the 60-30-10 cost rule in practice?
Route 60% of tasks — simple classification and basic formatting — to cheap fast models. Send 30% — moderate research and synthesis — to mid-tier models. Reserve the top 10% — complex orchestration and high-stakes decisions — for your most powerful models. Implement this as model routing logic based on task type, keeping costs sane while maintaining quality where it truly matters.