# mubashranoor04/ai-powered-hr-recruitment- architecture

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

- Interactive diagram: https://gitdiagram.com/mubashranoor04/ai-powered-hr-recruitment-
- Repository: https://github.com/mubashranoor04/ai-powered-hr-recruitment-

## Overview

This is a FastAPI-backed HR recruitment RAG platform with a Streamlit frontend. Recruiters authenticate, organize documents in rooms, upload files for extraction and embedding, then ask room-scoped questions and receive grounded answers with source citations; chat history is retained. The graph separates API orchestration, identity and workspace management, ingestion, retrieval/generation, and persistence. Source excerpts establish most backend calls; the frontend connection and unsampled formats are included only where README documentation supports them.

Main entry points: [`app/db/database.py`](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/db/database.py) (SQLAlchemy sessions), [`app/main.py`](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/main.py) (FastAPI app), [`app/routers/upload.py`](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/routers/upload.py) (Upload endpoint), [`app/services/auth.py`](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/services/auth.py) (JWT and passwords)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API orchestration"]
  node_frontend["Streamlit frontend<br/>[streamlit_app.py]"]
  node_fastapi["FastAPI app<br/>[main.py]"]
end

subgraph group_workspace["Identity and rooms"]
  node_auth_routes["Auth endpoints<br/>[auth.py]"]
  node_auth_service["JWT and passwords<br/>[auth.py]"]
  node_room_routes["Room endpoints<br/>[rooms.py]"]
end

subgraph group_ingestion["Document ingestion"]
  node_upload_route["Upload endpoint<br/>[upload.py]"]
  node_extractors["Format extractors"]
  node_embedder["Chunk and embed<br/>[embedder.py]"]
end

subgraph group_rag["Retrieval and answers"]
  node_vector_store[("Qdrant vectors")]
  node_chat_route["Chat endpoints<br/>[chat.py]"]
  node_rag_service["RAG service<br/>[rag.py]"]
  node_groq{{"Groq LLM"}}
end

subgraph group_storage["Persistence"]
  node_db_session["SQLAlchemy sessions<br/>[database.py]"]
  node_models["Domain records<br/>[models.py]"]
  node_sqlite[("Relational database")]
end

node_recruiter(("Recruiter"))

node_recruiter -.->|"uses"| node_frontend
node_frontend -.->|"calls API"| node_fastapi
node_fastapi -->|"registers routes"| node_auth_routes
node_fastapi -->|"registers routes"| node_room_routes
node_fastapi -->|"registers routes"| node_upload_route
node_fastapi -->|"registers routes"| node_chat_route
node_auth_routes -->|"hashes and signs"| node_auth_service
node_room_routes -->|"checks identity"| node_auth_service
node_upload_route -->|"checks identity"| node_auth_service
node_chat_route -->|"checks identity"| node_auth_service
node_auth_routes -->|"queries session"| node_db_session
node_room_routes -->|"queries session"| node_db_session
node_upload_route -->|"records files"| node_db_session
node_chat_route -->|"stores history"| node_db_session
node_auth_service -->|"looks up users"| node_db_session
node_db_session -->|"maps records"| node_models
node_db_session -.->|"connects"| node_sqlite
node_upload_route -->|"dispatches formats"| node_extractors
node_upload_route -->|"chunks and stores"| node_embedder
node_embedder -->|"upserts vectors"| node_vector_store
node_chat_route -->|"requests answer"| node_rag_service
node_rag_service -->|"encodes query"| node_embedder
node_rag_service -->|"retrieves chunks"| node_vector_store
node_rag_service -->|"generates response"| node_groq

click node_frontend "https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/streamlit_app.py"
click node_fastapi "https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/main.py"
click node_auth_routes "https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/routers/auth.py"
click node_auth_service "https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/services/auth.py"
click node_room_routes "https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/routers/rooms.py"
click node_upload_route "https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/routers/upload.py"
click node_extractors "https://github.com/mubashranoor04/ai-powered-hr-recruitment-/tree/main/app/services/ingestion"
click node_embedder "https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/services/embedder.py"
click node_chat_route "https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/routers/chat.py"
click node_rag_service "https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/services/rag.py"
click node_db_session "https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/db/database.py"
click node_models "https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/db/models.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_frontend,node_fastapi toneBlue
class node_auth_routes,node_auth_service,node_room_routes toneAmber
class node_upload_route,node_extractors,node_embedder toneMint
class node_vector_store,node_chat_route,node_rag_service,node_groq toneRose
class node_db_session,node_models,node_sqlite,node_recruiter toneIndigo
```

## Components

### API orchestration

- [Streamlit frontend](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/streamlit_app.py): `streamlit_app.py`
- [FastAPI app](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/main.py): `app/main.py`

### Identity and rooms

- [Auth endpoints](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/routers/auth.py): `app/routers/auth.py`
- [JWT and passwords](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/services/auth.py): `app/services/auth.py`
- [Room endpoints](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/routers/rooms.py): `app/routers/rooms.py`

### Document ingestion

- [Upload endpoint](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/routers/upload.py): `app/routers/upload.py`
- [Format extractors](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/tree/main/app/services/ingestion): `app/services/ingestion`
- [Chunk and embed](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/services/embedder.py): `app/services/embedder.py`

### Retrieval and answers

- **Qdrant vectors**
- [Chat endpoints](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/routers/chat.py): `app/routers/chat.py`
- [RAG service](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/services/rag.py): `app/services/rag.py`
- **Groq LLM**

### Persistence

- [SQLAlchemy sessions](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/db/database.py): `app/db/database.py`
- [Domain records](https://github.com/mubashranoor04/ai-powered-hr-recruitment-/blob/main/app/db/models.py): `app/db/models.py`
- **Relational database**

### Other components

- **Recruiter**

## Connections

- Recruiter → Streamlit frontend: uses (evidence: `README.md`)
- Streamlit frontend → FastAPI app: calls API (evidence: `README.md`)
- FastAPI app → Auth endpoints: registers routes (evidence: `app/main.py`)
- FastAPI app → Room endpoints: registers routes (evidence: `app/main.py`)
- FastAPI app → Upload endpoint: registers routes (evidence: `app/main.py`)
- FastAPI app → Chat endpoints: registers routes (evidence: `app/main.py`)
- Auth endpoints → JWT and passwords: hashes and signs (evidence: `app/routers/auth.py`)
- Room endpoints → JWT and passwords: checks identity (evidence: `app/routers/rooms.py`)
- Upload endpoint → JWT and passwords: checks identity (evidence: `app/routers/upload.py`)
- Chat endpoints → JWT and passwords: checks identity (evidence: `app/routers/chat.py`)
- Auth endpoints → SQLAlchemy sessions: queries session (evidence: `app/routers/auth.py`)
- Room endpoints → SQLAlchemy sessions: queries session (evidence: `app/routers/rooms.py`)
- Upload endpoint → SQLAlchemy sessions: records files (evidence: `app/routers/upload.py`)
- Chat endpoints → SQLAlchemy sessions: stores history (evidence: `app/routers/chat.py`)
- JWT and passwords → SQLAlchemy sessions: looks up users (evidence: `app/services/auth.py`)
- SQLAlchemy sessions → Domain records: maps records (evidence: `app/db/models.py`)
- SQLAlchemy sessions → Relational database: connects (evidence: `README.md`)
- Upload endpoint → Format extractors: dispatches formats (evidence: `app/routers/upload.py`)
- Upload endpoint → Chunk and embed: chunks and stores (evidence: `app/routers/upload.py`)
- Chunk and embed → Qdrant vectors: upserts vectors (evidence: `app/services/embedder.py`)
- Chat endpoints → RAG service: requests answer (evidence: `app/routers/chat.py`)
- RAG service → Chunk and embed: encodes query (evidence: `app/services/rag.py`)
- RAG service → Qdrant vectors: retrieves chunks (evidence: `app/services/rag.py`)
- RAG service → Groq LLM: generates response (evidence: `app/services/rag.py`)
