Skip to content

YuGu0358/hardware-foundry

Repository files navigation

Hardware Foundry

LLM multi-agent platform that turns a natural-language hardware idea into manufacturable artifacts — BOM, KiCad PCB, ESP32 firmware, 3D-print STL, wiring diagram, assembly docs — all from a single prompt.


What you get

From one prompt such as "smart desk lamp with BLE dimming":

  • Clarified product spec and reference designs
  • Compliance and feasibility report
  • Full BOM with LCSC part numbers and thumbnails
  • KiCad-ready PCB (Gerber, placement, ERC/DRC)
  • Auto-routed wiring diagram (ReactFlow)
  • 3D-print STL with DfAM severity gate
  • CAD 4-view PNG renders
  • ESP32 firmware skeleton
  • Assembly instructions PDF
  • Mechanical drawing with geometric validation

Live demo


Architecture

Browser (Next.js 15)
    |
    v
FastAPI (Fly.io)  <-->  Supabase (Postgres + Storage)
    |
    v
LangGraph pipeline
    |
    +-- Clarifier --> Planner --> Compliance --> Feasibility
    |
    +-- Component Selection (LCSC adapter, 3-specialist team)
    |
    +-- Wiring --> PCB (5-phase: place/route/ERC/DRC/Gerber)
    |
    +-- Simulation --> Firmware --> Assembly
    |
    +-- CAD (Modal worker) --> Mech Drawing --> Concept Image (fal.ai)

CI: GitHub Actions auto-deploys API to Fly on every push to main. Vercel auto-deploys the web app.


The 15 agents

Package Role
_base ProductState, BaseAgent shared by all agents
clarifier Extracts structured spec from freeform prompt
reference_search Finds reference designs and datasheets
planner Breaks spec into work packages
compliance CE / FCC / RoHS gate
feasibility Budget and manufacturability gate
component_selection BOM via LCSC adapter + 3-specialist + critic protocol
concept_image AI concept render via fal.ai
hardware_thumbnail Part thumbnail fetcher
wiring ReactFlow wiring diagram
pcb 5-phase KiCad pipeline (placement, routing, ERC, DRC, Gerber)
simulation SPICE simulation stubs
firmware ESP32 firmware skeleton
assembly Assembly instruction docs
mech_drawing Mechanical drawing with geometric validation
cad CAD 4-view PNG via Modal CAD worker

Quick start (dev)

git clone https://github.com/YuGu0358/hardware-foundry
cd hardware-foundry
uv sync                        # Python workspace
cd apps/web && npm install     # frontend
cp .env.example .env           # then fill in required keys
uv run uvicorn foundry_api.main:app --reload --port 8000
# in a second terminal:
cd apps/web && npm run dev     # http://localhost:3000

See docs/GETTING_STARTED.md for the full walkthrough including Supabase setup, env var reference, and test instructions.


Deploy

See docs/DEPLOY.md for the Fly.io + Vercel + GitHub Actions runbook.


Repository layout

hardware-foundry/
  agents/          15 Python agent packages (one per domain)
  apps/
    api/           FastAPI + LangGraph pipeline (deployed to Fly.io)
    web/           Next.js 15 frontend (deployed to Vercel)
  tools/           freerouting_worker, mcp_cadquery
  migrations/      Alembic DB migrations
  docs/            DEPLOY.md, GETTING_STARTED.md, audit + plan docs
  infra/           Legacy Docker Compose stack (local dev reference)

Status (audited 2026-05-28)

  • API: healthy (hardware-foundry-api.fly.dev, commit 574d642)
  • Web: healthy (hardware-foundry-4ke2.vercel.app)
  • Projects in DB: 41 total, 34 active last 7 days
  • Test suite: 255 passed, 2 skipped (3 collection errors in firmware/pcb/simulation agents when run from monorepo root — run per-package as a workaround; see GETTING_STARTED)
  • Commits (last 7 days): 132
  • Known open issues:
    • fal.ai concept image generation may be dark if account balance exhausted
    • components table empty — no local parts cache; BOM depends on live LCSC API

License

Apache 2.0 — see LICENSE.

Contributing: open an issue or PR. No CLA required.

About

LLM multi-agent platform that turns natural-language hardware ideas into manufacturable artifacts: BOM, 3D-print files, KiCad PCB, ESP32 firmware, mobile app, assembly docs.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors