Skip to the content
2 layers57 × 33.9 mmAfter3, the printed circuit board in 3D

KiCad PCB diff engine with an interactive board viewer and RAG-powered chat over git history. Covers components, nets, ERC, power tree, differential pairs, grounding, impedance, and BOM.

Size
57 × 33.9 mm
Copper layers
2
Thickness
1.6 mm
Parts
17
Nets
30
Pads
93
Tracks, vias
305, 11
Pours
1
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
21 Apr 2026
Updated
22 Apr 2026

Overview

After3 is an open-source printed circuit board by RecurringNoob, from the RecurringNoob/FluxLink repository on GitHub. It is a 2-layer board of 57 × 33.9 mm with 17 parts on 30 nets, routed with 305 tracks and 11 vias.

It is built around the ATMEGA328P-PU and 24LC1025-I/P. Its parts include 4 ICs, 4 connectors, 3 capacitors, 2 resistors and 2 crystals. It belongs with the AVR (ATmega, ATtiny) boards of this library.

Main components

2

README

README.md

FluxLink

Semantic PCB diff review with a natural-language chat interface.

FluxLink combines two tools into one workflow: FluxDiff — a structured diff engine for KiCad .kicad_pcb files — and a RAG-powered chat layer that lets engineers query board changes in plain English. Review diffs visually in the interactive board viewer, then ask questions about what changed and why.


What's Inside

LayerWhat it does
FluxDiffCompares two KiCad board files semantically — components, nets, routing, ERC, power tree, differential pairs, grounding, impedance, and BOM
Board ViewerFlask + React/Vite frontend: side-by-side / toggle / overlay view with interactive findings markers
FluxLink ChatRAG pipeline over git history — embeds diff summaries into a FAISS vector store, answers natural-language questions via OpenAI with cited sources

Installation

System requirement: KiCad must be installed and kicad-cli must be on your PATH.

bash
pip install fluxlink

Or from source:

bash
git clone https://github.com/your-org/fluxlink.git
cd fluxlink
pip install -e .

Optional dependencies:

PackagePurpose
pyyamlStackup config in YAML format (falls back to JSON if absent)
faiss-cpuRequired for the chat / RAG sub-system
openaiRequired for embeddings and chat completions

Quick Start

Diff two board files

bash
# Print report to stdout, write output/ directory
fluxlink before.kicad_pcb after.kicad_pcb

# With impedance analysis
fluxlink before.kicad_pcb after.kicad_pcb --stackup stackup.yaml

# Open the interactive board viewer after diffing
fluxlink before.kicad_pcb after.kicad_pcb --viewer

The board viewer runs at http://localhost:5000. When the Vite dev server is running on port 5173, the viewer redirects there automatically.

Ask questions about board history

bash
# 1. Set credentials
export FLUXDIFF_REPO_PATH=/path/to/kicad/repo
export OPENAI_API_KEY=sk-...

# 2. Ingest git history into the vector store
python -m fluxlink.rag.ingest.run_ingest --max-commits 50

# 3. Start the chat API
uvicorn fluxlink.rag.api:app --host 0.0.0.0 --port 8000 --reload

# 4. Open the chat UI at /chat in the board viewer

Output Files

All files are written to output/ in the working directory.

FileDescription
output/diff_report.txtFull text diff report
output/before.svg / output/after.svgBoard SVGs (viewer backgrounds)
output/diff_overlay.pngPixel-level red/green diff image
output/component_diff.pngAnnotated component change markers

Board Viewer

The viewer is a React/Vite frontend served by Flask. Three view modes:

  • Side by side — before and after boards rendered simultaneously, findings markers on the after board
  • Toggle — flip between before and after with a single key
  • Overlay — pixel-level diff image

The findings sidebar lists all issues grouped by category (ERC, POWER, DIFF_PAIR, GROUND, IMPEDANCE, BOM, COMPONENT) with severity badges (CRITICAL / WARNING / INFO), free-text search, and severity filtering. Clicking any finding or component change pans and zooms the board to that location.

Keyboard shortcuts:

KeyAction
j / ↓Next finding
k / ↑Previous finding
EscapeClear selection

Chat Interface

The /chat route opens FluxLink Chat — a full-page conversational UI backed by the RAG API.

Ask questions like:

  • "What changed in the last commit?"
  • "Are there any impedance issues on the USB traces?"
  • "Which components were moved between rev A and rev B?"
  • "Show me all CRITICAL findings across the last 10 commits."

Every answer cites the specific commit ID and file it was sourced from. A collapsible sources panel appears below each assistant message.

Chat API

text
POST /chat
Body:    { "query": "What changed in the last commit?" }
Returns: { "answer": "...", "sources": [{ "commit_id": "a1b2c3d", "file_name": "board/main.kicad_pcb" }] }
Filtered retrieval

Restrict retrieval to a specific commit, document type, or file:

json
POST /chat/filtered
{
  "query": "Are there impedance issues?",
  "filters": {
    "commit": "a1b2c3d4e5f6",
    "type": "impedance",
    "file": "board/main.kicad_pcb"
  }
}

All filter keys are optional. Supported document types: summary, component, net, routing, power_tree, diff_pair, grounding, impedance, bom, repo_file.

Health check
text
GET /health
→ { "status": "ok", "documents_indexed": 142 }

Ingestion

bash
# Index the last 50 commits
python -m fluxlink.rag.ingest.run_ingest --max-commits 50

# Re-index from scratch
python -m fluxlink.rag.ingest.run_ingest --max-commits 50 --clear

# Include impedance analysis during ingestion
python -m fluxlink.rag.ingest.run_ingest --stackup stackup.yaml

Ingestion is idempotent — documents are deduplicated by SHA-256 content hash. Running it twice produces the same index.


Stackup Configuration

Impedance analysis uses a per-layer stackup config. If omitted, a default microstrip layer is assumed (0.2 mm dielectric, εr = 4.5, 35 µm copper).

yaml
# stackup.yaml
layers:
  F.Cu:
    type: microstrip
    dielectric_thickness: 0.2
    dielectric_er: 4.5
    copper_thickness: 0.035
  In1.Cu:
    type: stripline
    dielectric_thickness: 0.18
    dielectric_er: 4.3
    copper_thickness: 0.035

Pass with --stackup stackup.yaml. Both YAML and JSON are accepted.


Analysis Modules

ERC

Power shorts, missing pull-ups on I2C/open-drain nets, missing bypass caps within 5 mm of IC power pins, under-connected power nets, and floating nets.

Power Tree

Classifies regulators, connectors, batteries, and IC loads into a rail graph. Reports rail contention (CRITICAL), unused regulator outputs (WARNING), and sourceless rails (WARNING).

Differential Pairs

Detects paired nets by suffix (_P/_N, +/−, _DP/_DN, etc.). Checks length mismatch > 0.5 mm, via count asymmetry, and layer asymmetry per pair.

Grounding

GND island detection, analog/digital IC mix on a shared GND net, and ADC components without a GND reference within 10 mm.

Impedance

Microstrip and stripline impedance from trace width and stackup config, compared against targets for critical net types (USB, RF, LVDS, HDMI, Ethernet, MIPI, PCIe).

BOM / Supply Chain

Groups components by (value, footprint), queries the ERP adapter, and reports out-of-stock (CRITICAL), low-stock (WARNING), or sufficient-stock (INFO). Swap erp_service.fetch_inventory_from_erp() with any real ERP client without touching other modules.


Configuration

VariableDefaultPurpose
FLUXDIFF_REPO_PATH(required)Path to the KiCad git repository
OPENAI_API_KEY(required)OpenAI API key
FLUXDIFF_EMBEDDING_MODELtext-embedding-3-smallEmbedding model
FLUXDIFF_LLM_MODELgpt-4o-miniChat completion model
FLUXDIFF_TOP_K5Documents retrieved per query
FLUXDIFF_MEMORY_WINDOW5Conversation turns kept in context
FLUXDIFF_VECTOR_DB_PATH./rag_dbFAISS index storage path
FLUXDIFF_CORS_ORIGINSlocalhost:5173,3000,5000Allowed CORS origins (comma-separated)

Ports

ServicePortPurpose
Flask board viewer5000/api/diff, /api/board/*, serves the React SPA
FastAPI RAG chat8000/chat, /chat/filtered, /health
Vite dev server5173Frontend HMR (proxies /api to Flask)

Architecture

text
fluxlink/
├── cli/main.py                  # Entry point — orchestrates the full pipeline
├── parser/
│   ├── sexp_parser.py           # S-expression tokenizer and AST builder
│   └── pcb_parser.py            # AST → domain objects (PCBData)
├── models/pcb_models.py         # Dataclasses: Pad, Component, Net, Trace, Via, Finding, DiffResult
├── diff/diff_engine.py          # compare_pcbs() — master diff orchestrator
├── analysis/
│   ├── connectivity_graph.py
│   ├── trace_connectivity.py
│   ├── geometry.py
│   ├── erc_checker.py
│   ├── power_tree.py
│   ├── diff_pair.py
│   ├── ground_checker.py
│   └── impedance.py
├── supply_chain/
│   ├── bom_checker.py
│   └── erp_service.py           # Swappable ERP adapter stub
├── visual/
│   ├── kicad_export.py          # kicad-cli → SVG/PNG export
│   ├── image_diff.py            # Pixel-level before/after overlay
│   └── component_diff.py        # Component marker and arrow overlay
├── viewer/server.py             # Flask API and SPA server

Extending FluxLink

Adding a new analysis module

  1. Implement analyse_X(pcb: PCBData, ...) -> list[Finding].
  2. Add X_changes: List[str] and X_findings: List[Finding] to DiffResult in pcb_models.py.
  3. Call it in compare_pcbs() in diff_engine.py.
  4. Add a section to the report writer in cli/main.py.
  5. Expose the new findings key in /api/diff in viewer/server.py.
  6. Map it in DiffSummary, DiffGenerator, and DocumentBuilder under rag/.

Swapping the vector store

Replace VectorStore in rag/embedding/vector_store.py. Keep the interface: add_documents(), similarity_search(), clear().

Swapping the LLM

Replace LLMClient.generate_response(prompt: str) -> str in rag/llm/llm_client.py. Update FLUXDIFF_LLM_MODEL.

Swapping the embedding model

Replace Embedder.embed_documents() and embed_query() in rag/embedding/embedder.py. If the embedding dimension changes, run --clear before re-ingesting — the FAISS index dimension is fixed at creation time.

Persisting chat memory across restarts

Replace ChatMemory in rag/chat/memory.py with a Redis- or DB-backed implementation. Keep the interface: add(user, assistant), get_context() -> str, clear().


Dependencies

PackagePurpose
clickCLI argument parsing
flask + flask-corsBoard viewer API
fastapi + uvicorn + pydanticRAG chat API
openaiEmbeddings and chat completions
faiss-cpuVector similarity search
numpyArray operations
opencv-pythonImage processing
cairosvgSVG → PNG conversion
python-dotenv.env file loading
pyyaml (optional)YAML stackup config
kicad-cli (system)PCB export to SVG/PNG

License

MIT

Parts

17
QtyValueFootprintReferences
222pFCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC3, C4
110Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalBT1
124LC1025Package_SO:SOIC-8_5.275x5.275mm_P1.27mmU4
124LC1025Package_SO:PowerIntegrations_SO-8U5
12KohmResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR1
1330ohmResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR2
15uFCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC2
1ATmega328P-PUPackage_LCC:PLCC-28_SMD-SocketU2
1Crystal 16MhzCrystal:Crystal_SMD_HC49-SDY2
1Crystal 32MHzCrystal:Crystal_SMD_HC49-SDY1
1DS1337_PDv2Package_SO:SOIJ-8_5.3x5.3mm_P1.27mmU3
1I2CConnector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_VerticalJ2
1ICSPConnector_PinSocket_2.54mm:PinSocket_2x03_P2.54mm_VerticalJ3
1LEDLED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolderD1
1digital pinsConnector_PinSocket_2.54mm:PinSocket_1x09_P2.54mm_VerticalJ1
1serialConnector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_VerticalJ4

More from RecurringNoob/FluxLink

1
  • 2 layers57 × 33.9 mmBefore3, the printed circuit board in 3D

    Before3

    RecurringNoob/FluxLink

    KiCad PCB diff engine with an interactive board viewer and RAG-powered chat over git history. Covers components, nets, ERC, power tree, differential pairs, grounding, impedance, and BOM.

    17 parts

Similar boards

  • 2 layers50.2 × 31.2 mmMCU Datalogger, the printed circuit board in 3D

    MCU Datalogger

    futureshocked/KLP4e_MCU-Datalogger

    This is the repository for the "MCU Datalogger" project.

    31 parts138MIT
  • 2 layers284.7 × 94.2 mmNyan keys v09b, the printed circuit board in 3D

    Nyan keys v09b

    portlandhodl/nyan-keys-hardware

    Hardware document for the nyan keys keyboard

    144 parts96Apache-2.0
  • 2 layers100.8 × 40 mmKM217-WiFi, the printed circuit board in 3D

    KM217-WiFi

    the78mole/km271-wifi

    A piece of hardware to be installed in a Buderus Logamatic 2107 to provide control and status over WiFi

    120 parts44
  • 2 layers42.7 × 24.4 mmBACEE, the printed circuit board in 3D

    BACEE

    futureshocked/KicadLikeAPro-Project-3-BACEE

    This is one of the PCB projects from the Kicad Like a Pro book. It contains a two and four layer board that implements an Arduino clone with external EEPROM and a clock.

    20 parts19MIT
  • 2 layers284 × 128.5 mmXva1-ui, the printed circuit board in 3D

    Xva1-ui

    MacMannes/XVA1-User-Interface

    A hardware user interface for the XVA1 virtual analog synthesizer, inspired by the Hydrasynth's layout. The XVA1 (and its FM sibling the XFM2) is built on an Artix-7 FPGA but has no built-in UI — this project adds one.

    65 parts10GPL-3.0
  • 2 layers130 × 80 mmPico controller, the printed circuit board in 3D

    Pico controller

    cclienti/tig-welder

    A DIY TIG welder that can be plugged to a traditionnal stick welder or to a high current source

    125 parts8GPL-3.0
  • 4 layers49.3 × 34.1 mmDattalogger Board, the printed circuit board in 3D

    Dattalogger Board

    DevMajed/DataLogger-Board

    Hardware PCB Design for AVR-based Datalogger using KiCAD

    30 parts4
  • 4 layers132.3 × 214.1 mmUtracer11.unrouted, the printed circuit board in 3D

    Utracer11.unrouted

    j-hoppe/uTracer11

    flipchip probe and host GUI to visualize intenral operation of PDP-11 CPU

    129 parts2BSD-3-Clause

Questions

How big is the After3 PCB?

It measures 57 × 33.9 mm and has 2 copper layers, 1.6 mm thick.

What parts does the After3 use?

17 parts, built around the ATMEGA328P-PU and 24LC1025-I/P. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the After3 KiCad files?

From the RecurringNoob/FluxLink repository on GitHub, at the commit this page was made from: the board is test_boards/after3.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the After3 design in my own project?

Its repository states no licence, so its author keeps all rights: ask RecurringNoob before reusing the design.