# rajsingh18110/blend architecture

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

- Interactive diagram: https://gitdiagram.com/rajsingh18110/blend
- Repository: https://github.com/rajsingh18110/blend

## Overview

Blend Engine is a privacy-focused metasearch web application. Its main flow serves the browser UI, accepts a category search through the Flask API, routes the query to providers, and ranks/processes results for the response. The README also documents Navar assistant features, autocomplete, news and media workflows, and a compatibility search core. Edges reflect the README or shown source references; unsampled implementations are represented conservatively, without assuming undocumented calls.

Main entry points: [`src/blend/app.py`](https://github.com/rajsingh18110/blend/blob/main/src/blend/app.py) (Flask app and API), [`src/blend/blend_engine/search_router.py`](https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_engine/search_router.py) (Search router), [`src/blend/blend_core`](https://github.com/rajsingh18110/blend/tree/main/src/blend/blend_core) (Compatibility search core), [`src/blend/blend_engine/provider_manager.py`](https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_engine/provider_manager.py) (Provider selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask app and API<br/>[app.py]"]
  node_ui["Browser UI"]
  node_cache[("Response cache<br/>[app.py]")]
  node_news["News RSS search<br/>[app.py]"]
  node_autocomplete["Autocomplete<br/>[autocomplete.py]"]
end

subgraph group_search["Search orchestration"]
  node_router["Search router<br/>[search_router.py]"]
  node_manager["Provider selection"]
  node_providers["External providers"]
  node_ranking["Result ranking<br/>[ranking_engine.py]"]
  node_processing["Result processing"]
  node_crawl["Page crawling"]
end

subgraph group_assistant["Navar assistant"]
  node_navar["Navar assistant<br/>[navar.py]"]
  node_knowledge["Built-in knowledge<br/>[navar_knowledge.py]"]
  node_media["Media helpers<br/>[ytdl_downloader.py]"]
end

subgraph group_compat["Search compatibility"]
  node_core["Compatibility search core"]
  node_query["Query parsing<br/>[query.py]"]
  node_sources["Search source adapters"]
  node_pipeline["Result pipeline"]
  node_models["Result models<br/>[models.py]"]
end

node_user(("Search user"))

node_user -->|"searches"| node_ui
node_ui -->|"calls search API"| node_app
node_app -->|"routes query"| node_router
node_app -->|"checks cache"| node_cache
node_app -->|"stores response"| node_cache
node_app -->|"serves news"| node_news
node_ui -.->|"requests suggestions"| node_autocomplete
node_router -->|"selects providers"| node_manager
node_manager -->|"dispatches searches"| node_providers
node_manager -->|"checks engine categories"| node_sources
node_router -->|"ranks results"| node_ranking
node_router -->|"processes results"| node_processing
node_router -->|"crawls results"| node_crawl
node_ui -.->|"requests assistant"| node_navar
node_navar -.->|"uses knowledge base"| node_knowledge
node_ui -.->|"requests media helpers"| node_media
node_core -.->|"parses queries"| node_query
node_core -.->|"provides adapters"| node_sources
node_core -.->|"processes results"| node_pipeline
node_pipeline -.->|"uses result models"| node_models

click node_app "https://github.com/rajsingh18110/blend/blob/main/src/blend/app.py"
click node_cache "https://github.com/rajsingh18110/blend/blob/main/src/blend/app.py"
click node_news "https://github.com/rajsingh18110/blend/blob/main/src/blend/app.py"
click node_autocomplete "https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_core/autocomplete.py"
click node_router "https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_engine/search_router.py"
click node_manager "https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_engine/provider_manager.py"
click node_providers "https://github.com/rajsingh18110/blend/tree/main/src/blend/providers"
click node_ranking "https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_engine/ranking_engine.py"
click node_processing "https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_engine/result_processor.py"
click node_crawl "https://github.com/rajsingh18110/blend/blob/main/src/blend/scrapers/crawl4ai_wrapper.py"
click node_navar "https://github.com/rajsingh18110/blend/blob/main/src/blend/navar.py"
click node_knowledge "https://github.com/rajsingh18110/blend/blob/main/src/blend/navar_knowledge.py"
click node_media "https://github.com/rajsingh18110/blend/blob/main/src/blend/ytdl_downloader.py"
click node_core "https://github.com/rajsingh18110/blend/tree/main/src/blend/blend_core"
click node_query "https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_core/query.py"
click node_sources "https://github.com/rajsingh18110/blend/tree/main/src/blend/blend_core/sources"
click node_pipeline "https://github.com/rajsingh18110/blend/tree/main/src/blend/blend_core/pipeline"
click node_models "https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_core/pipeline/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_app,node_ui,node_cache,node_news,node_autocomplete,node_user toneBlue
class node_router,node_manager,node_providers,node_ranking,node_processing,node_crawl toneAmber
class node_navar,node_knowledge,node_media toneMint
class node_core,node_query,node_sources,node_pipeline,node_models toneRose
```

## Components

### Web application

- [Flask app and API](https://github.com/rajsingh18110/blend/blob/main/src/blend/app.py): `src/blend/app.py`
- **Browser UI**
- [Response cache](https://github.com/rajsingh18110/blend/blob/main/src/blend/app.py): `src/blend/app.py`
- [News RSS search](https://github.com/rajsingh18110/blend/blob/main/src/blend/app.py): `src/blend/app.py`
- [Autocomplete](https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_core/autocomplete.py): `src/blend/blend_core/autocomplete.py`

### Search orchestration

- [Search router](https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_engine/search_router.py): `src/blend/blend_engine/search_router.py`
- [Provider selection](https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_engine/provider_manager.py): `src/blend/blend_engine/provider_manager.py`
- [External providers](https://github.com/rajsingh18110/blend/tree/main/src/blend/providers): `src/blend/providers`
- [Result ranking](https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_engine/ranking_engine.py): `src/blend/blend_engine/ranking_engine.py`
- [Result processing](https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_engine/result_processor.py): `src/blend/blend_engine/result_processor.py`
- [Page crawling](https://github.com/rajsingh18110/blend/blob/main/src/blend/scrapers/crawl4ai_wrapper.py): `src/blend/scrapers/crawl4ai_wrapper.py`

### Navar assistant

- [Navar assistant](https://github.com/rajsingh18110/blend/blob/main/src/blend/navar.py): `src/blend/navar.py`
- [Built-in knowledge](https://github.com/rajsingh18110/blend/blob/main/src/blend/navar_knowledge.py): `src/blend/navar_knowledge.py`
- [Media helpers](https://github.com/rajsingh18110/blend/blob/main/src/blend/ytdl_downloader.py): `src/blend/ytdl_downloader.py`

### Search compatibility

- [Compatibility search core](https://github.com/rajsingh18110/blend/tree/main/src/blend/blend_core): `src/blend/blend_core`
- [Query parsing](https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_core/query.py): `src/blend/blend_core/query.py`
- [Search source adapters](https://github.com/rajsingh18110/blend/tree/main/src/blend/blend_core/sources): `src/blend/blend_core/sources`
- [Result pipeline](https://github.com/rajsingh18110/blend/tree/main/src/blend/blend_core/pipeline): `src/blend/blend_core/pipeline`
- [Result models](https://github.com/rajsingh18110/blend/blob/main/src/blend/blend_core/pipeline/models.py): `src/blend/blend_core/pipeline/models.py`

### Other components

- **Search user**

## Connections

- Search user → Browser UI: searches (evidence: `README.md`)
- Browser UI → Flask app and API: calls search API (evidence: `README.md`)
- Flask app and API → Search router: routes query (evidence: `src/blend/app.py`)
- Flask app and API → Response cache: checks cache (evidence: `src/blend/app.py`)
- Flask app and API → Response cache: stores response (evidence: `src/blend/app.py`)
- Flask app and API → News RSS search: serves news (evidence: `README.md`)
- Browser UI → Autocomplete: requests suggestions (evidence: `README.md`)
- Search router → Provider selection: selects providers (evidence: `src/blend/blend_engine/search_router.py`)
- Provider selection → External providers: dispatches searches (evidence: `src/blend/blend_engine/provider_manager.py`)
- Provider selection → Search source adapters: checks engine categories (evidence: `src/blend/blend_engine/provider_manager.py`)
- Search router → Result ranking: ranks results (evidence: `src/blend/blend_engine/search_router.py`)
- Search router → Result processing: processes results (evidence: `src/blend/blend_engine/search_router.py`)
- Search router → Page crawling: crawls results (evidence: `src/blend/blend_engine/search_router.py`)
- Browser UI → Navar assistant: requests assistant (evidence: `README.md`)
- Navar assistant → Built-in knowledge: uses knowledge base (evidence: `README.md`)
- Browser UI → Media helpers: requests media helpers (evidence: `README.md`)
- Compatibility search core → Query parsing: parses queries (evidence: `src/blend/blend_core/query.py`)
- Compatibility search core → Search source adapters: provides adapters (evidence: `src/blend/blend_core/sources/blend_engine.py`)
- Compatibility search core → Result pipeline: processes results (evidence: `src/blend/blend_core/query.py`)
- Result pipeline → Result models: uses result models
