# achyutak41/sastra_achyuta_227003005_cse architecture

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

- Interactive diagram: https://gitdiagram.com/achyutak41/sastra_achyuta_227003005_cse
- Repository: https://github.com/achyutak41/sastra_achyuta_227003005_cse

## Overview

This is an AUTOSAR HLD analysis assistant: engineers ask natural-language questions and receive evidence-grounded answers with citations and confidence. Its documented capabilities include ARXML analysis, semantic retrieval, architecture knowledge reuse, and human-supported decision-making. The visible runtime path is Streamlit → RAG pipeline → retrieval, with Ollama generating answers from retrieved evidence. Ingestion, chunking, embedding, and indexing are represented as product stages, but several connections are unverified because their implementations were not excerpted; evaluation scripts are omitted as supporting machinery.

Main entry points: [`Code/rag/rag_pipeline.py`](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/rag/rag_pipeline.py) (RAG Orchestrator), [`Code/app.py`](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/app.py) (Streamlit Assistant), [`Code/retrieval/search.py`](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/retrieval/search.py) (Semantic Search), [`Code/retrieval/build_faiss_index.py`](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/retrieval/build_faiss_index.py) (FAISS Index Builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["ARXML Ingestion"]
  node_parser["ARXML Parser<br/>[arxml_parser.py]"]
  node_validation["ARXML Validation<br/>[validate_arxml.py]"]
  node_export["Structured JSON Export<br/>[export_json.py]"]
  node_structured["Structured AUTOSAR Data<br/>[EcuExtract.json]"]
end

subgraph group_indexing["Knowledge Preparation"]
  node_searchtext["Search Text Generation"]
  node_chunks["Chunk Creation<br/>[create_chunks.py]"]
  node_embeddings["Embedding Generation"]
  node_faissbuild["FAISS Index Builder"]
end

subgraph group_retrieval["Evidence Retrieval"]
  node_index[("FAISS Vector Index<br/>[EcuExtract.faiss]")]
  node_metadata["Chunk Metadata"]
  node_search["Semantic Search<br/>[search.py]"]
end

subgraph group_answers["Grounded Answers"]
  node_pipeline["RAG Orchestrator<br/>[rag_pipeline.py]"]
  node_prompt["Grounding Prompt<br/>[rag_prompt.txt]"]
  node_ollama["Ollama LLM"]
  node_result["Answer and Citations<br/>[rag_pipeline.py]"]
end

subgraph group_interface["Engineer Interface"]
  node_app["Streamlit Assistant<br/>[app.py]"]
end

node_engineer(("Engineer"))

node_engineer -->|"asks question"| node_app
node_app -->|"loads retriever"| node_search
node_app -->|"requests answer"| node_pipeline
node_pipeline -->|"retrieves evidence"| node_search
node_search -->|"searches vectors"| node_index
node_search -->|"reads chunks"| node_metadata
node_pipeline -->|"loads template"| node_prompt
node_pipeline -->|"generates answer"| node_ollama
node_pipeline -->|"builds citations"| node_result
node_app -->|"displays response"| node_result
node_engineer -.->|"submits ARXML"| node_validation
node_validation -.->|"checks input"| node_parser
node_parser -->|"parses document"| node_export
node_export -->|"writes JSON"| node_structured
node_structured -->|"formats architecture"| node_searchtext
node_searchtext -.->|"creates chunks"| node_chunks
node_chunks -.->|"embeds text"| node_embeddings
node_embeddings -.->|"builds index"| node_faissbuild
node_faissbuild -.->|"persists vectors"| node_index
node_faissbuild -.->|"persists metadata"| node_metadata

click node_app "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/app.py"
click node_parser "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/ingestion/arxml_parser.py"
click node_validation "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/validation/validate_arxml.py"
click node_export "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/ingestion/export_json.py"
click node_structured "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Input_Data/processed/EcuExtract.json"
click node_searchtext "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/ingestion/create_search_text.py"
click node_chunks "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/retrieval/create_chunks.py"
click node_embeddings "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/retrieval/create_embeddings.py"
click node_faissbuild "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/retrieval/build_faiss_index.py"
click node_index "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Input_Data/processed/EcuExtract.faiss"
click node_metadata "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Input_Data/processed/EcuExtract_metadata.json"
click node_search "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/retrieval/search.py"
click node_pipeline "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/rag/rag_pipeline.py"
click node_prompt "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Model_Prompts_Config/rag_prompt.txt"
click node_result "https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/rag/rag_pipeline.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_parser,node_validation,node_export,node_structured toneBlue
class node_searchtext,node_chunks,node_embeddings,node_faissbuild toneAmber
class node_index,node_metadata,node_search toneMint
class node_pipeline,node_prompt,node_ollama,node_result toneRose
class node_app,node_engineer toneIndigo
```

## Components

### ARXML Ingestion

- [ARXML Parser](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/ingestion/arxml_parser.py): `Code/ingestion/arxml_parser.py`
- [ARXML Validation](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/validation/validate_arxml.py): `Code/validation/validate_arxml.py`
- [Structured JSON Export](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/ingestion/export_json.py): `Code/ingestion/export_json.py`
- [Structured AUTOSAR Data](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Input_Data/processed/EcuExtract.json): `Input_Data/processed/EcuExtract.json`

### Knowledge Preparation

- [Search Text Generation](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/ingestion/create_search_text.py): `Code/ingestion/create_search_text.py`
- [Chunk Creation](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/retrieval/create_chunks.py): `Code/retrieval/create_chunks.py`
- [Embedding Generation](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/retrieval/create_embeddings.py): `Code/retrieval/create_embeddings.py`
- [FAISS Index Builder](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/retrieval/build_faiss_index.py): `Code/retrieval/build_faiss_index.py`

### Evidence Retrieval

- [FAISS Vector Index](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Input_Data/processed/EcuExtract.faiss): `Input_Data/processed/EcuExtract.faiss`
- [Chunk Metadata](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Input_Data/processed/EcuExtract_metadata.json): `Input_Data/processed/EcuExtract_metadata.json`
- [Semantic Search](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/retrieval/search.py): `Code/retrieval/search.py`

### Grounded Answers

- [RAG Orchestrator](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/rag/rag_pipeline.py): `Code/rag/rag_pipeline.py`
- [Grounding Prompt](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Model_Prompts_Config/rag_prompt.txt): `Model_Prompts_Config/rag_prompt.txt`
- **Ollama LLM**
- [Answer and Citations](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/rag/rag_pipeline.py): `Code/rag/rag_pipeline.py`

### Engineer Interface

- [Streamlit Assistant](https://github.com/achyutak41/sastra_achyuta_227003005_cse/blob/main/Code/app.py): `Code/app.py`

### Other components

- **Engineer**

## Connections

- Engineer → Streamlit Assistant: asks question (evidence: `Code/app.py`)
- Streamlit Assistant → Semantic Search: loads retriever (evidence: `Code/app.py`)
- Streamlit Assistant → RAG Orchestrator: requests answer (evidence: `Code/app.py`)
- RAG Orchestrator → Semantic Search: retrieves evidence (evidence: `Code/rag/rag_pipeline.py`)
- Semantic Search → FAISS Vector Index: searches vectors (evidence: `Code/retrieval/search.py`)
- Semantic Search → Chunk Metadata: reads chunks (evidence: `Code/retrieval/search.py`)
- RAG Orchestrator → Grounding Prompt: loads template (evidence: `Code/rag/rag_pipeline.py`)
- RAG Orchestrator → Ollama LLM: generates answer (evidence: `Code/rag/rag_pipeline.py`)
- RAG Orchestrator → Answer and Citations: builds citations (evidence: `Code/rag/rag_pipeline.py`)
- Streamlit Assistant → Answer and Citations: displays response (evidence: `Code/app.py`)
- Engineer → ARXML Validation: submits ARXML
- ARXML Validation → ARXML Parser: checks input
- ARXML Parser → Structured JSON Export: parses document (evidence: `Code/ingestion/export_json.py`)
- Structured JSON Export → Structured AUTOSAR Data: writes JSON (evidence: `Code/ingestion/export_json.py`)
- Structured AUTOSAR Data → Search Text Generation: formats architecture (evidence: `Code/ingestion/create_search_text.py`)
- Search Text Generation → Chunk Creation: creates chunks
- Chunk Creation → Embedding Generation: embeds text
- Embedding Generation → FAISS Index Builder: builds index
- FAISS Index Builder → FAISS Vector Index: persists vectors
- FAISS Index Builder → Chunk Metadata: persists metadata
