Scenario
You want your agent to answer questions about a specific site—a vendor’s documentation, your own help center, a competitor’s product pages—accurately and without re-fetching on every question. The pattern is map, select, fetch, index. Discover the inventory cheaply, decide what belongs in the knowledge base, extract only that, and store it.What you need
The flow
Mapping first is what makes this affordable. A map reports what exists without extracting content, so you pay for reading only the pages you decided are worth reading.Step 1: map the site
run_id immediately.
Crawls stay on the seed host. To cover
docs.example.com and blog.example.com, run two maps.Step 2: poll until the map finishes
include_results: false keeps each check small, then one final call collects everything.
Step 3: select what to index
The map gives you URLs, titles, and depth. Filter before spending fetch credits:- Drop generated API reference if your agent should answer conceptually
- Drop archived or versioned duplicates of current pages
- Drop index pages that only link elsewhere and carry no content
Step 4: fetch in batches
titan_fetch takes up to 100 URLs per call. Batch below that so responses stay manageable:
idempotency_key means an interrupted build can resume without re-paying for batches that already completed.
Step 5: chunk and store
Markdown output chunks cleanly on headings, which keeps sections intact instead of splitting mid-argument:url and retrieved_at in metadata. The first gives your agent citations; the second tells you what has gone stale.
Keeping it fresh
Re-map on a schedule and diff against what you have indexed:retrieved_at, and set freshness: "live_only" on those calls to bypass cache.
When to crawl instead of map
mode: "crawl" extracts content during discovery, in one run instead of two:
Map-then-fetch also lets you use a larger
max_chars_per_url on the pages you keep, rather than the smaller crawl-mode default across every page.
Cost in practice
Indexing a 100-page documentation site:
Crawling all 100 pages with content would cost 100 and give you 40 pages you did not want—cheaper in credits, worse in index quality. Choose based on whether filtering matters for your corpus.
Next steps
- titan_crawl — patterns, depth, and limits
- Research agent — answering from live search instead of an index
- Credits and usage — cost control