RIBIF is an end-to-end industrial project intelligence platform that turns a machine/material technical datasheet into a complete virtual factory package:
- structured technical extraction,
- 2D/3D plant layout,
- HD visualization video,
- global supplier sourcing,
- AI-assisted supplier negotiation (text + voice),
- TCO modeling,
- 5-year business plan + pitch deck,
- digital twin dashboard with operational KPIs,
- and a final technical catalog.
The system is implemented as one integrated web application with a Next.js frontend and Flask backend orchestrating the multi-module pipeline.
RIBIF is designed to support industrial companies from pre-engineering to investment decision by chaining 9 mandatory modules into one coherent workflow.
Input:
- Technical files (
PDF,DOCX, and structured payloads)
Output:
- A virtualized factory solution with technical, procurement, financial, and operational decision support artifacts.
Business purpose:
- Ingest unstructured technical documentation.
- Extract key machine/material specs, constraints, capacities, utility requirements, safety factors.
- Build normalized stage-based JSON for downstream modules.
Backend implementation:
- Endpoint:
POST /api/module1/process - Status/result polling:
GET /api/module1/status,GET /api/module1/result - Route:
backend/routes/module1.py - Core logic:
backend/utils/module_1/
Primary output:
- Structured extraction payload (stages 1..6) including
stage_4_machines_equipements.
Business purpose:
- Convert module 1 data into plant/workshop layout.
- Generate 2D and 3D artifacts representing zones, flows, and placement.
Backend implementation:
- Endpoint:
POST /api/module2/layout - Route:
backend/routes/module2.py - Pipeline engine:
backend/utils/module_2/
Primary output:
- 2D layout artifact (DXF/PNG variants depending on flow)
- 3D model artifact (
GLB/IFC-like workflow representation)
Notes:
- Layout route normalizes machine dimensions and can run with template fallback when skip flags are enabled.
Business purpose:
- Transform 3D/layout visual context into investor-ready short video (site walkthrough style).
Backend implementation:
- Endpoint:
POST /api/module3/video - Route:
backend/routes/module3.py - Uses generated layout images or uploaded images + prompt-driven video generation.
Primary output:
- HD video file (
.mp4) and downloadable URL.
Business purpose:
- Identify supplier candidates globally.
- Aggregate price/lead-time/contact/evidence.
- Rank suppliers per machine family.
Backend implementation:
- Endpoint:
POST /api/module4/enrich - Route:
backend/routes/module4.py - Core agentic/bounded sourcing logic:
backend/utils/module_4/ - Search providers and aggregation:
backend/utils/web_search/
Primary output:
machines_enriched[]list with supplier options and relevance scoring.
Business purpose:
- Support negotiation with suppliers through email-style text rounds and voice-interaction workflows.
- Produce negotiation history and best-offer summary.
Backend implementation:
- Core endpoints (subset):
POST /api/module5/text/negotiationPOST /api/module5/voice/negotiationPOST /api/module5/voice/summaryPOST /api/module5/negotiations/startPOST /api/module5/v2/negotiations/create
- Route:
backend/routes/module_5.py - Negotiation logic:
backend/utils/module_5/ - Email integration route:
backend/routes/email_service.py
Frontend voice UI:
frontend/src/app/voice-call/page.tsx- Requires VAPI public key.
Primary output:
- Negotiation rounds, acceptance/rejection states, call transcript data, negotiated pricing traces.
Business purpose:
- Compute realistic industrial ownership cost over a horizon.
- Include purchase, installation, operations, maintenance, materials, and yearly projections.
Backend implementation:
- Endpoints:
POST /api/module6/tco-from-sourcingPOST /api/module6/tco
- Route:
backend/routes/module6.py - Core model:
backend/utils/module_6/core.py
Primary output:
- Machine/product/raw-material TCO breakdowns
- Annual multi-year TCO projection.
Business purpose:
- Convert technical + TCO data into a 5-year financial model and investor narrative.
- Generate business-plan deliverables and pitch support.
Backend implementation:
- Endpoints:
POST /api/module7/business-planPOST /api/module7/pitch-deck
- Route:
backend/routes/module7.py - Generators:
backend/utils/module_7/business_plan.pybackend/utils/module_7/pitch_deck.py
Primary output:
- Business plan file(s) and downloadable URLs
- Pitch deck output (including PDF export path when available).
Business purpose:
- Represent the factory as a live operational twin.
- Provide KPI dashboarding (OEE/TRS, throughput, availability, quality) with optimization-oriented visibility.
Current implementation in this repository:
- Primary UI route:
frontend/src/app/twin/page.tsx - Workflow twin view component:
frontend/src/sections/DigitalTwinView.tsx - 3D scene and KPI widgets are available from frontend modules.
Business purpose:
- Produce reusable technical documentation of machine families, product families, process chains, and logistics context.
- Deliver both document and web-consumable catalog outputs.
Backend implementation:
- Endpoint:
POST /api/module9/catalog - Route:
backend/routes/module9.py - Core generator:
backend/utils/module_9/core.py
Primary output:
- Catalog payload + PDF artifact upload/URL.
The primary workflow engine is in frontend/src/app/workflow/[id]/page.tsx.
Actual execution order in the implemented pipeline:
- Module 1 (spec extraction)
- Module 4 (supplier sourcing)
- Module 6 (TCO)
- Module 7 (business plan + pitch deck)
- Module 9 (technical catalog)
- Module 2 (layout 2D/3D)
- Module 3 (video)
- Digital Twin view (Module 8) is available in UI, not as a blocking backend step.
Why this order:
- Financial and catalog decisions can proceed once sourcing and TCO are available.
- Layout/video are generated after core business/procurement intelligence has stabilized.
ribif/
|- backend/
| |- app.py # Flask entrypoint and blueprint registration
| |- config.py # Paths, flags, env configuration
| |- requirements.txt
| |- routes/
| | |- module1.py
| | |- module2.py
| | |- module3.py
| | |- module4.py
| | |- module_5.py
| | |- module6.py
| | |- module7.py
| | |- module9.py
| | |- health.py
| | |- validation.py
| | |- email_service.py
| |- utils/
| | |- module_1/
| | |- module_2/
| | |- module_4/
| | |- module_5/
| | |- module_6/
| | |- module_7/
| | |- module_9/
| | |- web_search/
| |- template/ # Template payloads for SKIP mode
|- frontend/
| |- src/app/ # Next.js App Router pages
| |- src/sections/ # Workflow module views
| |- src/lib/ # API and Supabase helpers
| |- supabase/ # SQL schema/migrations
Backend:
- Python + Flask
- LLM/tooling: OpenAI SDK, Google GenAI, LangChain/LangGraph
- Data processing: Pandas, NumPy, Pydantic
- Document extraction: PyMuPDF, python-docx
- CAD/render support: ezdxf, matplotlib, moviepy
- Persistence and file storage: Supabase
Frontend:
- Next.js (App Router) + React + TypeScript
- Tailwind CSS
- Three.js + React Three Fiber/Drei
- Recharts for KPI/dashboard charts
- Supabase JS client
- Python 3.10+
- Node.js 20+
pnpm(recommended, lockfile included)- Supabase project (recommended for full persistence)
cd backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python app.pyBackend default URL:
http://localhost:5000
cd frontend
pnpm install
pnpm devFrontend default URL:
http://localhost:3000
Core:
GOOGLE_API_KEY(Gemini/Vertex-dependent steps)GEMINI_MODEL(optional override)IMAGE_MODEL(optional)VIDEO_MODEL(optional)
Supabase:
SUPABASE_URLSUPABASE_SERVICE_ROLE_KEYSUPABASE_BUCKET_FILES(optional, defaultproject-files)SUPABASE_BUCKET_PUBLIC(optional)
Search and sourcing:
SERPER_API_KEYBING_API_KEYWEB_SEARCH_ENABLEDPREFER_WEB_DATA
CORS and backend:
BACKEND_BASE_URLCORS_ORIGINS
Optional module toggles:
SKIP_MODULE_1...SKIP_MODULE_9CREATE_MACHINE_IMAGESCREATE_REALISTIC_RENDERCREATE_3D_MODEL
Module 5 negotiation/email:
NEGOTIATION_SMTP_HOST,NEGOTIATION_SMTP_PORT,NEGOTIATION_SMTP_USERNAME,NEGOTIATION_SMTP_PASSWORDNEGOTIATION_IMAP_HOST,NEGOTIATION_IMAP_PORTTEST_RECIPIENT_EMAIL
NEXT_PUBLIC_BACKEND_URLNEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYNEXT_PUBLIC_SUPABASE_SERVICE_ROLE_KEY(present in code; use with caution)NEXT_PUBLIC_VAPI_PUBLIC_KEY(voice call frontend)
Module endpoints:
POST /api/module1/processGET /api/module1/statusGET /api/module1/resultPOST /api/module2/layoutPOST /api/module3/videoPOST /api/module4/enrichPOST /api/module5/text/negotiationPOST /api/module5/voice/negotiationPOST /api/module5/voice/summaryPOST /api/module6/tco-from-sourcingPOST /api/module7/business-planPOST /api/module7/pitch-deckPOST /api/module9/catalog
Supporting endpoints:
GET /healthGET /health/readyGET /health/liveGET /health/metricsPOST /api/validate-pdfPOST /api/extract-textPOST /api/email/sendPOST /api/email/poll
The active schema migration (frontend/supabase/migrations/20260130_simplified.sql) uses a unified projects table as the central workflow state.
Key project columns:
module1_datamodule4_datamodule5_data(added in20260201_negotiations.sql)module6_datamodule7_businessmodule7_pitchmodule9_datamodule2_datamodule3_datacompleted_modules(text array)settings,metadata
Negotiation tracking is stored in:
negotiationstable (frontend/supabase/migrations/20260201_negotiations.sql)
Typical generated outputs include:
- Module 1 extraction JSON
- Supplier shortlist/comparison JSON (Module 4)
- TCO report JSON (Module 6)
- Business plan + pitch assets (Module 7)
- Technical catalog PDF (Module 9)
- 2D layout and 3D model artifacts (Module 2)
- HD video
.mp4(Module 3) - Digital twin dashboards/KPI views (Module 8 UI)
Sample deliverables are available under frontend/public/deliverables/.
Frontend checks:
cd frontend
pnpm lint
pnpm testBackend scripts/tests (examples in repo):
cd backend
python test_imports.py
python test_module4_budget_enforcement.py
python test_module1_refactor.py