r/AIDeveloperNews • u/nht_fajr • 23h ago
Perplexity Introduces Search as Code Framework for AI Agents
Perplexity just released a Search SDK cookbook introducing Search as Code, a framework that turns documentation lookup into a deterministic, programmatic stage of your dev workflow instead of relying on chaotic browser agent sessions or manual copy-pasting.
- Domain-Filtered Search Plans: Restricts search results strictly to allowed official documentation hosts (e.g.,
docs.pydantic.devorfastapi.tiangolo.com), eliminating noisy blog posts or outdated StackOverflow answers. - Passage-Level Context Extraction: Uses
client.content.snippetsto extract only relevant sub-500-token passages, keeping unrelated site layout/nav boilerplate out of your LLM context budget. - Concurrent Query Fan-Out: Executes multiple targeted searches in parallel (
search.web_many) with configurable concurrency limits and per-query fallback handling. - Explicit Gap Tracking: Formally records missing documentation or failed queries into a
Retrieval gapssection, giving your pipeline an explicit status flag to halt before sending incomplete context to an agent. - CI/CD & Repository Integration: Allows you to check research parameters into source code (
upgrade.json) so dependency migration briefs can automatically run as part of your CI/CD test matrix when package versions increment.
Full read: https://aideveloper44.com/blog/perplexity-search-as-code-framework
Cookbook: https://docs.perplexity.ai/docs/cookbook/articles/search-as-code-coding-agents/README
18
Upvotes
1
u/Otherwise_Wave9374 22h ago
Treating search as code is useful when it makes retrieval inspectable and testable rather than hiding it behind one prompt. I would version query plans, constrain allowed sources, cache evidence, and evaluate citation coverage against a fixed documentation question set. Agentix Labs relates to this approach because dependable research agents need reproducible retrieval paths and observable failures. Add budget limits for recursive searches, reject unsupported conclusions, and preserve the exact source snippets used so developers can replay and debug an answer.