How tinysuitehq/tinysearch works
TinySearch is a local web-retrieval service for agents: clients discover sources, fetch or interact with pages, and receive token-bounded original passages with source URLs. MCP and FastAPI adapt requests to the transport-neutral core; the core owns search and scrape operations. Scraping renders pages, applies URL safety and extraction, then ranks/chunks evidence. The README documents browser tools and datetime as additional MCP capabilities. Relationships shown from source are cited; some subsystem links rely on README capability descriptions because their implementations were not excerpted.
Main entry points: scrape.py Scrape pipeline · core.py Core operations · mcp_server.py MCP server · fastapi_server.py FastAPI server
Components 25
Client interfaces
- MCP server
src/tinysearch/servers/mcp_server.py - FastAPI server
src/tinysearch/servers/fastapi_server.py - CLI
src/tinysearch/cli.py - Core operations
src/tinysearch/core.py
Web retrieval
- Web search
src/tinysearch/services/web_search_service.py - URL safety
src/tinysearch/services/url_safety_service.py - Page crawler
src/tinysearch/services/site_crawl_service.py - Direct scraping
src/tinysearch/services/scrape_service.py - Browser tools
src/tinysearch/services/browser_tool_service.py
Evidence processing
- Scrape pipeline
src/tinysearch/pipelines/scrape.py - Link extraction
src/tinysearch/services/link_extraction_service.py - Text chunking
src/tinysearch/services/text_chunking_service.py - Token budgeting
src/tinysearch/services/token_counter_service.py - Local embeddings
src/tinysearch/services/embedding_service.py - Hybrid ranking
src/tinysearch/services/hybrid_embed_search_service.py - Evidence results
src/tinysearch/results.py - Grounded prompts
src/tinysearch/services/grounded_prompt_service.py
Runtime support
- Public config
src/tinysearch/config.py - Server config
src/tinysearch/services/tinysearch_config_service.py - Current datetime
src/tinysearch/services/current_datetime_service.py - Telemetry
src/tinysearch/telemetry.py - ONNX bundle
src/tinysearch/services/onnx_bundle_service.py
Other components
- AI agent
- Search backend
- Web pages
Connections 27
- AI agent → MCP server: requests tools
README.md - AI agent → FastAPI server: sends requests
README.md - MCP server → Core operations: dispatches operations
src/tinysearch/servers/mcp_server.py - FastAPI server → Core operations: dispatches operations
src/tinysearch/servers/fastapi_server.py - CLI → MCP server: launches server
src/tinysearch/cli.py - Core operations → Public config: resolves settings
src/tinysearch/core.py - Core operations → Web search: searches
src/tinysearch/core.py - Web search → Search backend: queries backend
- Core operations → Scrape pipeline: runs retrieval
src/tinysearch/core.py - Scrape pipeline → URL safety: validates URLs
src/tinysearch/pipelines/scrape.py - Scrape pipeline → Page crawler: fetches pages
src/tinysearch/pipelines/scrape.py - Page crawler → Web pages: renders pages
- Scrape pipeline → Link extraction: extracts links
src/tinysearch/pipelines/scrape.py - Scrape pipeline → Text chunking: chunks text
src/tinysearch/pipelines/scrape.py - Scrape pipeline → Token budgeting: budgets evidence
src/tinysearch/pipelines/scrape.py - Scrape pipeline → Local embeddings: embeds passages
src/tinysearch/pipelines/scrape.py - Scrape pipeline → Hybrid ranking: ranks passages
src/tinysearch/pipelines/scrape.py - Core operations → Direct scraping: scrapes URLs
src/tinysearch/core.py - Scrape pipeline → Evidence results: returns evidence
- MCP server → Browser tools: exposes browser tools
src/tinysearch/servers/mcp_server.py - MCP server → Current datetime: exposes datetime tool
README.md - MCP server → Server config: loads server settings
src/tinysearch/servers/mcp_server.py - Server config → Public config: overrides config
src/tinysearch/services/tinysearch_config_service.py - Core operations → ONNX bundle: prepares model bundle
src/tinysearch/core.py - Local embeddings → ONNX bundle: uses model bundle
src/tinysearch/services/onnx_bundle_service.py - Core operations → Telemetry: records operations
src/tinysearch/core.py - Scrape pipeline → Grounded prompts: builds grounded prompts