# drishyaajith10/decody architecture

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

- Interactive diagram: https://gitdiagram.com/drishyaajith10/decody
- Repository: https://github.com/drishyaajith10/decody

## Overview

1. **What this repo is**
   - Decody is a single-service meeting analysis application that takes raw meeting transcripts and produces structured insights, mainly **action items** and **decisions**.
   - The system is oriented around transcript processing rather than long-lived data storage: input comes in, NLP runs, results are returned and optionally exported.

2. **Top-level runtime shape**
   - The backend is a **FastAPI** application in `backend/app/main.py`.
   - The same backend also serves the static frontend from `backend/app/static`, so the architecture is a combined API + UI delivery model rather than separate deployed services.

3. **User interface boundary**
   - `backend/app/static/index.html`, `script.js`, and `style.css` form a lightweight browser UI.
   - The frontend’s job is to collect transcript text, send requests to the backend endpoints, render extracted results, and likely trigger export.
   - There is no indication of a complex client state model; the browser is a thin presentation layer over the API.

4. **Primary API layer**
   - `main.py` is the orchestration boundary where requests enter the system.
   - The README indicates three main endpoints:
     - `/analyze` for transcript analysis,
     - `/search` for query-based retrieval and extraction,
     - `/export` for CSV output.
   - This suggests the API layer is responsible for coordinating preprocessing, retrieval, extraction, and formatting rather than embedding NLP logic directly.

5. **Transcript cleaning stage**
   - `backend/app/utils/cleaner.py` is the first processing boundary for messy transcript text.
   - The README says it removes timestamps, speaker labels, and filler words.
   - This stage normalizes unstructured input so downstream sentence segmentation and extraction behave more consistently.

6. **NLP and model-related subsystem**
   - The `backend/app/ml` package contains the core analysis logic:
     - `nlp.py` for NLP setup/pipeline support,
     - `config.py` for model/pipeline settings,
     - `retriever.py` for semantic search,
     - `action_extractor.py` and `decision_extractor.py` for insight extraction,
     - `entity_extractor.py` for entity-focused parsing.
   - This is the main computational boundary of the system.

7. **Hybrid retrieval + extraction flow**
   - The README describes a hybrid pipeline: cleaned transcript → sentence segmentation → embeddings → semantic retrieval → rule-based extraction → structured output.
   - The retrieval layer uses **MiniLM embeddings** and cosine similarity to identify sentences relevant to a query such as “action items” or “decisions”.
   - The extraction layer then applies rules and NLP heuristics to transform relevant text into structured records.

8. **Action item and decision processing**
   - Action items are extracted with fields like **who**, **what**, and **when**.
   - Decisions are detected using keywords and decision-oriented phrasing such as “agreed,” “decided,” and “approved.”
   - These are handled as separate semantic categories, which is important for diagramming the system as two output branches sharing the same upstream pipeline.

9. **Data flow through the system**
   - The dominant flow is:
     - raw transcript input,
     - cleaning,
     - sentence/NLP processing,
     - embedding and retrieval,
     - targeted extraction,
     - JSON-like structured response.
   - The retrieval step acts as a filter to reduce the amount of text the extractors need to inspect, which is a meaningful architectural boundary.

10. **Output and export**
   - `backend/app/utils/export.py` handles CSV export of results.
   - This implies the analysis results are represented in a structured format internally, then converted to a tabular export format for sharing or download.
   - Export is a secondary output path, not part of the core NLP pipeline.

11. **Dependencies and implementation style**
   - The stack is intentionally lightweight: FastAPI on the backend, spaCy for sentence/NLP handling, Sentence Transformers for embeddings, and plain HTML/JS/CSS on the frontend.
   - There is no sign of a database, queue, or external ML inference service; analysis appears to run in-process inside the API server.

12. **Supporting materials**
   - `docs/project_overview.md` and `docs/sample` likely provide design notes and sample transcripts/results, useful for understanding expected inputs and outputs.
   - These are documentation assets, not runtime components, but they help define the contract of the system.

13. **How to draw the architecture**
   - A clear diagram would show:
     - Browser UI on the left,
     - FastAPI backend in the center,
     - A preprocessing block,
     - A shared NLP/embedding/retrieval block,
     - Separate action-item and decision extraction branches,
     - A CSV export path.
   - The key conceptual boundary is that the backend owns all analysis logic; the frontend only submits text and displays results.

Main entry points: [`backend/app/main.py`](https://github.com/drishyaajith10/decody/blob/main/backend/app/main.py) (FastAPI app), [`backend/app/ml/retriever.py`](https://github.com/drishyaajith10/decody/blob/main/backend/app/ml/retriever.py) (Retriever), [`backend/app/ml/nlp.py`](https://github.com/drishyaajith10/decody/blob/main/backend/app/ml/nlp.py) (NLP setup), [`backend/app/static/script.js`](https://github.com/drishyaajith10/decody/blob/main/backend/app/static/script.js) (script.js)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_ui_bundle["Browser UI<br/>static client"]
  node_ui_html["index.html<br/>page<br/>[index.html]"]
  node_ui_js["script.js<br/>client logic<br/>[script.js]"]
  node_ui_css["style.css<br/>styles<br/>[style.css]"]
end

subgraph group_api["API"]
  node_api_main["FastAPI app<br/>api server<br/>[main.py]"]
  node_export_util["CSV export<br/>formatter<br/>[export.py]"]
end

subgraph group_nlp["Analysis"]
  node_cleaner["Cleaner<br/>preprocess<br/>[cleaner.py]"]
  node_nlp_core["NLP setup<br/>nlp pipeline<br/>[nlp.py]"]
  node_ml_config["Model config<br/>settings<br/>[config.py]"]
  node_retriever["Retriever<br/>semantic search<br/>[retriever.py]"]
  node_action_extractor["Actions<br/>extractor"]
  node_decision_extractor["Decisions<br/>extractor"]
  node_entity_extractor["Entities<br/>extractor"]
end

subgraph group_support["Support"]
  node_readme["README<br/>overview<br/>[README.md]"]
  node_overview_doc["Project notes<br/>docs"]
  node_sample_docs["Samples<br/>examples"]
end

node_ui_html -->|"loads"| node_ui_js
node_ui_html -->|"styles"| node_ui_css
node_ui_js -->|"calls"| node_api_main
node_api_main -->|"preprocess"| node_cleaner
node_cleaner -->|"feeds"| node_nlp_core
node_nlp_core -->|"configured by"| node_ml_config
node_nlp_core -->|"supports"| node_retriever
node_retriever -->|"routes to"| node_action_extractor
node_retriever -->|"routes to"| node_decision_extractor
node_retriever -->|"routes to"| node_entity_extractor
node_action_extractor -->|"returns"| node_api_main
node_decision_extractor -->|"returns"| node_api_main
node_entity_extractor -->|"returns"| node_api_main
node_api_main -->|"exports"| node_export_util
node_api_main -->|"responds to"| node_ui_js
node_readme -.->|"documents"| node_api_main
node_overview_doc -.->|"documents"| node_api_main
node_sample_docs -.->|"illustrates"| node_action_extractor

click node_ui_bundle "https://github.com/drishyaajith10/decody/tree/main/backend/app/static"
click node_ui_html "https://github.com/drishyaajith10/decody/blob/main/backend/app/static/index.html"
click node_ui_js "https://github.com/drishyaajith10/decody/blob/main/backend/app/static/script.js"
click node_ui_css "https://github.com/drishyaajith10/decody/blob/main/backend/app/static/style.css"
click node_api_main "https://github.com/drishyaajith10/decody/blob/main/backend/app/main.py"
click node_cleaner "https://github.com/drishyaajith10/decody/blob/main/backend/app/utils/cleaner.py"
click node_nlp_core "https://github.com/drishyaajith10/decody/blob/main/backend/app/ml/nlp.py"
click node_ml_config "https://github.com/drishyaajith10/decody/blob/main/backend/app/ml/config.py"
click node_retriever "https://github.com/drishyaajith10/decody/blob/main/backend/app/ml/retriever.py"
click node_action_extractor "https://github.com/drishyaajith10/decody/blob/main/backend/app/ml/action_extractor.py"
click node_decision_extractor "https://github.com/drishyaajith10/decody/blob/main/backend/app/ml/decision_extractor.py"
click node_entity_extractor "https://github.com/drishyaajith10/decody/blob/main/backend/app/ml/entity_extractor.py"
click node_export_util "https://github.com/drishyaajith10/decody/blob/main/backend/app/utils/export.py"
click node_readme "https://github.com/drishyaajith10/decody/blob/main/README.md"
click node_overview_doc "https://github.com/drishyaajith10/decody/blob/main/docs/project_overview.md"
click node_sample_docs "https://github.com/drishyaajith10/decody/tree/main/docs/sample"

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_ui_bundle,node_ui_html,node_ui_js,node_ui_css toneBlue
class node_api_main,node_export_util toneAmber
class node_cleaner,node_nlp_core,node_ml_config,node_retriever,node_action_extractor,node_decision_extractor,node_entity_extractor toneMint
class node_readme,node_overview_doc,node_sample_docs toneRose
```

## Components

### Frontend

Thin browser UI served by the backend

- [Browser UI](https://github.com/drishyaajith10/decody/tree/main/backend/app/static): static client · Lightweight HTML/JS/CSS interface for submitting transcripts and viewing results · `backend/app/static`
- [index.html](https://github.com/drishyaajith10/decody/blob/main/backend/app/static/index.html): page · Entry page for the browser interface · `backend/app/static/index.html`
- [script.js](https://github.com/drishyaajith10/decody/blob/main/backend/app/static/script.js): client logic · Browser-side request and rendering logic · `backend/app/static/script.js`
- [style.css](https://github.com/drishyaajith10/decody/blob/main/backend/app/static/style.css): styles · Presentation styling for the static UI · `backend/app/static/style.css`

### API

FastAPI orchestration layer

- [FastAPI app](https://github.com/drishyaajith10/decody/blob/main/backend/app/main.py): api server · Main orchestration boundary exposing analysis, search, and export endpoints · `backend/app/main.py`
- [CSV export](https://github.com/drishyaajith10/decody/blob/main/backend/app/utils/export.py): formatter · Converts structured analysis results into CSV output · `backend/app/utils/export.py`

### Analysis

Transcript cleaning, retrieval, and extraction

- [Cleaner](https://github.com/drishyaajith10/decody/blob/main/backend/app/utils/cleaner.py): preprocess · Normalizes transcripts by removing timestamps, speaker labels, and filler words · `backend/app/utils/cleaner.py`
- [NLP setup](https://github.com/drishyaajith10/decody/blob/main/backend/app/ml/nlp.py): nlp pipeline · Shared spaCy and sentence-processing support · `backend/app/ml/nlp.py`
- [Model config](https://github.com/drishyaajith10/decody/blob/main/backend/app/ml/config.py): settings · Central configuration for NLP and embedding behavior · `backend/app/ml/config.py`
- [Retriever](https://github.com/drishyaajith10/decody/blob/main/backend/app/ml/retriever.py): semantic search · Embeddings and cosine-similarity retrieval for relevant transcript sentences · `backend/app/ml/retriever.py`
- [Actions](https://github.com/drishyaajith10/decody/blob/main/backend/app/ml/action_extractor.py): extractor · Extracts action items with who, what, and when fields · `backend/app/ml/action_extractor.py`
- [Decisions](https://github.com/drishyaajith10/decody/blob/main/backend/app/ml/decision_extractor.py): extractor · Detects decision statements from agreement and approval language · `backend/app/ml/decision_extractor.py`
- [Entities](https://github.com/drishyaajith10/decody/blob/main/backend/app/ml/entity_extractor.py): extractor · Entity-focused parsing support for structured insight generation · `backend/app/ml/entity_extractor.py`

### Support

Documentation and sample material

- [README](https://github.com/drishyaajith10/decody/blob/main/README.md): overview · Project description and endpoint contract · `README.md`
- [Project notes](https://github.com/drishyaajith10/decody/blob/main/docs/project_overview.md): docs · Design and architecture notes · `docs/project_overview.md`
- [Samples](https://github.com/drishyaajith10/decody/tree/main/docs/sample): examples · Example transcripts and expected outputs · `docs/sample`

## Connections

- index.html → script.js: loads · The page loads browser logic
- index.html → style.css: styles · The page uses the stylesheet
- script.js → FastAPI app: calls · Client submits transcript analysis, search, and export requests
- FastAPI app → Cleaner: preprocess · Requests begin by normalizing raw transcript text
- Cleaner → NLP setup: feeds · Clean text flows into sentence and NLP processing
- NLP setup → Model config: configured by · Pipeline behavior is driven by shared model settings
- NLP setup → Retriever: supports · Sentence segmentation and NLP output support retrieval
- Retriever → Actions: routes to · Relevant action-related text is passed to the action extractor
- Retriever → Decisions: routes to · Relevant decision-related text is passed to the decision extractor
- Retriever → Entities: routes to · Relevant text can also be parsed for entities
- Actions → FastAPI app: returns · Structured action items are assembled into the API response
- Decisions → FastAPI app: returns · Structured decisions are assembled into the API response
- Entities → FastAPI app: returns · Entity data is merged into structured output
- FastAPI app → CSV export: exports · Analysis results are formatted as CSV for download or sharing
- FastAPI app → script.js: responds to · Frontend renders the returned structured results
- README → FastAPI app: documents · README describes the available endpoints and pipeline
- Project notes → FastAPI app: documents · Architecture notes explain the backend flow
- Samples → Actions: illustrates · Examples help define expected extraction behavior
