How samsar/curio works
Curio is a local bookmark archive with hybrid search and an MCP interface for AI agents. The main workflow imports saved links, queues background fetching and indexing, then exposes the resulting library through CLI, dashboard, and MCP search. Separate branches cover topic discovery and related reading, along with setup and daemon management. Some subsystem links are documented or visible in wiring excerpts; unsampled implementation details are not inferred, so uncertain dispatch is shown as unverified.
Main entry points: handlers.go Fetch and index handlers · server.go HTTP API · db.go Library store · import.go Setup and import
Components 21
Import and indexing
- Setup and import
internal/setup/import.go - Bookmark sources
internal/importer/source.go - Fetch and index handlers
internal/jobs/handlers.go - Page fetching
internal/fetcher/native.go - Document indexing
internal/indexer/indexer.go
Daemon and storage
- Job queue
internal/store/sqlite/jobs.go - Job workers
internal/jobs/worker.go - Library store
internal/store/sqlite/db.go - Daemon lifecycle
internal/daemonctl/lifecycle.go - Background service
internal/service/service.go
Search and interfaces
- HTTP API
internal/api/server.go - Search endpoint
internal/api/search.go - Hybrid search
internal/search/search.go - CLI commands
internal/cli/search.go - MCP tools
cmd/curio-mcp/main.go - Local API client
internal/client/client.go - Web dashboard
internal/ui/pages.go
Library insights
- Interest discovery
internal/insight/engine.go - Local model service
internal/ollama/client.go
Other components
- Reader
- AI agent
Connections 25
- Reader → Setup and import: imports links
README.md - Setup and import → Bookmark sources: reads bookmarks
internal/setup/import.go - Setup and import → HTTP API: submits import
internal/setup/import.go - Reader → CLI commands: searches library
README.md - CLI commands → Daemon lifecycle: ensures running
internal/cli/search.go - CLI commands → Local API client: requests search
internal/cli/search.go - Local API client → HTTP API: calls local API
- HTTP API → Search endpoint: routes requests
internal/api/server.go - Search endpoint → Hybrid search: runs search
internal/api/search.go - Hybrid search → Library store: reads library
internal/search/search.go - HTTP API → Job queue: enqueues work
- Job workers → Job queue: claims jobs
internal/jobs/worker.go - Job workers → Fetch and index handlers: dispatches jobs
- Fetch and index handlers → Page fetching: fetches pages
internal/jobs/handlers.go - Fetch and index handlers → Document indexing: indexes documents
internal/jobs/handlers.go - Fetch and index handlers → Library store: writes metadata
internal/jobs/handlers.go - Page fetching → Library store: reads document
- AI agent → MCP tools: asks questions
README.md - MCP tools → Local API client: requests tools
cmd/curio-mcp/main.go - MCP tools → Search endpoint: searches bookmarks
cmd/curio-mcp/main.go - Reader → Web dashboard: views library
README.md - Reader → Interest discovery: explores interests
README.md - Interest discovery → Library store: stores clusters
internal/insight/engine.go - Interest discovery → Local model service: labels topics
- Daemon lifecycle → Background service: manages service
internal/daemonctl/lifecycle.go