How breadboard-ai/breadboard works
Project type & purpose
• A large TypeScript monorepo for prototyping generative‐AI “boards.”
• Contains core libraries (breadboard runtime, kits, connectors), CLI tools, multiple board‐server implementations, web UIs (Visual Editor, Docs site), plus example boards.
High‐level structure (based on file tree & README)
Top‐level:
• “core” & “packages/*” folders: independent npm packages (breadboard runtime, agent‐kit, gemini‐kit, google‐drive‐kit, etc.)
• “boards/” tooling for working with OpenAPI board definitions
• “breadboard/” – the core runtime engine and editor harness
• “visual-editor/”, “unified-server/”, “board-server/”: full‐stack apps for editing & running boards in the browser
• “website/”: documentation site (Eleventy)
• CLI tools: “build/”, “build-code/”
Main architectural components
a. Core Runtime Layer (“breadboard” package + supporting libraries)
– Board definition loader, execution engine, data stores, transports, driver abstractions (OpenAI, Gemini)
– Plugin architecture for connectors (Google Drive, Gmail, etc.)
b. Kit Libraries (e.g. agent-kit, gemini-kit, google-drive-kit)
– Pre‐built board modules & connectors, published separately
c. CLI & Build Tools
– “build/”, “build-code/”: compile TS, generate schemas, emit package artifacts
d. Board Servers (multiple implementations)
– board-server: production server (Node + Express) with API, Firestore or GCS storage
– filesystem-board-server / idb-board-server / embedded-board-server / remote-board-server: alternate persistence & hosting
e. Web UIs
– Visual Editor (React/Vite) served by unified-server or static host
– unified-server: serves editor assets + proxy to board-server APIs
– website: static docs site
f. External Services
– LLM Providers (OpenAI, Gemini)
– Cloud storage (Firestore, GCS, IndexedDB)
– OAuth flows (Google Drive)
Interactions & data flows
1. User opens Visual Editor (front-end).
2. Editor fetches board definitions, connectors, and UI components via unified-server.
3. When running a board: front-end issues “Run Board” HTTP request → unified-server → proxies to board-server or embedded/idb‐server.
4. Server loads board definition, instantiates breadboard runtime, resolves connectors & drivers.
5. Runtime invokes LLM driver (OpenAI/Gemini) or storage connector (Google Drive).
6. Runtime writes/reads from data-store (Firestore, GCS, IndexedDB).
7. Server streams events/responses back to front-end over HTTP/websocket.
Architectural patterns & principles
• Monorepo with workspaces: encourages code sharing, local package linking.
• Plugin/driver pattern: supports multiple LLM backends & connectors.
• Micro‐service style: separate board‐servers for different persistence needs.
• Clear separation of concerns:
– Runtime engine (pure TS library)
– Kit libraries (modular building blocks)
– UI layer (React, HTML/CSS)
– API layer (Express/GCP functions)
Elements
– Clear component names (e.g. “breadboard Runtime”, “agent‐kit”, “board‐server”)