# baorui-qin/agentforchip architecture

> Architecture diagram of the GitHub repository baorui-qin/agentforchip, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/baorui-qin/agentforchip
- Repository: https://github.com/baorui-qin/agentforchip

## Overview

AgentForChip is a workspace for developing and evaluating an agent-based RTL design and repair system, with a customized DeepSeek Harness and a DeepSeek-compatible inference runtime. The intended user journey is to generate or repair RTL, verify it against trusted evaluation inputs, and retain evidence for assessment. The graph focuses on the sampled P09 RTL tooling and the separately documented inference server/runtime. The tree and excerpts show broad capabilities, but do not establish every runtime connection; dashed, uncited edges mark likely but unverified links.

Main entry points: [`AMD/p09-context-skill-change/rtl-tools/src/phase1/repair-workflow.ts`](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-context-skill-change/rtl-tools/src/phase1/repair-workflow.ts) (Repair workflow), [`AMD/p09-real-change/rtl-tools/src/phase1/snapshots.ts`](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/snapshots.ts) (Input snapshots), [`AMD/p09-real-change/rtl-tools/src/phase1/records.ts`](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/records.ts) (Run records), [`AMD/p09-runtime/deepseek-recipe/server-py/main.py`](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-runtime/deepseek-recipe/server-py/main.py) (Inference server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_rtl["RTL agent workflow"]
  node_workflow["Repair workflow<br/>[repair-workflow.ts]"]
  node_model["Model dispatch<br/>[p10-model.ts]"]
  node_context["Prompt context<br/>[p09-context.ts]"]
  node_tasks["Task catalog<br/>[p09-tasks.ts]"]
  node_candidates["RTL candidates<br/>[candidates.ts]"]
  node_proposal["Repair proposals<br/>[p09-proposal.ts]"]
end

subgraph group_evidence["Verification evidence"]
  node_snapshots["Input snapshots<br/>[snapshots.ts]"]
  node_verification["RTL verification<br/>[verification.ts]"]
  node_diagnostics["Repair diagnostics"]
  node_records[("Run records<br/>[records.ts]")]
  node_comparison["Experiment comparison<br/>[comparison.ts]"]
end

subgraph group_inference["Inference runtime"]
  node_server["Inference server<br/>[main.py]"]
  node_protocols["API protocols"]
  node_streaming["Stream processing"]
end

node_engineer(("Engineer"))
node_backend["Inference backend"]

node_engineer -.->|"starts repair"| node_workflow
node_workflow -->|"uses proposals"| node_proposal
node_workflow -->|"publishes candidate"| node_candidates
node_workflow -.->|"runs verification"| node_verification
node_model -->|"publishes RTL"| node_candidates
node_model -.->|"builds request"| node_context
node_context -->|"hashes content"| node_snapshots
node_context -->|"uses interface"| node_candidates
node_tasks -->|"hashes evaluation"| node_snapshots
node_snapshots -->|"writes manifest"| node_records
node_verification -.->|"records runs"| node_records
node_diagnostics -->|"reads records"| node_records
node_diagnostics -->|"reads snapshots"| node_snapshots
node_comparison -.->|"compares runs"| node_records
node_server -.->|"converts requests"| node_protocols
node_server -.->|"processes chunks"| node_streaming
node_server -->|"requests inference"| node_backend

click node_workflow "https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-context-skill-change/rtl-tools/src/phase1/repair-workflow.ts"
click node_model "https://github.com/baorui-qin/agentforchip/blob/main/AMD/p10-40-trace-change/rtl-tools/src/phase1/p10-model.ts"
click node_context "https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/p09-context.ts"
click node_tasks "https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/p09-tasks.ts"
click node_candidates "https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/candidates.ts"
click node_proposal "https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-context-skill-change/rtl-tools/src/phase1/p09-proposal.ts"
click node_snapshots "https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/snapshots.ts"
click node_verification "https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/verification.ts"
click node_diagnostics "https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/repair-diagnostics.ts"
click node_records "https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/records.ts"
click node_comparison "https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/comparison.ts"
click node_server "https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-runtime/deepseek-recipe/server-py/main.py"
click node_protocols "https://github.com/baorui-qin/agentforchip/tree/main/AMD/p09-runtime/deepseek-recipe/deepseek-recipe/src/protocol"
click node_streaming "https://github.com/baorui-qin/agentforchip/tree/main/AMD/p09-runtime/deepseek-recipe/deepseek-recipe/src/stream"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_workflow,node_model,node_context,node_tasks,node_candidates,node_proposal toneBlue
class node_snapshots,node_verification,node_diagnostics,node_records,node_comparison toneAmber
class node_server,node_protocols,node_streaming toneMint
class node_engineer,node_backend toneIndigo
```

## Components

### RTL agent workflow

- [Repair workflow](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-context-skill-change/rtl-tools/src/phase1/repair-workflow.ts): `AMD/p09-context-skill-change/rtl-tools/src/phase1/repair-workflow.ts`
- [Model dispatch](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p10-40-trace-change/rtl-tools/src/phase1/p10-model.ts): `AMD/p10-40-trace-change/rtl-tools/src/phase1/p10-model.ts`
- [Prompt context](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/p09-context.ts): `AMD/p09-real-change/rtl-tools/src/phase1/p09-context.ts`
- [Task catalog](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/p09-tasks.ts): `AMD/p09-real-change/rtl-tools/src/phase1/p09-tasks.ts`
- [RTL candidates](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/candidates.ts): `AMD/p09-real-change/rtl-tools/src/phase1/candidates.ts`
- [Repair proposals](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-context-skill-change/rtl-tools/src/phase1/p09-proposal.ts): `AMD/p09-context-skill-change/rtl-tools/src/phase1/p09-proposal.ts`

### Verification evidence

- [Input snapshots](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/snapshots.ts): `AMD/p09-real-change/rtl-tools/src/phase1/snapshots.ts`
- [RTL verification](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/verification.ts): `AMD/p09-real-change/rtl-tools/src/phase1/verification.ts`
- [Repair diagnostics](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/repair-diagnostics.ts): `AMD/p09-real-change/rtl-tools/src/phase1/repair-diagnostics.ts`
- [Run records](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/records.ts): `AMD/p09-real-change/rtl-tools/src/phase1/records.ts`
- [Experiment comparison](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-real-change/rtl-tools/src/phase1/comparison.ts): `AMD/p09-real-change/rtl-tools/src/phase1/comparison.ts`

### Inference runtime

- [Inference server](https://github.com/baorui-qin/agentforchip/blob/main/AMD/p09-runtime/deepseek-recipe/server-py/main.py): `AMD/p09-runtime/deepseek-recipe/server-py/main.py`
- [API protocols](https://github.com/baorui-qin/agentforchip/tree/main/AMD/p09-runtime/deepseek-recipe/deepseek-recipe/src/protocol): `AMD/p09-runtime/deepseek-recipe/deepseek-recipe/src/protocol`
- [Stream processing](https://github.com/baorui-qin/agentforchip/tree/main/AMD/p09-runtime/deepseek-recipe/deepseek-recipe/src/stream): `AMD/p09-runtime/deepseek-recipe/deepseek-recipe/src/stream`

### Other components

- **Engineer**
- **Inference backend**

## Connections

- Engineer → Repair workflow: starts repair
- Repair workflow → Repair proposals: uses proposals (evidence: `AMD/p09-context-skill-change/rtl-tools/src/phase1/repair-workflow.ts`)
- Repair workflow → RTL candidates: publishes candidate (evidence: `AMD/p09-context-skill-change/rtl-tools/src/phase1/repair-workflow.ts`)
- Repair workflow → RTL verification: runs verification
- Model dispatch → RTL candidates: publishes RTL (evidence: `AMD/p10-40-trace-change/rtl-tools/src/phase1/p10-model.ts`)
- Model dispatch → Prompt context: builds request
- Prompt context → Input snapshots: hashes content (evidence: `AMD/p09-real-change/rtl-tools/src/phase1/p09-context.ts`)
- Prompt context → RTL candidates: uses interface (evidence: `AMD/p09-real-change/rtl-tools/src/phase1/p09-context.ts`)
- Task catalog → Input snapshots: hashes evaluation (evidence: `AMD/p09-real-change/rtl-tools/src/phase1/p09-tasks.ts`)
- Input snapshots → Run records: writes manifest (evidence: `AMD/p09-real-change/rtl-tools/src/phase1/snapshots.ts`)
- RTL verification → Run records: records runs
- Repair diagnostics → Run records: reads records (evidence: `AMD/p09-real-change/rtl-tools/src/phase1/repair-diagnostics.ts`)
- Repair diagnostics → Input snapshots: reads snapshots (evidence: `AMD/p09-real-change/rtl-tools/src/phase1/repair-diagnostics.ts`)
- Experiment comparison → Run records: compares runs
- Inference server → API protocols: converts requests
- Inference server → Stream processing: processes chunks
- Inference server → Inference backend: requests inference (evidence: `AMD/p09-runtime/deepseek-recipe/server-py/main.py`)
