# ADR-0014: Pi-Web Access — Web Search & Content Fetching

**Status:** Accepted
**Date:** 2026-05-13
**Package:** `pi-web-access@0.10.7`
**Maintainer:** @nicobailon | **Repo:** github.com/nicobailon/pi-web-access
**Last published:** 10 days ago | **Publish cadence:** ~2-3/week

## Problem

Agent operates in a closed filesystem. Without web access: no current docs, no repo cloning, no video/PDF understanding. Hardcoding knowledge into prompts is stale and token-expensive.

## Decision

Four capabilities:

- **`web_search`**: multi-provider (Exa → Perplexity → Gemini API → Gemini Web). Synthesized answers + citations.
- **`fetch_content`**: URL→markdown, GitHub clone, YouTube transcripts + frame extraction, PDF, local video
- **`code_search`**: code-specific (GitHub, Stack Overflow, official docs)
- **`get_search_content`**: retrieve full content from prior results

Provider auto-selection with fallback chain.

## Alternatives

| Approach         | Why Rejected                       |
| ---------------- | ---------------------------------- |
| No web access    | Agent is blind                     |
| Browser MCP only | Slow, heavyweight for search       |
| curl + grep      | No synthesis, no structured output |

## Trade-offs

Requires at least one API key. Rate limits apply. `code_search` currently broken (Exa MCP missing tool) — falls back to `web_search` + `ast_grep_search`.

## References

- [npm](https://www.npmjs.com/package/pi-web-access)
- [Exa](https://exa.ai) — code-aware search
- [Perplexity AI](https://perplexity.ai) — synthesized search with citations
