# devfullcycle/mba-ia-desafio-ingestao-busca architecture

> Architecture diagram of the GitHub repository devfullcycle/mba-ia-desafio-ingestao-busca, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/devfullcycle/mba-ia-desafio-ingestao-busca
- Repository: https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca

## Overview

1. **Repository purpose**
   - This is a small Python solution centered on a single document workflow: ingest a PDF, make it searchable, and expose a chat/search experience over that content.

2. **Main application boundary**
   - The core application lives under `src/` and is split into three functional entry points:
     - `ingest.py` for loading and preparing the source material
     - `search.py` for querying indexed content
     - `chat.py` for the interactive user-facing layer

3. **Source data**
   - `document.pdf` is the primary knowledge source in the repository.
   - The architecture likely treats it as the canonical input for ingestion rather than as a runtime dependency fetched from elsewhere.

4. **Ingestion subsystem**
   - `src/ingest.py` is the data-preparation boundary.
   - Its role is to transform the PDF into a form suitable for retrieval, which usually means extracting text and building whatever local or external index the search layer uses.

5. **Retrieval/search subsystem**
   - `src/search.py` is the query boundary between stored knowledge and downstream consumers.
   - It likely encapsulates the logic for finding relevant passages or answers from the ingested content, separating retrieval concerns from the chat interface.

6. **Chat/orchestration subsystem**
   - `src/chat.py` is the interactive coordination layer.
   - It likely accepts user input, calls the search layer, and formats the final response, acting as the main user-facing entry point.

7. **Data flow**
   - The expected flow is:
     - PDF source → ingestion → indexed/searchable representation → search/query execution → chat response.
   - This is a classic “offline preparation + online retrieval” split, which is important for any architecture diagram.

8. **Configuration and environment**
   - `.env.example` indicates the application is configured through environment variables.
   - This usually means secrets, API keys, model settings, or storage connection details are kept out of source control and injected at runtime.

9. **Execution/runtime model**
   - `requirements.txt` shows it is a Python application with explicit dependency management.
   - The repo likely runs as scripts rather than as a large multi-service framework, based on the presence of standalone files under `src/`.

10. **Containerized/local setup**
   - `docker-compose.yml` suggests there is a reproducible local runtime, possibly including supporting infrastructure needed by ingestion/search/chat.
   - Even if the app itself is Python-only, the compose file is an important boundary for local orchestration.

11. **Operational packaging**
   - `README.md` is minimal and only asks for execution instructions, so the repository appears focused on delivering a working solution rather than extensive documentation.
   - `document.pdf` is included in the repo, reinforcing that the solution is self-contained and demo-oriented.

12. **How to draw the architecture**
   - A clear diagram would show three layers:
     - **Input layer:** `document.pdf`
     - **Processing layer:** `ingest.py`
     - **Serving/query layer:** `search.py` and `chat.py`
   - Surround these with environment/configuration from `.env.example` and runtime orchestration via `docker-compose.yml` plus Python dependencies from `requirements.txt`.

Main entry points: [`src/ingest.py`](https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/src/ingest.py) (Ingest), [`src/search.py`](https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/src/search.py) (Search), [`src/chat.py`](https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/src/chat.py) (Chat), [`.env.example`](https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/.env.example) (Env config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_src["src"]
  node_node_ingest["Ingest<br/>pipeline<br/>[ingest.py]"]
  node_node_search["Search<br/>retrieval<br/>[search.py]"]
  node_node_chat["Chat<br/>orchestrator<br/>[chat.py]"]
end

node_node_document["Document<br/>pdf source<br/>[document.pdf]"]
node_node_env["Env config<br/>runtime config<br/>[.env.example]"]
node_node_compose["Compose<br/>local runtime<br/>[docker-compose.yml]"]
node_node_reqs["Python deps<br/>dependency spec<br/>[requirements.txt]"]
node_node_readme["README<br/>usage notes<br/>[README.md]"]

node_node_document -->|"source"| node_node_ingest
node_node_ingest -->|"index"| node_node_search
node_node_search -->|"results"| node_node_chat
node_node_env -.->|"configures"| node_node_ingest
node_node_env -.->|"configures"| node_node_search
node_node_env -.->|"configures"| node_node_chat
node_node_reqs -.->|"supports"| node_node_ingest
node_node_reqs -.->|"supports"| node_node_search
node_node_reqs -.->|"supports"| node_node_chat
node_node_compose -.->|"runs"| node_node_ingest
node_node_compose -.->|"runs"| node_node_search
node_node_compose -.->|"runs"| node_node_chat
node_node_readme -.->|"documents"| node_node_chat

click node_node_document "https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/document.pdf"
click node_node_ingest "https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/src/ingest.py"
click node_node_search "https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/src/search.py"
click node_node_chat "https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/src/chat.py"
click node_node_env "https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/.env.example"
click node_node_compose "https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/docker-compose.yml"
click node_node_reqs "https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/requirements.txt"
click node_node_readme "https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/README.md"

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_node_ingest,node_node_search,node_node_chat toneBlue
class node_node_document,node_node_env,node_node_compose,node_node_reqs,node_node_readme toneNeutral
```

## Components

### src

Application entry points

- [Ingest](https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/src/ingest.py): pipeline · Loads and prepares the PDF for retrieval · `src/ingest.py`
- [Search](https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/src/search.py): retrieval · Queries the indexed content and returns relevant passages · `src/search.py`
- [Chat](https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/src/chat.py): orchestrator · User-facing interaction layer that calls search and formats responses · `src/chat.py`

### Other components

- [Document](https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/document.pdf): pdf source · Canonical knowledge source ingested by the app · `document.pdf`
- [Env config](https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/.env.example): runtime config · Environment variable template for secrets and settings · `.env.example`
- [Compose](https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/docker-compose.yml): local runtime · Containerized local setup and supporting orchestration · `docker-compose.yml`
- [Python deps](https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/requirements.txt): dependency spec · Pinned Python package requirements · `requirements.txt`
- [README](https://github.com/devfullcycle/mba-ia-desafio-ingestao-busca/blob/main/README.md): usage notes · Minimal project instructions · `README.md`

## Connections

- Document → Ingest: source · PDF is the canonical input for ingestion
- Ingest → Search: index · Prepared content becomes searchable representation
- Search → Chat: results · Search results feed the conversational layer
- Env config → Ingest: configures · Runtime settings can affect ingestion behavior
- Env config → Search: configures · Runtime settings can affect retrieval behavior
- Env config → Chat: configures · Runtime settings can affect chat behavior
- Python deps → Ingest: supports · Python dependencies enable the ingestion script
- Python deps → Search: supports · Python dependencies enable the search script
- Python deps → Chat: supports · Python dependencies enable the chat script
- Compose → Ingest: runs · Compose provides a reproducible local execution context
- Compose → Search: runs · Compose provides a reproducible local execution context
- Compose → Chat: runs · Compose provides a reproducible local execution context
- README → Chat: documents · README points to how the solution is executed
