Skip to content

Kride024/agent-forge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Agent Forge

An AI agent orchestration demo: give it a task, and 3 agents work together to complete it — a Planner (breaks the task down), an Executor (does the work, calling real tools like a calculator or web search when it needs to), and a Reviewer (scores the result and sends it back for another try if the score is too low).

Built with React, FastAPI, and LangGraph. Swappable between three LLM providers — Groq (free), xAI's Grok, and Anthropic's Claude.


1. Run it on your own computer

You need two things installed first: Python 3.10+ and Node.js 18+. (If you don't have them, search "install Python" / "install Node.js" for your OS.)

Start the backend (the agents)

cd backend
python3 -m venv venv
source venv/bin/activate        # on Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload

Leave this running. It's now live at http://127.0.0.1:8000.

By default it runs in mock mode — fake but realistic agent responses, so you can test everything for free with zero setup.

To use a real model, copy .env.example to .env and paste in any one of these keys:

  • GROQ_API_KEY — free, get one at console.groq.com (no credit card needed)
  • XAI_API_KEY — for Grok, get one at console.x.ai
  • ANTHROPIC_API_KEY — for Claude, get one at console.anthropic.com (paid)

Set more than one and Agent Forge will pick whichever comes first in LLM_PROVIDER_PRIORITY (also in .env.example) — handy for comparing providers or falling back if one is rate-limited. Restart uvicorn after saving .env. The UI shows a small "Answered by ___" badge so you can see which provider actually responded.

Start the frontend (the webpage), in a new terminal

cd frontend
npm install
npm run dev

Open the link it shows you (usually http://localhost:5173). Type a task and click Run Agents.


2. Put it online (free)

Once it works locally, here's how to make it a real link you can put on your resume/LinkedIn.

Step A — Push this project to GitHub

If you haven't already:

git init
git add .
git commit -m "Agent Forge"

Then create a new repo on github.com and follow its instructions to push.

Step B — Deploy the backend on Render (free tier)

  1. Go to render.com → sign up → New Web Service
  2. Connect your GitHub repo, pick the backend folder as the root
  3. Set:
    • Build command: pip install -r requirements.txt
    • Start command: uvicorn main:app --host 0.0.0.0 --port $PORT
  4. (Optional) Add ANTHROPIC_API_KEY under Environment if you want real Claude responses
  5. Click Deploy. Copy the live URL it gives you (looks like https://agent-forge-xxxx.onrender.com)

Step C — Deploy the frontend on Vercel (free tier)

  1. Go to vercel.com → sign up → Add New Project
  2. Connect the same GitHub repo, pick the frontend folder as the root
  3. Add an environment variable: VITE_API_URL = the Render URL from Step B
  4. Click Deploy

That's it — you'll get a live link like https://agent-forge.vercel.app you can put directly on your resume/portfolio.


Project structure

agent-forge/
├── backend/
│   ├── main.py         # FastAPI server (the API)
│   ├── graph.py        # LangGraph workflow — the actual agent logic
│   ├── providers.py    # picks Groq / xAI (Grok) / Anthropic based on your .env
│   ├── tools.py         # calculator + web search the Executor can call
│   ├── requirements.txt
│   └── .env.example
└── frontend/
    ├── src/
    │   ├── App.jsx      # main UI
    │   └── index.css    # styling
    └── package.json

How the agent loop works (graph.py)

Planner → Executor → Reviewer
             │
             ├─ can call tools mid-turn (calculator, web_search)
             │  in a ReAct-style loop: think → call tool → observe → repeat
             │  (capped at 3 tool calls, then forced to answer)
             ↓
          confidence < 70?  ──yes──> back to Executor (retry, max 2x)
                        │
                       no
                        ↓
                       done

How the Executor decides to use a tool

The Executor's system prompt tells it what tools exist (see tools.py). If it needs one, it replies with a single line like TOOL: calculator(12 * 7); graph.py parses that, runs the real Python function, feeds the result back as an "Observation", and asks the model to continue. If the model just writes a normal answer instead, that's treated as the final result — no tool required.

Resume bullets you can use

  • Built an AI agent orchestration platform using LangGraph, FastAPI, and React, coordinating a Planner–Executor–Reviewer pipeline of cooperating agents to complete open-ended tasks
  • Implemented an automated self-correction loop where a Reviewer agent scores output confidence and triggers re-execution when quality falls below threshold, reducing low-quality outputs without human intervention
  • Designed a live-updating frontend visualizing agent pipeline execution state in real time

Ideas to extend it (good for interviews — "what would you add next?")

  • Let users edit the number/type of agents visually (drag-and-drop)
  • Add more tools (file lookup, a real search API, a code sandbox)
  • Add RAG: let the Executor pull from an uploaded document / vector store
  • Store past runs in a database and show a history page
  • Add authentication so each user has their own run history
  • Stream tokens/log lines to the frontend live instead of waiting for the whole run to finish (FastAPI + Server-Sent Events or websockets)

Releases

Packages

Contributors

Languages