# tsp-uc3m/digital-thread-copilot architecture

> Architecture diagram of the GitHub repository tsp-uc3m/digital-thread-copilot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tsp-uc3m/digital-thread-copilot
- Repository: https://github.com/tsp-uc3m/digital-thread-copilot

## Overview

The repository describes a planned engineering copilot that would ingest requirements, SysML v2 models, and tests into a knowledge graph, then answer traceability and impact questions through deterministic tools and an LLM. The shown runtime currently implements only a command-line parser that prints help; the package has no sampled ingestion, graph, chat, or evaluation implementation. The README documents these product capabilities, but evidence is insufficient to map their internal calls, so they are represented only as documented, unverified stages. The VCRM and research-screening scripts are project tooling, not the copilot runtime.

Main entry points: [`src/digital_thread_copilot`](https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot) (LLM copilot), [`src/digital_thread_copilot/__main__.py`](https://github.com/tsp-uc3m/digital-thread-copilot/blob/main/src/digital_thread_copilot/__main__.py) (CLI parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Command entry"]
  node_cli["CLI parser<br/>[__main__.py]"]
end

subgraph group_thread["Digital thread"]
  node_requirements["Requirements ingestion"]
  node_sysml["SysML v2 ingestion"]
  node_tests_ingest["Test evidence ingestion"]
  node_graph[("Knowledge graph")]
end

subgraph group_copilot["Copilot answering"]
  node_tools["Deterministic tools"]
  node_guardrails["Answer guardrails"]
  node_llm["LLM copilot"]
  node_answers["Grounded answers"]
end

subgraph group_evaluation["Evaluation"]
  node_questions["Reference questions"]
  node_evaluation["Answer evaluation"]
end

node_user(("Engineer"))
node_llm_service{{"LLM service"}}

node_user -->|"invokes"| node_cli
node_cli -->|"prints help"| node_user
node_requirements -.->|"ingests artifacts"| node_graph
node_sysml -.->|"ingests model"| node_graph
node_tests_ingest -.->|"ingests evidence"| node_graph
node_tools -.->|"queries"| node_graph
node_llm -.->|"uses tools"| node_tools
node_llm -.->|"accesses"| node_llm_service
node_guardrails -.->|"constrains"| node_llm
node_llm -.->|"produces"| node_answers
node_questions -.->|"evaluates"| node_evaluation

click node_cli "https://github.com/tsp-uc3m/digital-thread-copilot/blob/main/src/digital_thread_copilot/__main__.py"
click node_requirements "https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot"
click node_sysml "https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot"
click node_tests_ingest "https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot"
click node_graph "https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot"
click node_tools "https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot"
click node_guardrails "https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot"
click node_llm "https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot"
click node_answers "https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot"
click node_questions "https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot"
click node_evaluation "https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot"

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_cli toneBlue
class node_requirements,node_sysml,node_tests_ingest,node_graph toneAmber
class node_tools,node_guardrails,node_llm,node_answers toneMint
class node_questions,node_evaluation toneRose
class node_user,node_llm_service toneIndigo
```

## Components

### Command entry

- [CLI parser](https://github.com/tsp-uc3m/digital-thread-copilot/blob/main/src/digital_thread_copilot/__main__.py): `src/digital_thread_copilot/__main__.py`

### Digital thread

- [Requirements ingestion](https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot): `src/digital_thread_copilot`
- [SysML v2 ingestion](https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot): `src/digital_thread_copilot`
- [Test evidence ingestion](https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot): `src/digital_thread_copilot`
- [Knowledge graph](https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot): `src/digital_thread_copilot`

### Copilot answering

- [Deterministic tools](https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot): `src/digital_thread_copilot`
- [Answer guardrails](https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot): `src/digital_thread_copilot`
- [LLM copilot](https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot): `src/digital_thread_copilot`
- [Grounded answers](https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot): `src/digital_thread_copilot`

### Evaluation

- [Reference questions](https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot): `src/digital_thread_copilot`
- [Answer evaluation](https://github.com/tsp-uc3m/digital-thread-copilot/tree/main/src/digital_thread_copilot): `src/digital_thread_copilot`

### Other components

- **Engineer**
- **LLM service**

## Connections

- Engineer → CLI parser: invokes (evidence: `src/digital_thread_copilot/__main__.py`)
- CLI parser → Engineer: prints help (evidence: `src/digital_thread_copilot/__main__.py`)
- Requirements ingestion → Knowledge graph: ingests artifacts (evidence: `README.md`)
- SysML v2 ingestion → Knowledge graph: ingests model (evidence: `README.md`)
- Test evidence ingestion → Knowledge graph: ingests evidence (evidence: `README.md`)
- Deterministic tools → Knowledge graph: queries (evidence: `README.md`)
- LLM copilot → Deterministic tools: uses tools (evidence: `README.md`)
- LLM copilot → LLM service: accesses (evidence: `README.md`)
- Answer guardrails → LLM copilot: constrains (evidence: `README.md`)
- LLM copilot → Grounded answers: produces (evidence: `README.md`)
- Reference questions → Answer evaluation: evaluates (evidence: `README.md`)
