How gwerr1002/deepsearch works
Deep Search is a local, iterative research assistant: it analyzes a research task, generates and runs successive web queries, assesses candidate sources and evidence, then synthesizes a cited answer. The main orchestration and several stages are visible in partial excerpts; other stage boundaries are inferred from the documented prompt roles and workflow method names. Source opening is represented through the available web-fetch tool, though its exact invocation is not visible in the excerpt.
Main entry points: agent.py Workflow orchestrator · ollama.py Ollama client · syspromt.py Research prompts · tools.py Web tools
Components 21
Research workflow
- CLI entry
app/main.py - Workflow orchestrator
app/agent/agent.py - Task analysis
app/agent/agent.py - Query generation
app/agent/agent.py - Search iteration
app/agent/agent.py - Source selection
app/agent/agent.py - Evidence evaluation
app/agent/agent.py - Source opening
app/agent/agent.py - Answer synthesis
app/agent/agent.py
Web retrieval
- Web tools
app/agent/tools.py - Search adapter
app/search/searxng.py - Page and PDF fetch
app/search/web.py
Model and configuration
- Ollama client
app/llm/ollama.py - Research prompts
app/config/syspromt.py - Runtime settings
app/config/config.py
Internal support
- Keyword scoring
app/search/scoring.py - Token utilities
app/llm/tokens.py
Other components
- Research task
- Ollama service
- SearXNG service
- Web sources
Connections 31
- Research task → CLI entry: provides task
- CLI entry → Workflow orchestrator: starts
- Workflow orchestrator → Task analysis: dispatches
- Workflow orchestrator → Query generation: dispatches
- Workflow orchestrator → Search iteration: dispatches
- Workflow orchestrator → Source selection: dispatches
- Workflow orchestrator → Evidence evaluation: dispatches
- Workflow orchestrator → Source opening: dispatches
- Workflow orchestrator → Answer synthesis: dispatches
- Task analysis → Ollama client: requests analysis
- Query generation → Ollama client: requests query
- Source selection → Ollama client: evaluates results
- Evidence evaluation → Ollama client: evaluates evidence
- Answer synthesis → Ollama client: requests synthesis
- Search iteration → Web tools: searches query
- Web tools → Search adapter: calls search
- Search adapter → SearXNG service: requests results
- SearXNG service → Search adapter: returns results
- Search iteration → Keyword scoring: scores results
- Source opening → Web tools: opens sources
- Web tools → Page and PDF fetch: fetches page
- Page and PDF fetch → Web sources: requests content
- Ollama client → Ollama service: sends chat
- Ollama service → Ollama client: returns response
- Task analysis → Runtime settings: reads task settings
- Query generation → Research prompts: uses query prompt
- Task analysis → Research prompts: uses analysis prompt
- Source selection → Research prompts: uses evaluator prompt
- Evidence evaluation → Research prompts: uses evidence prompt
- Answer synthesis → Research prompts: uses answer prompt
- Workflow orchestrator → Token utilities: counts tokens