# aevorine/synorive architecture

> Architecture diagram of the GitHub repository aevorine/synorive, 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/aevorine/synorive
- Repository: https://github.com/aevorine/synorive

## Overview

Synorive combines a local-first desktop library search engine with a web-research workbench; Android, CLI, and MCP are additional clients of the shared Python engine. The main workflow is to ingest local files, extract and index their content, retrieve and rank matches, then show source-linked results or quoted answers. A separate web workflow searches multiple providers and supports verification, counter-evidence, scholarly research, and briefings. The graph follows documented capabilities and sampled call boundaries; some engine internals and client wiring are unsampled, so uncertain links are omitted.

Main entry points: [`engine/synorive/api/routes.py`](https://github.com/aevorine/synorive/blob/main/engine/synorive/api/routes.py) (HTTP API), [`engine/synorive/websearch/research.py`](https://github.com/aevorine/synorive/blob/main/engine/synorive/websearch/research.py) (Research workflow), [`engine/synorive/ingest/pipeline.py`](https://github.com/aevorine/synorive/blob/main/engine/synorive/ingest/pipeline.py) (Ingest pipeline), [`engine/synorive/store/repository.py`](https://github.com/aevorine/synorive/blob/main/engine/synorive/store/repository.py) (Library repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User clients"]
  node_desktop["Desktop app<br/>[App.tsx]"]
  node_desktop_api["Desktop API client<br/>[api.ts]"]
  node_mobile["Android client"]
  node_mcp["MCP tools<br/>[index.ts]"]
  node_cli["CLI<br/>[index.ts]"]
end

subgraph group_engine["Local engine"]
  node_engine_host["Engine host<br/>[main.py]"]
  node_api["HTTP API<br/>[routes.py]"]
end

subgraph group_library["Library search"]
  node_ingest["Ingest pipeline<br/>[pipeline.py]"]
  node_analyze["Content analysis"]
  node_repository["Library repository<br/>[repository.py]"]
  node_database[("Local database<br/>[db.py]")]
  node_search["Hybrid search<br/>[engine.py]"]
  node_ask["Quoted answers<br/>[ask.py]"]
end

subgraph group_research["Web research"]
  node_web_research["Research workflow<br/>[research.py]"]
  node_web_engines["Search adapters<br/>[engines.py]"]
  node_evidence["Evidence checking<br/>[verify.py]"]
  node_briefing["Quoted briefings<br/>[briefing.py]"]
end

subgraph group_integrations["External access"]
  node_web(("Web providers"))
  node_files(("Local files"))
end

node_user(("User"))

node_user -->|"uses"| node_desktop
node_user -->|"uses"| node_mobile
node_user -->|"invokes"| node_mcp
node_user -->|"invokes"| node_cli
node_desktop -->|"requests"| node_desktop_api
node_desktop_api -->|"calls"| node_api
node_mobile -->|"calls"| node_api
node_mcp -->|"calls"| node_api
node_cli -->|"calls"| node_api
node_engine_host -->|"serves"| node_api
node_files -->|"supplies"| node_ingest
node_api -->|"dispatches"| node_ingest
node_ingest -->|"extracts and enriches"| node_analyze
node_ingest -->|"writes index"| node_repository
node_repository -->|"reads and writes"| node_database
node_api -->|"dispatches"| node_search
node_search -->|"retrieves candidates"| node_repository
node_api -->|"dispatches"| node_ask
node_ask -->|"retrieves passages"| node_search
node_api -->|"dispatches"| node_web_research
node_web_research -->|"queries providers"| node_web_engines
node_web_engines -->|"requests"| node_web
node_web_research -->|"checks claims"| node_evidence
node_web_research -->|"builds briefing"| node_briefing
node_api -->|"dispatches"| node_evidence

click node_desktop "https://github.com/aevorine/synorive/blob/main/apps/desktop/src/App.tsx"
click node_desktop_api "https://github.com/aevorine/synorive/blob/main/apps/desktop/src/lib/api.ts"
click node_mcp "https://github.com/aevorine/synorive/blob/main/mcp/src/index.ts"
click node_cli "https://github.com/aevorine/synorive/blob/main/cli/src/index.ts"
click node_engine_host "https://github.com/aevorine/synorive/blob/main/engine/synorive/main.py"
click node_api "https://github.com/aevorine/synorive/blob/main/engine/synorive/api/routes.py"
click node_ingest "https://github.com/aevorine/synorive/blob/main/engine/synorive/ingest/pipeline.py"
click node_analyze "https://github.com/aevorine/synorive/tree/main/engine/synorive/analyze"
click node_repository "https://github.com/aevorine/synorive/blob/main/engine/synorive/store/repository.py"
click node_database "https://github.com/aevorine/synorive/blob/main/engine/synorive/store/db.py"
click node_search "https://github.com/aevorine/synorive/blob/main/engine/synorive/search/engine.py"
click node_ask "https://github.com/aevorine/synorive/blob/main/engine/synorive/search/ask.py"
click node_web_research "https://github.com/aevorine/synorive/blob/main/engine/synorive/websearch/research.py"
click node_web_engines "https://github.com/aevorine/synorive/blob/main/engine/synorive/websearch/engines.py"
click node_evidence "https://github.com/aevorine/synorive/blob/main/engine/synorive/websearch/verify.py"
click node_briefing "https://github.com/aevorine/synorive/blob/main/engine/synorive/briefing.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_desktop,node_desktop_api,node_mobile,node_mcp,node_cli,node_user toneBlue
class node_engine_host,node_api toneAmber
class node_ingest,node_analyze,node_repository,node_database,node_search,node_ask toneMint
class node_web_research,node_web_engines,node_evidence,node_briefing toneRose
class node_web,node_files toneIndigo
```

## Components

### User clients

- [Desktop app](https://github.com/aevorine/synorive/blob/main/apps/desktop/src/App.tsx): `apps/desktop/src/App.tsx`
- [Desktop API client](https://github.com/aevorine/synorive/blob/main/apps/desktop/src/lib/api.ts): `apps/desktop/src/lib/api.ts`
- **Android client**
- [MCP tools](https://github.com/aevorine/synorive/blob/main/mcp/src/index.ts): `mcp/src/index.ts`
- [CLI](https://github.com/aevorine/synorive/blob/main/cli/src/index.ts): `cli/src/index.ts`

### Local engine

- [Engine host](https://github.com/aevorine/synorive/blob/main/engine/synorive/main.py): `engine/synorive/main.py`
- [HTTP API](https://github.com/aevorine/synorive/blob/main/engine/synorive/api/routes.py): `engine/synorive/api/routes.py`

### Library search

- [Ingest pipeline](https://github.com/aevorine/synorive/blob/main/engine/synorive/ingest/pipeline.py): `engine/synorive/ingest/pipeline.py`
- [Content analysis](https://github.com/aevorine/synorive/tree/main/engine/synorive/analyze): `engine/synorive/analyze`
- [Library repository](https://github.com/aevorine/synorive/blob/main/engine/synorive/store/repository.py): `engine/synorive/store/repository.py`
- [Local database](https://github.com/aevorine/synorive/blob/main/engine/synorive/store/db.py): `engine/synorive/store/db.py`
- [Hybrid search](https://github.com/aevorine/synorive/blob/main/engine/synorive/search/engine.py): `engine/synorive/search/engine.py`
- [Quoted answers](https://github.com/aevorine/synorive/blob/main/engine/synorive/search/ask.py): `engine/synorive/search/ask.py`

### Web research

- [Research workflow](https://github.com/aevorine/synorive/blob/main/engine/synorive/websearch/research.py): `engine/synorive/websearch/research.py`
- [Search adapters](https://github.com/aevorine/synorive/blob/main/engine/synorive/websearch/engines.py): `engine/synorive/websearch/engines.py`
- [Evidence checking](https://github.com/aevorine/synorive/blob/main/engine/synorive/websearch/verify.py): `engine/synorive/websearch/verify.py`
- [Quoted briefings](https://github.com/aevorine/synorive/blob/main/engine/synorive/briefing.py): `engine/synorive/briefing.py`

### External access

- **Web providers**
- **Local files**

### Other components

- **User**

## Connections

- User → Desktop app: uses
- User → Android client: uses
- User → MCP tools: invokes
- User → CLI: invokes
- Desktop app → Desktop API client: requests
- Desktop API client → HTTP API: calls
- Android client → HTTP API: calls
- MCP tools → HTTP API: calls
- CLI → HTTP API: calls
- Engine host → HTTP API: serves
- Local files → Ingest pipeline: supplies
- HTTP API → Ingest pipeline: dispatches
- Ingest pipeline → Content analysis: extracts and enriches
- Ingest pipeline → Library repository: writes index
- Library repository → Local database: reads and writes
- HTTP API → Hybrid search: dispatches
- Hybrid search → Library repository: retrieves candidates
- HTTP API → Quoted answers: dispatches
- Quoted answers → Hybrid search: retrieves passages
- HTTP API → Research workflow: dispatches
- Research workflow → Search adapters: queries providers
- Search adapters → Web providers: requests
- Research workflow → Evidence checking: checks claims
- Research workflow → Quoted briefings: builds briefing
- HTTP API → Evidence checking: dispatches
