# kashish1530/evaluation_project architecture

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

- Interactive diagram: https://gitdiagram.com/kashish1530/evaluation_project
- Repository: https://github.com/kashish1530/evaluation_project

## Overview

This is an evaluation-driven HR policy question-answering system: a user question is checked for prohibited requests and policy exceptions, otherwise matched to a mock policy document and returned with safeguards. The v5 pipeline adds PII redaction and audit logging around the earlier retrieval pipeline; retrieval uses local TF-IDF/cosine ranking and stemming. Exception requests are filed for human review rather than answered automatically. The tree and sampled source support these main paths, but do not show how the CLI connects to the pipeline or how human reviewers process approvals.

Main entry points: [`pipeline_v5.py`](https://github.com/kashish1530/evaluation_project/blob/main/pipeline_v5.py) (Answer pipeline v5), [`pipeline_v3.py`](https://github.com/kashish1530/evaluation_project/blob/main/pipeline_v3.py) (Retrieval pipeline v3), [`retrieval_v3.py`](https://github.com/kashish1530/evaluation_project/blob/main/retrieval_v3.py) (TF-IDF retrieval), [`approval.py`](https://github.com/kashish1530/evaluation_project/blob/main/approval.py) (Exception approval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_answering["Answer pipeline"]
  node_v5["Answer pipeline v5<br/>[pipeline_v5.py]"]
  node_v3["Retrieval pipeline v3<br/>[pipeline_v3.py]"]
end

subgraph group_retrieval["Policy retrieval"]
  node_retriever["TF-IDF retrieval<br/>[retrieval_v3.py]"]
  node_stemmer["Token stemming<br/>[stemmer.py]"]
end

subgraph group_governance["Safety and governance"]
  node_router["Refusal router<br/>[router.py]"]
  node_approval["Exception approval<br/>[approval.py]"]
  node_redaction["PII redaction<br/>[redaction.py]"]
  node_audit["Interaction audit<br/>[audit_log.py]"]
end

subgraph group_state["Policy and records"]
  node_docs["Mock HR policies<br/>[mock_hr_docs.py]"]
  node_pending[("Pending approvals")]
  node_auditfile[("Audit records<br/>[audit_log.jsonl]")]
end

node_user(("Questioner"))
node_reviewer(("Human reviewer"))

node_user -->|"asks"| node_v5
node_v5 -->|"checks refusal"| node_router
node_v5 -->|"checks exception"| node_approval
node_v5 -->|"runs normal path"| node_v3
node_v5 -->|"redacts answer"| node_redaction
node_v5 -->|"logs interaction"| node_audit
node_v3 -->|"checks refusal"| node_router
node_v3 -->|"retrieves policy"| node_retriever
node_retriever -->|"stems tokens"| node_stemmer
node_retriever -->|"ranks documents"| node_docs
node_approval -->|"files request"| node_pending
node_reviewer -.->|"reviews requests"| node_pending
node_audit -->|"appends records"| node_auditfile
node_v5 -->|"returns response"| node_user

click node_v5 "https://github.com/kashish1530/evaluation_project/blob/main/pipeline_v5.py"
click node_v3 "https://github.com/kashish1530/evaluation_project/blob/main/pipeline_v3.py"
click node_router "https://github.com/kashish1530/evaluation_project/blob/main/router.py"
click node_approval "https://github.com/kashish1530/evaluation_project/blob/main/approval.py"
click node_redaction "https://github.com/kashish1530/evaluation_project/blob/main/redaction.py"
click node_audit "https://github.com/kashish1530/evaluation_project/blob/main/audit_log.py"
click node_retriever "https://github.com/kashish1530/evaluation_project/blob/main/retrieval_v3.py"
click node_stemmer "https://github.com/kashish1530/evaluation_project/blob/main/stemmer.py"
click node_docs "https://github.com/kashish1530/evaluation_project/blob/main/mock_hr_docs.py"
click node_pending "https://github.com/kashish1530/evaluation_project/blob/main/pending_approvals.jsonl"
click node_auditfile "https://github.com/kashish1530/evaluation_project/blob/main/audit_log.jsonl"

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_v5,node_v3,node_reviewer toneBlue
class node_retriever,node_stemmer toneAmber
class node_router,node_approval,node_redaction,node_audit toneMint
class node_docs,node_pending,node_auditfile toneRose
class node_user toneIndigo
```

## Components

### Answer pipeline

- [Answer pipeline v5](https://github.com/kashish1530/evaluation_project/blob/main/pipeline_v5.py): `pipeline_v5.py`
- [Retrieval pipeline v3](https://github.com/kashish1530/evaluation_project/blob/main/pipeline_v3.py): `pipeline_v3.py`

### Policy retrieval

- [TF-IDF retrieval](https://github.com/kashish1530/evaluation_project/blob/main/retrieval_v3.py): `retrieval_v3.py`
- [Token stemming](https://github.com/kashish1530/evaluation_project/blob/main/stemmer.py): `stemmer.py`

### Safety and governance

- [Refusal router](https://github.com/kashish1530/evaluation_project/blob/main/router.py): `router.py`
- [Exception approval](https://github.com/kashish1530/evaluation_project/blob/main/approval.py): `approval.py`
- [PII redaction](https://github.com/kashish1530/evaluation_project/blob/main/redaction.py): `redaction.py`
- [Interaction audit](https://github.com/kashish1530/evaluation_project/blob/main/audit_log.py): `audit_log.py`

### Policy and records

- [Mock HR policies](https://github.com/kashish1530/evaluation_project/blob/main/mock_hr_docs.py): `mock_hr_docs.py`
- [Pending approvals](https://github.com/kashish1530/evaluation_project/blob/main/pending_approvals.jsonl): `pending_approvals.jsonl`
- [Audit records](https://github.com/kashish1530/evaluation_project/blob/main/audit_log.jsonl): `audit_log.jsonl`

### Other components

- **Questioner**
- **Human reviewer**

## Connections

- Questioner → Answer pipeline v5: asks
- Answer pipeline v5 → Refusal router: checks refusal
- Answer pipeline v5 → Exception approval: checks exception
- Answer pipeline v5 → Retrieval pipeline v3: runs normal path
- Answer pipeline v5 → PII redaction: redacts answer
- Answer pipeline v5 → Interaction audit: logs interaction
- Retrieval pipeline v3 → Refusal router: checks refusal
- Retrieval pipeline v3 → TF-IDF retrieval: retrieves policy
- TF-IDF retrieval → Token stemming: stems tokens
- TF-IDF retrieval → Mock HR policies: ranks documents
- Exception approval → Pending approvals: files request
- Human reviewer → Pending approvals: reviews requests
- Interaction audit → Audit records: appends records
- Answer pipeline v5 → Questioner: returns response
