╔════════════════════════════════════════════════════════════╗ ║ INTERNALS v1.0 // SYSTEM ARCHITECTURE & IMPLEMENTATION ║ ║ STATUS: OPERATIONAL BUILD: 30hrs TESTS: 45 PASSING ║ ╚════════════════════════════════════════════════════════════╝
UNDER THE HOOD
MULTI-AGENT ARCHITECTURE
Four specialized AI agents working in parallel. Real-time supplier APIs. Live market intelligence via Apify. Blockchain audit trails. Built for engineers who want to know exactly how it works.
// HIGH-LEVEL ARCHITECTURE
SYSTEM OVERVIEW
┌─────────────────────────────────────────────────────────────────────────┐
│ USERS │
│ Engineers / Procurement / Founders │
└─────────────────────────────────┬───────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ NEXT.JS 16 WEB APPLICATION │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌─────────────┐ │
│ │ BOM Upload │ │ Part Search │ │ AI Agent │ │ Dashboard │ │
│ │ (CSV/XLS) │ │ Interface │ │ Viewer │ │ & Auth │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ └─────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ API ROUTES (/api) │ │
│ │ parse-bom │ search-parts │ suggest-boms │ gatekeeper │ auth │ │
│ └───────────────────────────────────────────────────────────────────┘ │
└───────────────┬─────────────────┬─────────────────┬─────────────────────┘
│ │ │
┌────────┘ │ └────────┐
▼ ▼ ▼
┌─────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ NEON │ │ PYTHON AGENT │ │ ETHEREUM │
│ POSTGRES │ │ SERVICE │ │ (ERC-7827) │
│ │ │ │ │ │
│ • Users │ │ • FastAPI │ │ • Audit Trail │
│ • Sessions │ │ • CrewAI │ │ • Version Hist │
│ • Projects │ │ • 3 AI Agents │ │ • Immutable │
└─────────────┘ └────────┬────────┘ └─────────────────┘
│
┌────────────┼────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ DIGIKEY │ │ MOUSER │ │OCTOPART │
│ API │ │ API │ │ API │
└─────────┘ └─────────┘ └─────────┘
Full-stack architecture with Next.js frontend, Python agent service for AI orchestration, PostgreSQL for persistence, and Ethereum for immutable audit trails. All supplier APIs are queried in parallel for real-time inventory data.
// CREWAI PARALLEL EXECUTION
MULTI-AGENT ORCHESTRATION
┌─────────────────────┐
│ BOM UPLOAD │
│ (CSV + Intake) │
└──────────┬──────────┘
│
┌──────────▼──────────┐
│ INTAKE STEP │
│ Parse & Validate │
└──────────┬──────────┘
│
┌──────────▼──────────┐
│ ENRICHMENT STEP │
│ Parallel API Calls │
│ │
│ DigiKey ─┬─ Mouser │
│ │ │
│ Octopart │
└──────────┬──────────┘
│
┌──────────▼──────────┐
│ MARKET INTEL STEP │
│ (Apify Scraping) │
│ │
│ • News Sites │
│ • Manufacturer URLs │
│ • Trade Publications│
└──────────┬──────────┘
│
┌───────────────────────────────┼───────────────────────────────┐
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ ENGINEERING │ │ SOURCING │ │ FINANCE │
│ AGENT │ │ AGENT │ │ AGENT │
│ │ │ + Market Intel │ │ │
│ • RoHS/CE/FDA │ │ • Lead Times │ │ • Unit Cost │
│ • IPC Class │ │ • Stock Levels │ │ • MOQ/Pricing │
│ • Lifecycle │ │ • Supplier Risk │ │ • Budget Fit │
│ • Counterfeit │ │ • Shortage News │ │ • Volume Disc │
│ │ │ │ │ │
│ [Pydantic Out] │ │ [Pydantic Out] │ │ [Pydantic Out] │
└────────┬────────┘ └────────┬────────┘ └────────┬────────┘
│ │ │
│ asyncio.gather() │ │
└─────────────────────────────┼─────────────────────────────┘
│
┌──────────▼──────────┐
│ FINAL DECISION │
│ AGENT │
│ │
│ Synthesizes all 4 │
│ perspectives into │
│ ranked strategies │
└──────────┬──────────┘
│
┌──────────▼──────────┐
│ BLOCKCHAIN AUDIT │
│ (ERC-7827) │
└─────────────────────┘
Four specialized agents run in TRUE parallel using asyncio.gather(). Market Intel gathers real-world news via Apify before the parallel agent step. Each agent outputs structured Pydantic models - no hallucination possible. The Final Decision Agent synthesizes Engineering (compliance), Sourcing (supply chain + market intel), and Finance (budget) into ranked strategies.
┌────────────────────────────────────────┐ │ AGENT SPECIFICATIONS // DEEP DIVE │ └────────────────────────────────────────┘
[00] MARKET INTELAPIFY
┌─────────────────────┐ │ REAL-WORLD DATA │ ├─────────────────────┤ │ ✓ Shortage Alerts │ │ ✓ Price Trends │ │ ✓ Mfr News │ │ ✓ EOL Announce │ │ ✓ Supply Signals │ │ ✓ Trade News │ └─────────────────────┘
Scrapes news, manufacturer sites, and trade publications via Apify for real-world intel.
[01] ENGINEERING
┌─────────────────────┐ │ COMPLIANCE CHECK │ ├─────────────────────┤ │ ✓ RoHS 3 Status │ │ ✓ REACH SVHC │ │ ✓ IEC 60601-1 │ │ ✓ IPC Class (1-3) │ │ ✓ Lifecycle (EOL?) │ │ ✓ Counterfeit Risk │ └─────────────────────┘
Validates every part against compliance databases. Flags EOL, NRND, and counterfeit risks.
[02] SOURCING
┌─────────────────────┐ │ SUPPLY CHAIN RISK │ ├─────────────────────┤ │ ✓ Lead Time Check │ │ ✓ Stock Levels │ │ ✓ Supplier Trust │ │ ✓ Multi-Source OK? │ │ ✓ Market Intel │ │ ✓ Alt Parts Avail │ └─────────────────────┘
Evaluates supply chain risk with market intel, checks stock, suggests alternates.
[03] FINANCE
┌─────────────────────┐ │ BUDGET ANALYSIS │ ├─────────────────────┤ │ ✓ Unit Cost │ │ ✓ Extended Cost │ │ ✓ MOQ Requirements │ │ ✓ Price Breaks │ │ ✓ Budget Remaining │ │ ✓ Volume Discounts │ └─────────────────────┘
Optimizes for budget constraints, identifies price breaks, tracks total spend.
// DATA FLOW // SINGLE BOM ANALYSIS
REQUEST LIFECYCLE
USER FRONTEND BACKEND EXTERNAL
│ │ │ │
│ Upload BOM.csv │ │ │
│────────────────────────▶│ │ │
│ │ │ │
│ │ POST /api/parse-bom │ │
│ │─────────────────────────▶│ │
│ │ │ │
│ │ { items: [...] } │ │
│ │◀─────────────────────────│ │
│ │ │ │
│ Click "Analyze" │ │ │
│────────────────────────▶│ │ │
│ │ │ │
│ │ POST /projects/process │ │
│ │─────────────────────────▶│ │
│ │ │ │
│ │ │ GET /v1/search (x3) │
│ │ │───────────────────────▶│
│ │ │ │
│ │ │ { offers: [...] } │
│ │ │◀───────────────────────│
│ │ │ │
│ │ │ ┌─────────────────┐ │
│ │ │ │ AGENT PARALLEL │ │
│ │ │ │ EXECUTION (3x) │ │
│ │ │ └─────────────────┘ │
│ │ │ │
│ │ │ ┌─────────────────┐ │
│ │ │ │ FINAL DECISION │ │
│ │ │ │ AGENT │ │
│ │ │ └─────────────────┘ │
│ │ │ │
│ │ { strategies: [...] } │ │
│ │◀─────────────────────────│ │
│ │ │ │
│ Display Results │ │ │
│◀────────────────────────│ │ │
│ │ │ │
A single BOM analysis triggers parallel API calls to all configured suppliers, then runs three AI agents concurrently. The Final Decision Agent synthesizes results into ranked strategies. Typical latency: 30-90 seconds depending on BOM size.
// ERC-7827 // IMMUTABLE JSON STATE
BLOCKCHAIN AUDIT TRAIL
┌─────────────────────────────────────────────────────────────────────────┐
│ ETHEREUM BLOCKCHAIN │
│ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ ERC-7827 CONTRACT │ │
│ │ │ │
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │
│ │ │ VERSION 1 │───▶│ VERSION 2 │───▶│ VERSION 3 │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ { │ │ { │ │ { │ │ │
│ │ │ project: │ │ project: │ │ project: │ │ │
│ │ │ "NL-001", │ │ "NL-001", │ │ "NL-001", │ │ │
│ │ │ items: 20, │ │ items: 20, │ │ items: 20, │ │ │
│ │ │ status: │ │ status: │ │ status: │ │ │
│ │ │ "created" │ │ "reviewed" │ │ "approved" │ │ │
│ │ │ } │ │ } │ │ } │ │ │
│ │ └──────────────┘ └──────────────┘ └──────────────┘ │ │
│ │ │ │
│ │ • Full JSON state stored on-chain │ │
│ │ • Every version is immutable │ │
│ │ • Authorized signer required for writes │ │
│ │ • Complete history for FDA/ISO audits │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘
WHY BLOCKCHAIN?
├── Medical devices need FDA-auditable trails
├── Aerospace needs AS9100 compliance records
├── Can't modify or delete historical decisions
└── Timestamp proof of when decisions were made
Every sourcing decision is recorded to Ethereum using ERC-7827 (JSON contracts with Value Version Control). Each state change creates a new immutable version. Perfect for regulated industries that need audit trails for FDA, ISO 13485, or AS9100 compliance.
┌────────────────────────────────────────┐ │ TECH STACK // THE FULL PICTURE │ └────────────────────────────────────────┘
Next.js 16
Frontend
React 18
UI Library
Tailwind
Styling
TypeScript
Language
FastAPI
Backend
Python 3.12
Runtime
CrewAI
Agents
OpenAI GPT
LLM
Apify
Web Scraping
Pydantic
Validation
Neon
Database
Ethereum
Blockchain
╔═══════════════════════════════════════════════════════════════╗ ║ BUILD STATS // HACKATHON EDITION ║ ╚═══════════════════════════════════════════════════════════════╝
┌────────────────────────────────────────┐ │ CODE SAMPLES // SEE HOW IT WORKS │ └────────────────────────────────────────┘
agents/engineering.pyCrewAI Agent Definition
class EngineeringAgent:
"""Validates technical specs and compliance requirements."""
def create_agent(self) -> Agent:
return Agent(
role="Senior Electronics Engineer",
goal="Validate parts meet technical and compliance requirements",
backstory="""You are a senior electronics engineer with 15 years
of experience in medical device design. You are meticulous about
compliance (RoHS, IEC 60601, FDA) and lifecycle status.""",
llm=self.llm,
verbose=True,
)
async def evaluate_batch(
self,
items: list[BOMLineItem],
intake: ProjectIntake
) -> list[EngineeringPartDecision]:
"""Evaluate all items in parallel with structured output."""
task = Task(
description=self._build_prompt(items, intake),
expected_output="Structured compliance decisions",
output_pydantic=EngineeringPartDecision, # <- Type-safe output
agent=self.agent,
)
crew = Crew(agents=[self.agent], tasks=[task])
result = await crew.kickoff_async()
return result.pydantic # Guaranteed valid Pydantic modelflows/bom_flow.pyParallel Agent Execution
async def parallel_agent_review(self, state: BOMFlowState) -> BOMFlowState:
"""Run all three agents in TRUE parallel using asyncio.gather()."""
# Launch all agents simultaneously
engineering_task = self.engineering_agent.evaluate_batch(
state.items, state.intake
)
sourcing_task = self.sourcing_agent.evaluate_batch(
state.items, state.intake
)
finance_task = self.finance_agent.evaluate_batch(
state.items, state.intake
)
# Wait for all to complete (parallel, not sequential!)
engineering, sourcing, finance = await asyncio.gather(
engineering_task,
sourcing_task,
finance_task,
)
# Synthesize with Final Decision Agent
final_decisions = await self.final_decision_agent.synthesize(
engineering=engineering,
sourcing=sourcing,
finance=finance,
)
state.decisions = final_decisions
return state┌────────────────────────────────────────────────────────────┐ │ TOOLS & SPONSORS // HOW WE SHIPPED THIS IN 30 HOURS │ └────────────────────────────────────────────────────────────┘
CLINE
┌─────────────────────────────────────┐ │ AI-POWERED CODE GENERATION │ ├─────────────────────────────────────┤ │ │ │ 17,149 LINES OF CODE │ │ ════════════════════ │ │ │ │ 4 Deployments: │ │ ├── Next.js Frontend │ │ ├── Python Agent Service │ │ ├── Neon Postgres │ │ └── Ethereum Contracts │ │ │ │ Built in: 30 HOURS │ │ │ └─────────────────────────────────────┘
Cline helped us write production-quality TypeScript, Python, and Solidity across 4 separate deployments. Full-stack in a weekend.
OPENAI + CREWAI
┌─────────────────────────────────────┐ │ AGENT FRAMEWORK COMPARISON │ ├─────────────────────────────────────┤ │ │ │ We tried CrewAI's native LLM... │ │ │ │ CrewAI Default: ~45s/agent │ │ GPT-5.2: ~12s/agent ⚡ │ │ ──────────────────────────── │ │ Speed Gain: 3.75x FASTER │ │ │ │ CrewAI for orchestration │ │ + OpenAI GPT-5.2 for inference │ │ = Best of both worlds │ │ │ └─────────────────────────────────────┘
CrewAI provides excellent agent orchestration, but swapping to OpenAI GPT-5.2 for inference gave us 3.75x speed improvement.
RILO
┌─────────────────────────────────────┐ │ LEAD ACQUISITION AUTOMATION │ ├─────────────────────────────────────┤ │ │ │ getrilo.ai │ │ ──────────────────────────── │ │ │ │ ✓ Email signup workflows │ │ ✓ LinkedIn outreach automation │ │ ✓ Lead enrichment pipeline │ │ ✓ Plain English → Workflows │ │ │ │ "Get me signups from hardware │ │ engineers interested in BOM │ │ optimization" │ │ │ │ → Automated in minutes │ │ │ └─────────────────────────────────────┘
We used Rilo to generate LinkedIn and Reddit content for PrecisionBOM.
AI NATIVE STUDIO
┌─────────────────────────────────────┐ │ NEXT-GEN DEV ENVIRONMENT │ ├─────────────────────────────────────┤ │ │ │ ainative.studio │ │ ──────────────────────────── │ │ │ │ Used for: │ │ ├── Code quality analysis │ │ ├── AI-assisted debugging │ │ └── Architecture exploration │ │ │ └─────────────────────────────────────┘
AI Native Studio helped with rapid prototyping and code quality checks during our speed-focused hackathon development.
APIFY[HACKATHON SPONSOR]
┌─────────────────────────────────────────────────────────────────────────┐ │ LIVE: MARKET INTELLIGENCE AGENT │ ├─────────────────────────────────────────────────────────────────────────┤ │ │ │ apify.com - Web Scraping at Scale │ │ ───────────────────────────────── │ │ │ │ ┌─────────────────┐ ┌─────────────────────────────────────────┐ │ │ │ APIFY ACTORS │────▶│ MARKET INTELLIGENCE AGENT │ │ │ │ │ │ │ │ │ │ • Web Scraper │ │ Gathers real-world supply chain data: │ │ │ │ • News Scraper │ │ ├── Component shortage alerts │ │ │ │ • Site Crawler │ │ ├── Manufacturer news & updates │ │ │ │ │ │ ├── Price trend analysis │ │ │ └─────────────────┘ │ ├── EOL/lifecycle announcements │ │ │ │ └── Supply chain risk signals │ │ │ └─────────────────────────────────────────┘ │ │ │ │ INTEGRATION FLOW: │ │ ├── BOM Upload → Extract MPNs & Manufacturers │ │ ├── Apify scrapes news sites, manufacturer pages, trade publications │ │ ├── MarketIntelAgent analyzes scraped content with LLM │ │ ├── Generates risk alerts, shortage warnings, price trends │ │ └── Factors real-world intel into SourcingAgent recommendations │ │ │ │ 13,000+ pre-built scrapers │ Real-time data │ Proxy rotation │ │ │ └─────────────────────────────────────────────────────────────────────────┘
Apify powers our Market Intelligence Agent, scraping electronics news, manufacturer announcements, and supply chain publications to surface real-world risks and opportunities that APIs don't capture.
╔═══════════════════════════════════════════════════════════════╗ ║ THE FLEX SUMMARY // WHAT WE SHIPPED ║ ╚═══════════════════════════════════════════════════════════════╝
╔══
══╗
╚══
══╝
╔═══════════════════════════════════════════════════════════╗ ║ ║ ║ WANT TO SEE IT IN ACTION? ║ ║ ║ ║ Upload a BOM and watch the agents work. ║ ║ ║ ╚═══════════════════════════════════════════════════════════╝
Built for the ESI x Korea Investments AI Agent Hackathon 2026 Team: Ojas Patkar • Jacob Valdez • Mark Lubin • Kyle Smith