DocIngest has two latency-sensitive paths: the web app for humans and the MCP server for agents. The biggest wins usually come from returning less data, keeping Redis warm, and avoiding filesystem scans on hot routes.
GET /api/docs/listreturns metadata only, so/viewdoes not download every markdown file just to render the index.GET /api/docs/domain/:domainacceptstopicandmaxTokens, allowing MCP clients to fetch scoped docs instead of the full markdown blob.- The MCP server applies request timeouts, clamps large responses, and caches repeated API calls in-process.
- The MCP package includes a CLI mode for quick testing without setting up an editor.
The recommended agent flow is:
find-docsto resolve a library name to a domain.read-docswithtopicandmaxTokenswhen the agent needs focused context.query-docswhen the agent needs cross-library examples or snippets.
Useful environment variables:
DOCINGEST_API_URL=https://docingest.com/api
DOCINGEST_TIMEOUT_MS=10000
DOCINGEST_CACHE_TTL_MS=300000Redis is the recommended self-hosted search/cache layer. The included docker-compose.yml runs Redis locally on host port 6380:
docker compose up -d redis
cd server
npm run build-indexUse REDIS_HOST, REDIS_PORT, and optionally REDIS_PASSWORD to point the backend at local, remote, or production Redis. See Redis setup for the full guide.
If you want the full local crawl/search stack, start the Firecrawl Compose profile instead:
docker compose --profile firecrawl up -dFor every local run mode, see Docker run modes.
- Keep Redis enabled in production and rebuild the search index after new crawls with
npm run build-indexfromserver/. - Cache
GET /api/docs/domain/:domainresponses in Redis with ETags, keyed by domain, version, topic, and token limit. - Replace filesystem scans on list/search fallback paths with a small generated manifest of domains and metadata.
- Add a domain-level search endpoint so agents can ask for matching sections inside one docs site instead of reading large files.
- Lazy-load heavy frontend markdown/rendering dependencies on docs pages, especially syntax highlighting.
- Virtualize long docs pages and large result lists so the browser only renders visible content.
- Add CDN or reverse-proxy caching for stable read-only endpoints such as docs metadata, screenshots, and MCP package docs.
- Confirm
/api/docs/fast-searchreturnssource: "redis"for common searches. - Confirm
/api/docs/liststays metadata-only and does not include raw markdown content. - Check browser Web Vitals on
/viewand/docs/:domainafter large corpus imports. - Track API response sizes for
/api/docs/domain/:domain; large responses usually mean callers should passtopicormaxTokens.