# adithya49/fusa-ai-studio architecture

> Architecture diagram of the GitHub repository adithya49/fusa-ai-studio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adithya49/fusa-ai-studio
- Repository: https://github.com/adithya49/fusa-ai-studio

## Overview

FuSA AI Studio is a Streamlit workspace for automotive functional-safety engineering across the ISO 26262 lifecycle. Engineers select a project, create and manage safety artifacts, ask AI-assisted questions, maintain traceability, and export work-product documents. The app routes workspace selections to lifecycle and support modules; shared services provide project persistence, knowledge indexing, retrieval-augmented generation, and model access. The README documents additional lifecycle and AI capabilities, but their internal wiring is not established by the sampled source, so those links are omitted.

Main entry points: [`app.py`](https://github.com/adithya49/fusa-ai-studio/blob/main/app.py) (Workspace Router), [`fusa_ai_studio/database/repository.py`](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/database/repository.py) (Repository), [`fusa_ai_studio/knowledge/base.py`](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/knowledge/base.py) (Knowledge Base), [`fusa_ai_studio/ai/rag.py`](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/ai/rag.py) (RAG Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace"]
  node_app["Workspace Router<br/>[app.py]"]
  node_projects["Projects<br/>[projects.py]"]
  node_dashboard["Dashboard<br/>[dashboard.py]"]
  node_assistant["AI Assistant<br/>[assistant.py]"]
  node_settings["Settings<br/>[settings.py]"]
end

subgraph group_safety["Safety Lifecycle"]
  node_item["Item Definition<br/>[item_definition.py]"]
  node_hara["HARA<br/>[hara.py]"]
  node_goals["Safety Goals<br/>[safety_goals.py]"]
  node_fsc["Functional Concept<br/>[fsc.py]"]
  node_tsc["Technical Concept<br/>[tsc.py]"]
  node_workflow["Workflow Automation<br/>[workflow.py]"]
end

subgraph group_knowledge["Knowledge And AI"]
  node_knowledge_ui["Knowledge Base UI<br/>[knowledge.py]"]
  node_knowledge_base["Knowledge Base<br/>[base.py]"]
  node_chunking["Chunking<br/>[chunking.py]"]
  node_embeddings["Embeddings<br/>[embeddings.py]"]
  node_vector_store[("Vector Store<br/>[chroma_store.py]")]
  node_rag["RAG Engine<br/>[rag.py]"]
  node_llm["LLM Client<br/>[llm.py]"]
end

subgraph group_platform["Project Platform"]
  node_services["Service Assembly<br/>[services.py]"]
  node_repository["Repository<br/>[repository.py]"]
  node_sqlite[("Project Database<br/>[connection.py]")]
end

subgraph group_outputs["Traceability And Outputs"]
  node_traceability["Traceability<br/>[traceability.py]"]
  node_document_factory["Document Factory"]
end

node_engineer(("Safety Engineer"))
node_model_providers{{"Model Providers"}}

node_engineer -->|"uses"| node_app
node_app -->|"routes to"| node_projects
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_assistant
node_app -->|"routes to"| node_settings
node_app -->|"routes to"| node_item
node_app -->|"routes to"| node_hara
node_app -->|"routes to"| node_goals
node_app -->|"routes to"| node_fsc
node_app -->|"routes to"| node_tsc
node_app -->|"routes to"| node_workflow
node_app -->|"routes to"| node_knowledge_ui
node_app -->|"routes to"| node_traceability
node_app -->|"routes to"| node_document_factory
node_app -->|"builds"| node_services
node_services -->|"initializes"| node_repository
node_repository -->|"reads and writes"| node_sqlite
node_services -->|"assembles"| node_knowledge_base
node_services -->|"assembles"| node_rag
node_knowledge_base -->|"reads and writes"| node_repository
node_knowledge_base -->|"chunks documents"| node_chunking
node_knowledge_base -->|"embeds chunks"| node_embeddings
node_knowledge_base -->|"indexes chunks"| node_vector_store
node_rag -->|"embeds query"| node_embeddings
node_rag -->|"searches"| node_vector_store
node_rag -->|"loads context"| node_repository
node_rag -->|"requests generation"| node_llm
node_llm -.->|"calls provider"| node_model_providers
node_document_factory -->|"reads artifacts"| node_repository
node_traceability -->|"accesses links"| node_repository

click node_app "https://github.com/adithya49/fusa-ai-studio/blob/main/app.py"
click node_projects "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/projects.py"
click node_dashboard "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/dashboard.py"
click node_assistant "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/assistant.py"
click node_settings "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/settings.py"
click node_item "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/item_definition.py"
click node_hara "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/hara.py"
click node_goals "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/safety_goals.py"
click node_fsc "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/fsc.py"
click node_tsc "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/tsc.py"
click node_workflow "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/workflow.py"
click node_knowledge_ui "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/knowledge.py"
click node_knowledge_base "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/knowledge/base.py"
click node_chunking "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/ai/chunking.py"
click node_embeddings "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/ai/embeddings.py"
click node_vector_store "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/vectorstores/chroma_store.py"
click node_rag "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/ai/rag.py"
click node_llm "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/ai/llm.py"
click node_traceability "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/traceability.py"
click node_document_factory "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/document_factory.py"
click node_services "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/core/services.py"
click node_repository "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/database/repository.py"
click node_sqlite "https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/database/connection.py"

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_app,node_projects,node_dashboard,node_assistant,node_settings toneBlue
class node_item,node_hara,node_goals,node_fsc,node_tsc,node_workflow toneAmber
class node_knowledge_ui,node_knowledge_base,node_chunking,node_embeddings,node_vector_store,node_rag,node_llm toneMint
class node_services,node_repository,node_sqlite toneRose
class node_traceability,node_document_factory,node_engineer,node_model_providers toneIndigo
```

## Components

### Workspace

- [Workspace Router](https://github.com/adithya49/fusa-ai-studio/blob/main/app.py): `app.py`
- [Projects](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/projects.py): `fusa_ai_studio/modules/projects.py`
- [Dashboard](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/dashboard.py): `fusa_ai_studio/modules/dashboard.py`
- [AI Assistant](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/assistant.py): `fusa_ai_studio/modules/assistant.py`
- [Settings](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/settings.py): `fusa_ai_studio/modules/settings.py`

### Safety Lifecycle

- [Item Definition](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/item_definition.py): `fusa_ai_studio/modules/item_definition.py`
- [HARA](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/hara.py): `fusa_ai_studio/modules/hara.py`
- [Safety Goals](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/safety_goals.py): `fusa_ai_studio/modules/safety_goals.py`
- [Functional Concept](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/fsc.py): `fusa_ai_studio/modules/fsc.py`
- [Technical Concept](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/tsc.py): `fusa_ai_studio/modules/tsc.py`
- [Workflow Automation](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/workflow.py): `fusa_ai_studio/modules/workflow.py`

### Knowledge And AI

- [Knowledge Base UI](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/knowledge.py): `fusa_ai_studio/modules/knowledge.py`
- [Knowledge Base](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/knowledge/base.py): `fusa_ai_studio/knowledge/base.py`
- [Chunking](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/ai/chunking.py): `fusa_ai_studio/ai/chunking.py`
- [Embeddings](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/ai/embeddings.py): `fusa_ai_studio/ai/embeddings.py`
- [Vector Store](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/vectorstores/chroma_store.py): `fusa_ai_studio/vectorstores/chroma_store.py`
- [RAG Engine](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/ai/rag.py): `fusa_ai_studio/ai/rag.py`
- [LLM Client](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/ai/llm.py): `fusa_ai_studio/ai/llm.py`

### Project Platform

- [Service Assembly](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/core/services.py): `fusa_ai_studio/core/services.py`
- [Repository](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/database/repository.py): `fusa_ai_studio/database/repository.py`
- [Project Database](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/database/connection.py): `fusa_ai_studio/database/connection.py`

### Traceability And Outputs

- [Traceability](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/traceability.py): `fusa_ai_studio/modules/traceability.py`
- [Document Factory](https://github.com/adithya49/fusa-ai-studio/blob/main/fusa_ai_studio/modules/document_factory.py): `fusa_ai_studio/modules/document_factory.py`

### Other components

- **Safety Engineer**
- **Model Providers**

## Connections

- Safety Engineer → Workspace Router: uses
- Workspace Router → Projects: routes to
- Workspace Router → Dashboard: routes to
- Workspace Router → AI Assistant: routes to
- Workspace Router → Settings: routes to
- Workspace Router → Item Definition: routes to
- Workspace Router → HARA: routes to
- Workspace Router → Safety Goals: routes to
- Workspace Router → Functional Concept: routes to
- Workspace Router → Technical Concept: routes to
- Workspace Router → Workflow Automation: routes to
- Workspace Router → Knowledge Base UI: routes to
- Workspace Router → Traceability: routes to
- Workspace Router → Document Factory: routes to
- Workspace Router → Service Assembly: builds
- Service Assembly → Repository: initializes
- Repository → Project Database: reads and writes
- Service Assembly → Knowledge Base: assembles
- Service Assembly → RAG Engine: assembles
- Knowledge Base → Repository: reads and writes
- Knowledge Base → Chunking: chunks documents
- Knowledge Base → Embeddings: embeds chunks
- Knowledge Base → Vector Store: indexes chunks
- RAG Engine → Embeddings: embeds query
- RAG Engine → Vector Store: searches
- RAG Engine → Repository: loads context
- RAG Engine → LLM Client: requests generation
- LLM Client → Model Providers: calls provider
- Document Factory → Repository: reads artifacts
- Traceability → Repository: accesses links
