# doniadithya07/intelli-file architecture

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

- Interactive diagram: https://gitdiagram.com/doniadithya07/intelli-file
- Repository: https://github.com/doniadithya07/intelli-file

## Overview

IntelliFile is an offline Windows desktop file-search and question-answering product. A user searches or asks from the desktop UI; the local Python API routes the request to text, metadata, or visual retrieval and returns results or cited answers. Separately, selected folders are scanned and watched, files are extracted into passages, and keyword and vector indexes are maintained. Activity-based ranking and Windows Recent import are additional capabilities. The README documents these flows; several subsystem links below use enclosing paths because their implementation was not sampled.

Main entry points: [`backend/app/search/service.py`](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/search/service.py) (Text search), [`backend/app/indexing/indexer.py`](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/indexing/indexer.py) (Indexing service), [`backend/app/main.py`](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/main.py) (Local API), [`backend/app/agent/loop.py`](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/agent/loop.py) (Question answering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop experience"]
  node_desktop_app["Desktop app<br/>[App.tsx]"]
  node_search_ui["Search and pages<br/>[SearchPage.tsx]"]
  node_voice_ui["Voice capture<br/>[useVoice.ts]"]
  node_api_client["Backend client<br/>[backend.ts]"]
end

subgraph group_indexing["File indexing"]
  node_file_watch["Folder watch<br/>[service.py]"]
  node_indexer["Indexing service<br/>[indexer.py]"]
  node_extractors["Content extraction<br/>[extractor.py]"]
  node_chunker["Passage chunking<br/>[chunker.py]"]
  node_embedder["Text embeddings<br/>[model.py]"]
  node_visual_indexer["Visual indexing<br/>[visual_indexer.py]"]
end

subgraph group_retrieval["Search and retrieval"]
  node_backend_api["Local API<br/>[main.py]"]
  node_search_service["Text search<br/>[service.py]"]
  node_query_parser["Query parsing<br/>[query_parsing.py]"]
  node_router["Search routing<br/>[router.py]"]
  node_visual_search["Photo and video search<br/>[service.py]"]
end

subgraph group_assistant["Assistant and memory"]
  node_agent["Question answering<br/>[loop.py]"]
  node_local_llm["Local language model<br/>[llm.py]"]
  node_activity["Activity and profile<br/>[profile.py]"]
end

subgraph group_storage["Local persistence"]
  node_keyword_store[("Keyword index<br/>[keyword_store.py]")]
  node_vector_store[("Vector index<br/>[lancedb_store.py]")]
  node_record_store[("File records<br/>[sqlite_store.py]")]
end

node_user(("User"))
node_filesystem["Selected files"]
node_windows_recent["Windows Recent items"]

node_user -->|"uses"| node_desktop_app
node_desktop_app -->|"renders"| node_search_ui
node_search_ui -->|"requests search"| node_api_client
node_voice_ui -->|"sends recording"| node_api_client
node_api_client -->|"HTTP requests"| node_backend_api
node_backend_api -->|"dispatches search"| node_search_service
node_backend_api -->|"dispatches visual query"| node_visual_search
node_backend_api -->|"dispatches question"| node_agent
node_backend_api -->|"manages folders"| node_file_watch
node_backend_api -->|"serves activity"| node_activity
node_file_watch -->|"scans and watches"| node_filesystem
node_file_watch -->|"queues file jobs"| node_indexer
node_indexer -->|"extracts content"| node_extractors
node_indexer -->|"chunks content"| node_chunker
node_indexer -->|"embeds passages"| node_embedder
node_indexer -->|"writes terms"| node_keyword_store
node_indexer -->|"writes vectors"| node_vector_store
node_indexer -->|"updates records"| node_record_store
node_visual_indexer -->|"writes visual vectors"| node_vector_store
node_search_service -->|"parses query"| node_query_parser
node_search_service -->|"selects tier"| node_router
node_search_service -->|"retrieves terms"| node_keyword_store
node_search_service -->|"retrieves vectors"| node_vector_store
node_search_service -->|"reads file metadata"| node_record_store
node_visual_search -->|"retrieves visual matches"| node_vector_store
node_visual_search -->|"reads file records"| node_record_store
node_agent -->|"retrieves passages"| node_search_service
node_agent -->|"generates answer"| node_local_llm
node_agent -->|"checks cited files"| node_record_store
node_search_service -->|"personalizes ranking"| node_activity
node_windows_recent -.->|"seeds activity"| node_activity

click node_desktop_app "https://github.com/doniadithya07/intelli-file/blob/main/desktop/src/App.tsx"
click node_search_ui "https://github.com/doniadithya07/intelli-file/blob/main/desktop/src/pages/SearchPage.tsx"
click node_voice_ui "https://github.com/doniadithya07/intelli-file/blob/main/desktop/src/hooks/useVoice.ts"
click node_api_client "https://github.com/doniadithya07/intelli-file/blob/main/desktop/src/backend.ts"
click node_backend_api "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/main.py"
click node_file_watch "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/files/service.py"
click node_indexer "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/indexing/indexer.py"
click node_extractors "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/extraction/extractor.py"
click node_chunker "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/chunking/chunker.py"
click node_embedder "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/embeddings/model.py"
click node_visual_indexer "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/indexing/visual_indexer.py"
click node_search_service "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/search/service.py"
click node_query_parser "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/search/query_parsing.py"
click node_router "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/search/router.py"
click node_visual_search "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/visual_search/service.py"
click node_agent "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/agent/loop.py"
click node_local_llm "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/agent/llm.py"
click node_activity "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/context/profile.py"
click node_keyword_store "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/storage/keyword_store.py"
click node_vector_store "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/storage/lancedb_store.py"
click node_record_store "https://github.com/doniadithya07/intelli-file/blob/main/backend/app/storage/sqlite_store.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_app,node_search_ui,node_voice_ui,node_api_client,node_user toneBlue
class node_file_watch,node_indexer,node_extractors,node_chunker,node_embedder,node_visual_indexer toneAmber
class node_backend_api,node_search_service,node_query_parser,node_router,node_visual_search toneMint
class node_agent,node_local_llm,node_activity toneRose
class node_keyword_store,node_vector_store,node_record_store,node_filesystem,node_windows_recent toneIndigo
```

## Components

### Desktop experience

- [Desktop app](https://github.com/doniadithya07/intelli-file/blob/main/desktop/src/App.tsx): `desktop/src/App.tsx`
- [Search and pages](https://github.com/doniadithya07/intelli-file/blob/main/desktop/src/pages/SearchPage.tsx): `desktop/src/pages/SearchPage.tsx`
- [Voice capture](https://github.com/doniadithya07/intelli-file/blob/main/desktop/src/hooks/useVoice.ts): `desktop/src/hooks/useVoice.ts`
- [Backend client](https://github.com/doniadithya07/intelli-file/blob/main/desktop/src/backend.ts): `desktop/src/backend.ts`

### File indexing

- [Folder watch](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/files/service.py): `backend/app/files/service.py`
- [Indexing service](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/indexing/indexer.py): `backend/app/indexing/indexer.py`
- [Content extraction](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/extraction/extractor.py): `backend/app/extraction/extractor.py`
- [Passage chunking](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/chunking/chunker.py): `backend/app/chunking/chunker.py`
- [Text embeddings](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/embeddings/model.py): `backend/app/embeddings/model.py`
- [Visual indexing](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/indexing/visual_indexer.py): `backend/app/indexing/visual_indexer.py`

### Search and retrieval

- [Local API](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/main.py): `backend/app/main.py`
- [Text search](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/search/service.py): `backend/app/search/service.py`
- [Query parsing](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/search/query_parsing.py): `backend/app/search/query_parsing.py`
- [Search routing](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/search/router.py): `backend/app/search/router.py`
- [Photo and video search](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/visual_search/service.py): `backend/app/visual_search/service.py`

### Assistant and memory

- [Question answering](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/agent/loop.py): `backend/app/agent/loop.py`
- [Local language model](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/agent/llm.py): `backend/app/agent/llm.py`
- [Activity and profile](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/context/profile.py): `backend/app/context/profile.py`

### Local persistence

- [Keyword index](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/storage/keyword_store.py): `backend/app/storage/keyword_store.py`
- [Vector index](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/storage/lancedb_store.py): `backend/app/storage/lancedb_store.py`
- [File records](https://github.com/doniadithya07/intelli-file/blob/main/backend/app/storage/sqlite_store.py): `backend/app/storage/sqlite_store.py`

### Other components

- **User**
- **Selected files**
- **Windows Recent items**

## Connections

- User → Desktop app: uses
- Desktop app → Search and pages: renders
- Search and pages → Backend client: requests search
- Voice capture → Backend client: sends recording
- Backend client → Local API: HTTP requests
- Local API → Text search: dispatches search
- Local API → Photo and video search: dispatches visual query
- Local API → Question answering: dispatches question
- Local API → Folder watch: manages folders
- Local API → Activity and profile: serves activity
- Folder watch → Selected files: scans and watches
- Folder watch → Indexing service: queues file jobs
- Indexing service → Content extraction: extracts content
- Indexing service → Passage chunking: chunks content
- Indexing service → Text embeddings: embeds passages
- Indexing service → Keyword index: writes terms
- Indexing service → Vector index: writes vectors
- Indexing service → File records: updates records
- Visual indexing → Vector index: writes visual vectors
- Text search → Query parsing: parses query
- Text search → Search routing: selects tier
- Text search → Keyword index: retrieves terms
- Text search → Vector index: retrieves vectors
- Text search → File records: reads file metadata
- Photo and video search → Vector index: retrieves visual matches
- Photo and video search → File records: reads file records
- Question answering → Text search: retrieves passages
- Question answering → Local language model: generates answer
- Question answering → File records: checks cited files
- Text search → Activity and profile: personalizes ranking
- Windows Recent items → Activity and profile: seeds activity
