# kishore-klassy/askdocu architecture

> Architecture diagram of the GitHub repository kishore-klassy/askdocu, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kishore-klassy/askdocu
- Repository: https://github.com/kishore-klassy/askdocu

## Overview

##### Project type and purpose
- askDocu is a Python-based document-centric QA chatbot tool. It ingests or crawls documents, builds a vector index, and answers user queries by retrieving relevant passages and synthesizing answers (likely via an external LLM API).

##### File structure
- Top-level scripts:
- chatbot_app.py – entry point for running the chat interface or web server
- qa_agent.py – orchestrates query handling and module interactions
- data/ – persistent storage of:
- docs.npy (serialized document embeddings or raw docs)
- vector.index (the vector-search index)
- modules/ – core functional components:
- crawler.py (document ingestion pipeline)
- vector_store.py (wraps index loading, searching, saving)
- qa_engine.py (retrieval + LLM prompt engineering)
- Requirements & docs: requirements.txt, LOW_LEVEL_DOCUMENTATION.md

##### README for additional insights
- README is minimal; refer to LOW_LEVEL_DOCUMENTATION.md for detailed component descriptions and data schema.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface
    UI["User Interface\n(CLI/Web UI)"]:::internal
    QA["QA Agent\n(Orchestrator)"]:::internal
    subgraph "Backend Modules"
        direction TB
        CRAWLER["Crawler Module"]:::internal
        VSTORE["Vector Store Module"]:::internal
        QAE["QA Engine Module"]:::internal
    end
    %% Data Storage
    EMB["Document Embeddings\n(docs.npy)"]:::storage
    IDX["Vector Index\n(vector.index)"]:::storage
    %% External
    LLM["External LLM API"]:::external
    REQ["requirements.txt"]:::doc
    DOCS["LOW_LEVEL_DOCUMENTATION.md"]:::doc

    %% Ingestion Phase
    UI -->|"trigger crawl"| CRAWLER
    CRAWLER -->|"docs → embeddings"| EMB
    CRAWLER -->|"save index"| IDX
    CRAWLER --> VSTORE

    %% Query Phase
    UI -->|"user query"| QA
    QA -->|"query → top-k docs"| VSTORE
    VSTORE -->|"returns docs"| QA
    QA --> QAE
    QAE -->|"LLM prompt"| LLM
    LLM -->|"response"| QAE
    QAE -->|"answer"| QA
    QA -->|"display answer"| UI

    %% Documentation & Requirements
    QA --> REQ
    QA --> DOCS

    %% Click Events
    click UI "https://github.com/kishore-klassy/askdocu/blob/main/chatbot_app.py"
    click QA "https://github.com/kishore-klassy/askdocu/blob/main/qa_agent.py"
    click CRAWLER "https://github.com/kishore-klassy/askdocu/blob/main/modules/crawler.py"
    click VSTORE "https://github.com/kishore-klassy/askdocu/blob/main/modules/vector_store.py"
    click EMB "https://github.com/kishore-klassy/askdocu/blob/main/data/docs.npy"
    click IDX "https://github.com/kishore-klassy/askdocu/blob/main/data/vector.index"
    click QAE "https://github.com/kishore-klassy/askdocu/blob/main/modules/qa_engine.py"
    click REQ "https://github.com/kishore-klassy/askdocu/blob/main/requirements.txt"
    click DOCS "https://github.com/kishore-klassy/askdocu/blob/main/LOW_LEVEL_DOCUMENTATION.md"

    %% Styles
    classDef internal fill:#ccffcc,stroke:#2d572c,stroke-width:2px;
    classDef storage fill:#cce5ff,stroke:#23527c,stroke-width:2px,shape:cylinder;
    classDef external fill:#ffe5cc,stroke:#d65900,stroke-width:2px;
    classDef doc fill:#f7f7f9,stroke:#ccc,stroke-width:1px;
```
