How samirchahar/search_engine works
Argus is an offline document-search application: users add local files, which are validated and extracted into page/chunk text, indexed for keyword and semantic retrieval, then searched and optionally summarized by a local Ollama model. The CLI and desktop UI are separate entry points; both expose search results, while the CLI also reports session metrics. README and sampled code support the main stages and integrations; some UI indexing/search internals were omitted, so those links reflect documented behavior rather than inspected implementation details.
Main entry points: main.py CLI workflow · app.py Desktop search UI · search_engine.py Search orchestration · extractor.py Text extraction
Components 17
User interfaces
- CLI workflow
main.py - Desktop search UI
src/ui/app.py - Ranked results and answer
Document ingestion
- Text extraction
src/extractor/extractor.py - Path and type validation
src/extractor/file_validator.py
Search and ranking
- Search orchestration
src/search/search_engine.py - Positional keyword index
src/indexer/indexer.cpp - Stopword filtering
src/search/stopwords.py - Semantic retrieval
src/search/vector_search.py - Persistent vector store
src/search/vector_search.py - Session metrics
src/search/metrics.py
Answer and local services
- Grounded answer generation
src/search/llm_answer.py
Other components
- User
- Local documents
- Tesseract OCR
- Sentence transformer
- Local Ollama model
Connections 23
- User → CLI workflow: runs queries
- User → Desktop search UI: uses
- CLI workflow → Local documents: selects folder
- Desktop search UI → Local documents: selects files
- CLI workflow → Text extraction: extracts documents
- Desktop search UI → Text extraction: extracts documents
- Text extraction → Path and type validation: validates paths
- Text extraction → Tesseract OCR: recognizes scanned pages
- CLI workflow → Search orchestration: indexes and searches
- Desktop search UI → Search orchestration: indexes and searches
- CLI workflow → Session metrics: records timings
- Desktop search UI → Session metrics: records timings
- Search orchestration → Stopword filtering: filters query terms
- Search orchestration → Positional keyword index: sends index and queries
- Search orchestration → Semantic retrieval: indexes and searches
- Semantic retrieval → Sentence transformer: encodes text
- Semantic retrieval → Persistent vector store: stores and queries vectors
- Search orchestration → Grounded answer generation: provides results
- CLI workflow → Grounded answer generation: requests answer
- Desktop search UI → Grounded answer generation: requests optional summary
- Grounded answer generation → Local Ollama model: sends prompt
- CLI workflow → Ranked results and answer: prints
- Desktop search UI → Ranked results and answer: displays