# sowndharya617/shl-assessment-recommender architecture

> Architecture diagram of the GitHub repository sowndharya617/shl-assessment-recommender, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sowndharya617/shl-assessment-recommender
- Repository: https://github.com/sowndharya617/shl-assessment-recommender

## Overview

This is a stateless conversational recommender for SHL individual assessments. A recruiter sends the conversation history to the chat API; the API builds context, applies prompt-injection and topic checks, then routes comparison requests to catalog comparison or other queries through clarification or intent extraction and ranked recommendations. Responses are schema-validated and grounded in the local catalog. The README also describes a demo frontend. Source excerpts show API-to-module calls and catalog access; the frontend file was not sampled, so its interaction details are limited to the API’s documented CORS setup.

Main entry points: [`app/main.py`](https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/main.py) (Chat API), [`app/recommender.py`](https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/recommender.py) (Recommendation and comparison), [`app/conversation.py`](https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/conversation.py) (Conversation context and intent), [`index.html`](https://github.com/sowndharya617/shl-assessment-recommender/blob/main/index.html) (Demo chatbot frontend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and contracts"]
  node_chat_api["Chat API<br/>[main.py]"]
  node_schemas["Request and response schemas<br/>[schemas.py]"]
  node_demo["Demo chatbot frontend<br/>[index.html]"]
end

subgraph group_conversation["Conversation and safeguards"]
  node_context["Conversation context and intent<br/>[conversation.py]"]
  node_guardrails["Input and result guardrails<br/>[guardrails.py]"]
end

subgraph group_catalog["Catalog and matching"]
  node_recommendations["Recommendation and comparison<br/>[recommender.py]"]
  node_catalog_loader["Catalog loader and lookups<br/>[catalog_loader.py]"]
  node_catalog_data[("SHL assessment catalog<br/>[shl_catalog.json]")]
end

node_recruiter(("Recruiter"))

node_recruiter -->|"submits history"| node_chat_api
node_chat_api -->|"validates payloads"| node_schemas
node_chat_api -->|"builds context"| node_context
node_chat_api -->|"checks input"| node_guardrails
node_chat_api -->|"routes conversation"| node_context
node_chat_api -->|"requests comparison"| node_recommendations
node_chat_api -->|"extracts intent"| node_context
node_chat_api -->|"retrieves matches"| node_recommendations
node_recommendations -->|"reads catalog"| node_catalog_loader
node_recommendations -->|"validates results"| node_guardrails
node_catalog_loader -->|"loads JSON"| node_catalog_data
node_chat_api -->|"returns response"| node_schemas
node_demo -->|"calls API"| node_chat_api
node_chat_api -->|"serves frontend"| node_demo
node_chat_api -->|"returns reply"| node_recruiter

click node_chat_api "https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/main.py"
click node_schemas "https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/schemas.py"
click node_context "https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/conversation.py"
click node_guardrails "https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/guardrails.py"
click node_recommendations "https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/recommender.py"
click node_catalog_loader "https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/catalog_loader.py"
click node_catalog_data "https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/data/shl_catalog.json"
click node_demo "https://github.com/sowndharya617/shl-assessment-recommender/blob/main/index.html"

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_chat_api,node_schemas,node_demo toneBlue
class node_context,node_guardrails toneAmber
class node_recommendations,node_catalog_loader,node_catalog_data toneMint
class node_recruiter toneIndigo
```

## Components

### API and contracts

- [Chat API](https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/main.py): `app/main.py`
- [Request and response schemas](https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/schemas.py): `app/schemas.py`
- [Demo chatbot frontend](https://github.com/sowndharya617/shl-assessment-recommender/blob/main/index.html): `index.html`

### Conversation and safeguards

- [Conversation context and intent](https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/conversation.py): `app/conversation.py`
- [Input and result guardrails](https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/guardrails.py): `app/guardrails.py`

### Catalog and matching

- [Recommendation and comparison](https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/recommender.py): `app/recommender.py`
- [Catalog loader and lookups](https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/catalog_loader.py): `app/catalog_loader.py`
- [SHL assessment catalog](https://github.com/sowndharya617/shl-assessment-recommender/blob/main/app/data/shl_catalog.json): `app/data/shl_catalog.json`

### Other components

- **Recruiter**

## Connections

- Recruiter → Chat API: submits history (evidence: `README.md`)
- Chat API → Request and response schemas: validates payloads (evidence: `app/main.py`)
- Chat API → Conversation context and intent: builds context (evidence: `app/main.py`)
- Chat API → Input and result guardrails: checks input (evidence: `app/main.py`)
- Chat API → Conversation context and intent: routes conversation (evidence: `app/main.py`)
- Chat API → Recommendation and comparison: requests comparison (evidence: `app/main.py`)
- Chat API → Conversation context and intent: extracts intent (evidence: `app/main.py`)
- Chat API → Recommendation and comparison: retrieves matches (evidence: `app/main.py`)
- Recommendation and comparison → Catalog loader and lookups: reads catalog (evidence: `app/recommender.py`)
- Recommendation and comparison → Input and result guardrails: validates results (evidence: `app/recommender.py`)
- Catalog loader and lookups → SHL assessment catalog: loads JSON (evidence: `app/catalog_loader.py`)
- Chat API → Request and response schemas: returns response (evidence: `app/main.py`)
- Demo chatbot frontend → Chat API: calls API (evidence: `app/main.py`)
- Chat API → Demo chatbot frontend: serves frontend (evidence: `app/main.py`)
- Chat API → Recruiter: returns reply (evidence: `README.md`)
