AI Agent 007: Inter-IIT Techfest

Published:

LangChain GPT-4 Python

🏆 Achievement

Secured Rank 3 in the Tooling up for Success challenge at Inter-IIT Techfest 2023. Competing in the DevRev AI Agent Track against top Indian technical institutes, our solution excelled in autonomous tool management and complex query resolution.

🤖 The Challenge

The objective was to build a “query-aware” agent capable of intelligently allocating tasks to specific tools and reviewing their outputs without human intervention. The core difficulty lay in handling multi-step dependencies and preventing the agent from repeating past logic errors.

🧠 Architecture: Advanced Reasoning & Memory

We moved beyond simple linear chains to create a robust, self-correcting system:

1. Graph-Based Query Decomposition

Instead of processing tokens linearly, the agent parses complex user queries into a Directed Acyclic Graph (DAG).

  • Topological Execution: Tasks are executed in a dependency-aware order.
  • Context Linking: The output of a parent query is automatically passed as context to the child query, ensuring seamless data flow across multi-step reasoning.

2. Robust ReAct with Critique & Fallback

I implemented a modified ReAct (Reason + Act) loop designed for resilience:

  • Critique Module: After every tool execution, the agent critiques the output quality.
  • Fallback Mechanism: If a tool returns unsatisfactory results, the agent triggers specific fallback routines rather than hallucinating an answer.

3. Self-Reflection via RAG (Long-Term Memory)

To prevent the agent from making the same mistake twice, we engineered a “Self-Reflective Pipeline”:

  • Experience Retrieval: The system uses RAG (Retrieval-Augmented Generation) to access a long-term memory store of past execution logs.
  • Error Avoidance: Before taking action, the agent searches for similar past failure scenarios and adjusts its prompt strategy dynamically to avoid repeating those specific mistakes.

📸 Visual Library

Agent decision flowcharts, DAG visualization, and terminal logs of “Thought-Act-Observation” loops.