Edge Routing
Requests to api.captain.dev now connect at an edge location near the caller and travel a private backbone to Captain. The public endpoint, authentication, and request format are unchanged: same endpoint, same keys, nothing to migrate.
Why it matters
Global networking is part of taking a RAG pipeline from a local prototype to production. A search index can respond quickly while users far from the server still wait for connection setup. Measuring the full request from the caller’s location makes that overhead visible.
A DIY RAG pipeline needs to account for connection reuse, routing, and the operational work of serving users across regions. Captain handles the edge connection and onward routing without requiring a separate search deployment in every caller’s region. Edge Routing changes the network path; it does not replicate the search index to each edge location.
When an integration opens a fresh HTTPS connection for a query, connection setup adds network round trips. The TLS handshake on that connection used to cross the public internet end-to-end. With edge routing, the handshake terminates at the nearest edge location, and the request travels to Captain over a private backbone.
The improvement is largest for callers far from the origin region. Median Query Time on fresh connection · 100 samples / city:
When it does not help
Connection reuse (HTTP keep-alive) already skips the handshake. A long-lived client that reuses connections avoids repeated connection setup, so the fresh-connection results should not be applied to every query on that connection. The benefit depends on connection reuse and the caller’s network path.
Verifying the route
A query response includes a cf-ray header from the edge. Its suffix is the IATA airport code of the edge location that handled the connection (for example, ...SIN for Singapore, ...GRU for São Paulo). Seeing a code near the caller confirms the request was terminated at the edge.
Related
- Query Latency for the full query processing waterfall.
- Changelog: Edge Routing for the original announcement.