# ForgeAI

> Takes a brief + documents folder → auto-builds a grounded Q&A AI agent, tests it, optimizes it, and gives an honest scorecard. 8-stage pipeline, never bluffs.

ForgeAI is a paid AI agent skill on Agensi by Akhil, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $15 (one-time purchase)
- Creator: [Akhil](https://www.agensi.io/creators/akhil-babu-gujjaralapudi)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-11-29
- Security: scan passed (2026-11-29); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/forgeai
- Tags: ai-agents, llm-ops, prompt-engineering, rag, document-qa, evaluation, automation, nlp

## About this skill

ForgeAI — The Agent Factory That Refuses To Bluff

ForgeAI is an autonomous agent factory that builds, evaluates, optimizes, and honestly reports on grounded Q&A AI agents. You give it a one-paragraph brief describing what your agent should do and a folder of documents (PDFs, CSVs, XLSX, DOCX, PPTX, JSON, HTML, Markdown, TXT) — it does the rest.

How It Works — 8-Stage Pipeline
S0 — Loader: Ingests 10+ file formats, runs CPU OCR on scanned PDFs, auto-detects spreadsheet headers, profiles tabular features, sentence-aware chunking that snaps to natural boundaries
S1 — Interviewer: Converts your brief + document previews into structured requirements (scope, audience, tone, must-answer topics, must-refuse topics, allowed tools)
S2 — Scout: Verifies your brief is actually supported by the documents. If not, it halts early — never builds a hallucinating agent
S3 — Builder: Generates a declarative agent definition with system prompt, retrieval config, refusal policy, and tools
S4 — Exam Maker: Creates 20+ stratified test cases (answerable + must-refuse + edge cases), verifies every eval answer exists in source chunks, splits 70% Dev / 30% Frozen Holdout
S5/S6 — Helper & Teacher: Runs the agent with verbatim chunk citations, then grades answers using deterministic checks + a separate LLM judge
S7 — Doctor: Diagnoses failures (hallucination, wrong refusal, retrieval miss, prompt defect), applies targeted patches for up to 3 rounds on the Dev split with rollback protection, then evaluates once on the frozen Holdout
S8 — Scribe: Generates a full report with exact Dev & Holdout scores, optimization diary, and unresolved failures
Key Technical Features
Hybrid Retrieval: BM25 + dense embeddings (fastembed/BAAI bge-small-en) + TF-IDF cosine + Reciprocal Rank Fusion, with compound query decomposition
PDF OCR: pypdfium2 rendering + rapidocr-onnxruntime for scanned/image-heavy pages
Smart Chunking: Sentence/paragraph/word boundary snapping with section heading propagation
Tabular Intelligence: DuckDB out-of-core profiling for large CSVs, openpyxl multi-sheet XLSX with header auto-detection and feature summaries
Gateway Resilience: Gemini fallback chain (2.5-flash → 3.5-flash → 2.5-flash-lite), exponential backoff on rate limits/server errors, prompt trimming to prevent context overflow
Anti-Hallucination: Fact-in-chunk eval gate, groundability guard, one-shot JSON repair, anti-false-refusal prompt engineering
Dual Backend: Google Gemini API or local Ollama (qwen3/gemma3)
Honest Reporting: Frozen holdout split prevents overfitting, scorecard never inflates — reports failures transparently
Proven Results

- **Dataset**: Dev Score, Holdout Score
- **NASA ISS**: 100%, 100%
- **World Bank EdStats**: 85.7%, 50%
- **WHO Drinking Water**: 64.3%, 66.7%

Interfaces
CLI: python -m forgeai build, chat, evaluate, report
Streamlit Web App: Interactive UI with file upload, brief input, live pipeline progress, and scorecard display

## Requires

- Python 3.10+
- Gemini API key or local Ollama
- Optional: openpyxl
- Optional: pypdfium2 + rapidocr-onnxruntime

All dependencies install automatically via pip install -r requirements.txt. GPU is not required — OCR and embeddings run on CPU. Free-tier Gemini API key is sufficient for most use cases.

## Known limitations

Requires a compatible LLM backend (Gemini API or Ollama).
Output quality depends on the selected model and source documents.
Complex scanned PDFs may have extraction errors.
Automated evaluation scores are not a guarantee of production accuracy.
Human verification is recommended for critical decisions.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the ForgeAI skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Does it work without a GPU?

Yes. OCR uses rapidocr-onnxruntime (CPU), embeddings use fastembed with ONNX (CPU). No GPU needed.

### Can I use it with local LLMs instead of Gemini?

Yes. Set FORGEAI_PROVIDER=ollama and point OLLAMA_HOST to your Ollama instance. Recommended models: qwen3:4b for the agent, gemma3:4b for the judge.

### What file formats does it support?

PDF (including scanned with OCR), CSV, XLSX (multi-sheet), DOCX, PPTX, JSON, JSONL, HTML, Markdown, and plain text.

### What does "Frozen Holdout" mean?

ForgeAI splits generated test cases 70/30. The optimizer only sees and tunes on the 70% Dev split. The 30% Holdout is evaluated once at the end — this prevents overfitting and gives you an honest, unbiased score.

### What if my documents don't support the brief I give it?

ForgeAI's Scout stage (S2) checks groundability before building. If your brief asks about topics the documents don't cover, it halts with Exit Code 20 and tells you exactly what's missing — it never builds a hallucinating agent.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
