Skip to content

SWARNIM-TIWARI/forge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FORGE — Business Intelligence Engine

Raw input. Structured output. No noise.

**Live demo → https://forge-swarnimtiwari-projects.vercel.app/

FORGE is not a chatbot. It is a deterministic automation pipeline: unstructured business text goes in, validated structured data comes out. Every result is rendered in a purpose built UI — tables, risk panels, decision trees, action item trackers. Not a chat bubble.

Built as part of AI & Management research into applied LLM automation for enterprise knowledge work.


What It Does

Eight workflows, each processing a different class of business document:

Workflow Input Output
📄 Document Intelligence Any business document Type, summary, entities, action items, confidence score
🧾 Invoice Processor Invoice text Structured line items, totals, validation flags
👤 Customer Router Support message Category, routing, SLA, drafted auto-response
✉️ Email Composer Bullet points or context Complete professional email, CC suggestions
📋 Meeting Notes Transcript or rough notes Decisions, action items with owners, blockers
⚖️ Contract Reviewer Contract text Risk level, red flags, missing clauses, negotiation actions
🔬 Research Intelligence Paper abstract or report Methodology, claims, limitations, real-world applications
📊 Business Case Analyzer Proposal or initiative Recommendation, financial analysis, risk matrix

All outputs follow strict JSON schemas. The model is forced to return structured data — no markdown, no explanation, no deviation.


Works Instantly — No API Key Required

FORGE ships with a Simulation Mode built in. Every workflow returns realistic, detailed pre-built responses with authentic latency. Any recruiter or reviewer can open the deployed URL and see the full product working in three seconds — no sign-up, no key, no friction.

To use real AI (free options available):

Provider Cost Setup
Simulation Free (built-in) Nothing — works now
Groq (Llama 3.3 70B) Free tier console.groq.com — 2 min, no credit card
Google Gemini Free tier aistudio.google.com — Google account
Anthropic Claude Paid console.anthropic.com

Architecture Decisions Worth Reading

1. Provider Inversion

The entire workflow layer is decoupled from the AI provider. workflowDefs.jsx defines what to do. api.js decides how to call the model. Switching from Groq to Gemini to Anthropic is one dropdown change in Settings with zero workflow code changes. This is dependency inversion applied at the API boundary.

Workflow Layer  →  callAI(provider, workflowId, input)
                          ↓
                 api.js dispatches to:
                 Simulation | Groq | Gemini | Anthropic

Each provider has a different API contract:

  • Groq: OpenAI-compatible /chat/completions with Authorization: Bearer
  • Gemini: Google's contents[] format, key in URL
  • Anthropic: messages[] format with x-api-key header

All three handled behind one function signature. Adding a fifth provider means adding one case in a switch statement.

2. React Inner-Component Anti-Pattern (Solved)

Tab components (Dashboard, WorkflowsTab, etc.) are called as {Dashboard()} — plain function calls and not rendered as <Dashboard />.

If you define a component inside App and render it as JSX, React creates a new component type on every App re-render (new function reference = new type). React unmounts the old instance and mounts a fresh one. All DOM state including focused inputs is destroyed. Every keystroke triggered this cycle, making every input unusable.

The fix is documented in code comments so it's a genuine learning artifact, not a hidden patch.

3. Role-Based Access Control (RBAC)

Four roles with enforced permission boundaries:

Role Workflows Pipeline Audit Log Analysis Users Settings
Admin All 8
Manager All 8
Analyst Doc/Inv/Contract/Research/BizCase
Viewer

The UI gates itself dynamically: tabs disappear, workflow cards lock, the nav rebuilds. Switch between users from the header dropdown available to every role including Viewer. No page reload required.

4. Pipeline Chaining

Any two workflows compose automatically. Workflow A's JSON output is serialized to structured text and fed as Workflow B's input. Suggested chains:

  • Meeting Notes → Email Composer — extracts decisions, drafts the follow-up
  • Research Intelligence → Business Case Analyzer — converts a paper into a proposal
  • Contract Reviewer → Email Composer — identifies red flags, drafts the negotiation email

5. Log Intelligence (Analysis Tab)

Natural language queries over the audit log. Ask anything — "show me all high-risk contracts", "who ran the most jobs today?", "are there any anomalies?" — the AI reads the last 60 log entries and returns a structured analysis with relevant entries, patterns, and actionable insights.


File Upload

Every workflow accepts file uploads (.txt, .md, .csv, .json, .html). Drop a contract PDF converted to text, a meeting transcript export, or a research paper abstract — the content loads directly into the input. No parsing library needed since all supported formats are plain text.


Project Structure

forge/
├── index.html              # Single HTML shell
├── vite.config.js
├── package.json            # 3 runtime deps: react, react-dom, recharts
├── .env.example
└── src/
    ├── main.jsx            # React DOM mount — 6 lines
    ├── theme.js            # All design tokens + CSS keyframes
    ├── api.js              # Multi-provider AI abstraction
    ├── workflowDefs.jsx    # 8 workflow configs + output renderers
    ├── App.jsx             # Root — all state + 7 tab views
    └── components/
        └── Atoms.jsx       # Badge, Dot, RunBtn, ToggleSwitch, etc.

Adding a new workflow: one object in WORKFLOWS array in workflowDefs.jsx. Dashboard metrics, pipeline selectors, settings toggles, RBAC lists, and log prefixes all update automatically.


Quick Start

# Clone
git clone https://github.com/YOUR_USERNAME/forge.git
cd forge

# Install (3 runtime dependencies)
npm install

# Run — works immediately in Simulation Mode
npm run dev
# → http://localhost:5173

Add a real AI provider (optional):

cp .env.example .env
# Add VITE_GROQ_API_KEY — free at console.groq.com

Or skip .env — open the app, go to Settings → API Provider, paste your key, click Save.


Deployment

Vercel (recommended — free)

npm i -g vercel
vercel

Add VITE_GROQ_API_KEY in Vercel dashboard → Project Settings → Environment Variables.

Netlify

Connect GitHub repo. Build command: npm run build. Publish directory: dist.


Tech Stack

Technology Why
Framework React 18 + Vite Fast dev server, clean component model
Charts Recharts Composable, React-native data viz
AI Groq / Gemini / Anthropic / Simulation Provider-agnostic by design
Styling Inline CSS-in-JS + design tokens Zero class collisions, portable
Fonts Barlow Condensed + JetBrains Mono Loaded via Google Fonts

3 runtime dependencies total. No CSS framework. No state management library. No component library.


Domains This Touches

Applied AI · LLM Structured Output Enforcement · Multi-Provider API Design · Role-Based Access Control · Business Process Automation · Frontend Architecture · Design Systems · Enterprise Software Patterns · Prompt Engineering · Synthetic Data for Demo Environments


License

MIT — use it, fork it, extend it.

About

Deterministic pipeline for business documents. 8 workflows → structured data. Simulation Mode, provider agnostic AI. React+Vite+Python.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors