# horacech/information-retrieval-tool architecture

> Architecture diagram of the GitHub repository horacech/information-retrieval-tool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/horacech/information-retrieval-tool
- Repository: https://github.com/horacech/information-retrieval-tool

## Overview

AI Retrieval Tool is a client-side research-search strategy builder, not a literature database or crawler. A researcher enters a topic in the workspace, selects a database and template, and the app asks a chosen model to expand concepts and draft Boolean and field-specific queries. The user can compare outputs, inspect query structure, edit and copy a strategy, then run it on an external database. The README documents additional guidance, offline URL lookup, voice input, history, analytics, and refinement tracking. Some component links are evidenced only by the App import index; unsampled internals are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/horacech/information-retrieval-tool/blob/main/src/App.tsx) (Search Workspace), [`src/services/speech/speechService.ts`](https://github.com/horacech/information-retrieval-tool/blob/main/src/services/speech/speechService.ts) (Speech Service), [`src/services/gemini.ts`](https://github.com/horacech/information-retrieval-tool/blob/main/src/services/gemini.ts) (Model Requests), [`src/components/OfficialWhitelist.tsx`](https://github.com/horacech/information-retrieval-tool/blob/main/src/components/OfficialWhitelist.tsx) (Official URL Lookup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace UI"]
  node_app["Search Workspace<br/>[App.tsx]"]
  node_overview["Project Overview"]
end

subgraph group_generation["Query Generation"]
  node_model["Model Requests<br/>[gemini.ts]"]
  node_templates_data["Template Presets<br/>[searchTemplates.ts]"]
  node_template_ui["Template Library"]
  node_speech_ui["Audio Transcriber"]
  node_speech_service["Speech Service<br/>[speechService.ts]"]
  node_speech_providers["Speech Provider Rules"]
end

subgraph group_review["Review and History"]
  node_query_highlight["Query Highlighting"]
  node_syntax_validator["Syntax Validation"]
  node_query_tree["Query Tree"]
  node_comparison["Model Comparison"]
  node_trajectory["Refinement Trajectory"]
  node_feedback["Feedback Analytics"]
  node_metrics["Performance Metrics"]
end

subgraph group_resources["Search Resources"]
  node_official_sites["Official URL Lookup"]
  node_pinyin["Pinyin Matching<br/>[pinyinMatcher.ts]"]
  node_offline_export["Offline URL Export"]
end

node_researcher(("Researcher"))
node_model_provider(("Model Provider"))
node_speech_proxy(("Speech Proxy"))
node_browser_storage[("Browser Storage")]
node_external_database(("Target Database"))

node_researcher -->|"enters topic"| node_app
node_app -->|"requests query"| node_model
node_model -->|"sends request"| node_model_provider
node_app -->|"loads presets"| node_templates_data
node_app -->|"renders library"| node_template_ui
node_app -->|"renders input"| node_speech_ui
node_speech_ui -->|"transcribes audio"| node_speech_service
node_speech_service -->|"selects provider"| node_speech_providers
node_speech_service -->|"uses Gemini"| node_model
node_speech_service -->|"posts audio"| node_speech_proxy
node_app -->|"renders query"| node_query_highlight
node_app -->|"checks structure"| node_syntax_validator
node_app -->|"renders logic"| node_query_tree
node_app -->|"renders comparison"| node_comparison
node_app -->|"renders history"| node_trajectory
node_app -->|"renders analytics"| node_feedback
node_app -->|"renders metrics"| node_metrics
node_app -->|"renders overview"| node_overview
node_app -->|"stores local data"| node_browser_storage
node_app -->|"opens lookup"| node_official_sites
node_official_sites -->|"scores matches"| node_pinyin
node_app -->|"offers export"| node_offline_export
node_offline_export -->|"uses URL directory"| node_official_sites
node_researcher -->|"runs copied query"| node_external_database

click node_app "https://github.com/horacech/information-retrieval-tool/blob/main/src/App.tsx"
click node_overview "https://github.com/horacech/information-retrieval-tool/blob/main/src/components/ProjectOverview.tsx"
click node_model "https://github.com/horacech/information-retrieval-tool/blob/main/src/services/gemini.ts"
click node_templates_data "https://github.com/horacech/information-retrieval-tool/blob/main/src/data/searchTemplates.ts"
click node_template_ui "https://github.com/horacech/information-retrieval-tool/blob/main/src/components/TemplateLibrary.tsx"
click node_speech_ui "https://github.com/horacech/information-retrieval-tool/blob/main/src/components/AudioTranscriber.tsx"
click node_speech_service "https://github.com/horacech/information-retrieval-tool/blob/main/src/services/speech/speechService.ts"
click node_speech_providers "https://github.com/horacech/information-retrieval-tool/blob/main/src/services/speech/speechProviders.mjs"
click node_query_highlight "https://github.com/horacech/information-retrieval-tool/blob/main/src/components/HighlightedBooleanQuery.tsx"
click node_syntax_validator "https://github.com/horacech/information-retrieval-tool/blob/main/src/utils/booleanSyntaxValidator.ts"
click node_query_tree "https://github.com/horacech/information-retrieval-tool/blob/main/src/components/VisualQueryTree.tsx"
click node_comparison "https://github.com/horacech/information-retrieval-tool/blob/main/src/components/ComparisonKeywordChart.tsx"
click node_trajectory "https://github.com/horacech/information-retrieval-tool/blob/main/src/components/OptimizationTrajectoryViewer.tsx"
click node_feedback "https://github.com/horacech/information-retrieval-tool/blob/main/src/components/FeedbackAnalytics.tsx"
click node_metrics "https://github.com/horacech/information-retrieval-tool/blob/main/src/components/PerformanceMetricsPanel.tsx"
click node_official_sites "https://github.com/horacech/information-retrieval-tool/blob/main/src/components/OfficialWhitelist.tsx"
click node_pinyin "https://github.com/horacech/information-retrieval-tool/blob/main/src/utils/pinyinMatcher.ts"
click node_offline_export "https://github.com/horacech/information-retrieval-tool/blob/main/src/components/OfflineDownloader.tsx"

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_overview toneBlue
class node_model,node_templates_data,node_template_ui,node_speech_ui,node_speech_service,node_speech_providers,node_browser_storage,node_external_database toneAmber
class node_query_highlight,node_syntax_validator,node_query_tree,node_comparison,node_trajectory,node_feedback,node_metrics toneMint
class node_official_sites,node_pinyin,node_offline_export toneRose
class node_researcher,node_model_provider,node_speech_proxy toneIndigo
```

## Components

### Workspace UI

- [Search Workspace](https://github.com/horacech/information-retrieval-tool/blob/main/src/App.tsx): `src/App.tsx`
- [Project Overview](https://github.com/horacech/information-retrieval-tool/blob/main/src/components/ProjectOverview.tsx): `src/components/ProjectOverview.tsx`

### Query Generation

- [Model Requests](https://github.com/horacech/information-retrieval-tool/blob/main/src/services/gemini.ts): `src/services/gemini.ts`
- [Template Presets](https://github.com/horacech/information-retrieval-tool/blob/main/src/data/searchTemplates.ts): `src/data/searchTemplates.ts`
- [Template Library](https://github.com/horacech/information-retrieval-tool/blob/main/src/components/TemplateLibrary.tsx): `src/components/TemplateLibrary.tsx`
- [Audio Transcriber](https://github.com/horacech/information-retrieval-tool/blob/main/src/components/AudioTranscriber.tsx): `src/components/AudioTranscriber.tsx`
- [Speech Service](https://github.com/horacech/information-retrieval-tool/blob/main/src/services/speech/speechService.ts): `src/services/speech/speechService.ts`
- [Speech Provider Rules](https://github.com/horacech/information-retrieval-tool/blob/main/src/services/speech/speechProviders.mjs): `src/services/speech/speechProviders.mjs`

### Review and History

- [Query Highlighting](https://github.com/horacech/information-retrieval-tool/blob/main/src/components/HighlightedBooleanQuery.tsx): `src/components/HighlightedBooleanQuery.tsx`
- [Syntax Validation](https://github.com/horacech/information-retrieval-tool/blob/main/src/utils/booleanSyntaxValidator.ts): `src/utils/booleanSyntaxValidator.ts`
- [Query Tree](https://github.com/horacech/information-retrieval-tool/blob/main/src/components/VisualQueryTree.tsx): `src/components/VisualQueryTree.tsx`
- [Model Comparison](https://github.com/horacech/information-retrieval-tool/blob/main/src/components/ComparisonKeywordChart.tsx): `src/components/ComparisonKeywordChart.tsx`
- [Refinement Trajectory](https://github.com/horacech/information-retrieval-tool/blob/main/src/components/OptimizationTrajectoryViewer.tsx): `src/components/OptimizationTrajectoryViewer.tsx`
- [Feedback Analytics](https://github.com/horacech/information-retrieval-tool/blob/main/src/components/FeedbackAnalytics.tsx): `src/components/FeedbackAnalytics.tsx`
- [Performance Metrics](https://github.com/horacech/information-retrieval-tool/blob/main/src/components/PerformanceMetricsPanel.tsx): `src/components/PerformanceMetricsPanel.tsx`

### Search Resources

- [Official URL Lookup](https://github.com/horacech/information-retrieval-tool/blob/main/src/components/OfficialWhitelist.tsx): `src/components/OfficialWhitelist.tsx`
- [Pinyin Matching](https://github.com/horacech/information-retrieval-tool/blob/main/src/utils/pinyinMatcher.ts): `src/utils/pinyinMatcher.ts`
- [Offline URL Export](https://github.com/horacech/information-retrieval-tool/blob/main/src/components/OfflineDownloader.tsx): `src/components/OfflineDownloader.tsx`

### Other components

- **Researcher**
- **Model Provider**
- **Speech Proxy**
- **Browser Storage**
- **Target Database**

## Connections

- Researcher → Search Workspace: enters topic (evidence: `README.md`)
- Search Workspace → Model Requests: requests query (evidence: `src/App.tsx`)
- Model Requests → Model Provider: sends request (evidence: `README.md`)
- Search Workspace → Template Presets: loads presets (evidence: `src/App.tsx`)
- Search Workspace → Template Library: renders library (evidence: `src/App.tsx`)
- Search Workspace → Audio Transcriber: renders input (evidence: `src/App.tsx`)
- Audio Transcriber → Speech Service: transcribes audio (evidence: `src/components/AudioTranscriber.tsx`)
- Speech Service → Speech Provider Rules: selects provider (evidence: `src/services/speech/speechService.ts`)
- Speech Service → Model Requests: uses Gemini (evidence: `src/services/speech/speechService.ts`)
- Speech Service → Speech Proxy: posts audio (evidence: `src/services/speech/speechService.ts`)
- Search Workspace → Query Highlighting: renders query (evidence: `src/App.tsx`)
- Search Workspace → Syntax Validation: checks structure (evidence: `src/App.tsx`)
- Search Workspace → Query Tree: renders logic (evidence: `src/App.tsx`)
- Search Workspace → Model Comparison: renders comparison (evidence: `src/App.tsx`)
- Search Workspace → Refinement Trajectory: renders history (evidence: `src/App.tsx`)
- Search Workspace → Feedback Analytics: renders analytics (evidence: `src/App.tsx`)
- Search Workspace → Performance Metrics: renders metrics (evidence: `src/App.tsx`)
- Search Workspace → Project Overview: renders overview (evidence: `src/App.tsx`)
- Search Workspace → Browser Storage: stores local data (evidence: `README.md`)
- Search Workspace → Official URL Lookup: opens lookup (evidence: `src/App.tsx`)
- Official URL Lookup → Pinyin Matching: scores matches (evidence: `src/components/OfficialWhitelist.tsx`)
- Search Workspace → Offline URL Export: offers export (evidence: `src/App.tsx`)
- Offline URL Export → Official URL Lookup: uses URL directory (evidence: `src/components/OfflineDownloader.tsx`)
- Researcher → Target Database: runs copied query (evidence: `README.md`)
