惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Engineering at Meta
Engineering at Meta
D
DataBreaches.Net
月光博客
月光博客
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
U
Unit 42
腾讯CDC
爱范儿
爱范儿
J
Java Code Geeks
有赞技术团队
有赞技术团队
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
B
Blog
Stack Overflow Blog
Stack Overflow Blog
GbyAI
GbyAI
T
The Blog of Author Tim Ferriss
小众软件
小众软件
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
Microsoft Azure Blog
Microsoft Azure Blog
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I Stopped Calling Web APIs from My AI Agents. Here's What...
Artemii Amel · 2026-05-09 · via DEV Community

FFor the first few months of building agent pipelines, every time an agent needed external data it did what any developer would do: called a REST API.

A stock price, a shipping rate, a research paper citation. Doesn't matter what it was. The answer was always "call the API."

That meant managing API keys per service, handling 429s with exponential backoff, parsing inconsistent JSON schemas, and watching agents stall for 40 to 50 seconds on a single data call. One of my agents was spending 60% of its wall-clock time just waiting on HTTP responses.

I sat down and measured it properly. The average time for one of my agents to get a clean, usable answer from a third-party web API, including auth, response parsing, and retrying on failures, was 51 seconds.

I found a different path. The same query now takes 12 seconds.

Here's what changed.


The Problem With Agents Calling the Open Web

When a human uses a browser, the web is designed for them. Pages have visual hierarchy, forms have labels, errors are displayed in readable English. When an agent hits the same infrastructure it gets HTML it has to strip, rate limits it has to route around, and auth flows it was never meant to navigate.

Even "developer-friendly" REST APIs weren't built for agent-to-agent consumption. They were built for developers to query from backend services on behalf of human users. The authentication model, the pagination, the error format: all of it assumes a human will eventually read the response.

Agents querying the open web are tourists in a country where nothing is labeled in their language.


What I Use Instead

Pilot Protocol is a peer-to-peer overlay network built specifically for AI agents. Instead of HTTP endpoints it provides direct agent-to-agent addressing using 48-bit virtual addresses. Instead of REST, agents communicate via encrypted binary tunnels with sub-second handshakes.

The part that changed my workflow was the specialist agent directory: over 350 purpose-built agents running 24/7, each covering a specific data domain and returning clean structured JSON. No auth per service. No HTML to strip. One query pattern across all of them.

Categories include:

  • Finance: live FX rates, crypto spot prices, stock tickers
  • Weather: forecast, marine, air quality, hyper-local sensors
  • Academic: PubMed, OpenAlex, Semantic Scholar, Crossref covering 200M+ papers
  • Legal/Regulatory: FDA recalls, Federal Register filings, SEC EDGAR
  • Logistics: carrier rates, shipment tracking, port data
  • Health: ClinicalTrials.gov, drug formularies, WHO indicators
  • Security: CVE feeds, IP reputation, certificate transparency logs

Every specialist returns the same envelope:

{"agent":"<name>","command":"data","ok":true,"data":{...}}

Enter fullscreen mode Exit fullscreen mode

Parse once, use everywhere.


How It Works in Practice

The client is pilotctl, a CLI that talks to the local Pilot daemon over a Unix socket. Installation is one line:

curl -fsSL https://pilotprotocol.network/install.sh | sh
pilotctl daemon start

Enter fullscreen mode Exit fullscreen mode

To query a specialist:

# establish trust (auto-approved on the public network, takes about 2s)
pilotctl handshake frankfurter

# send a query
pilotctl send-message frankfurter --data '/data {"base":"USD","symbols":["EUR","GBP","JPY"]}'

# read the reply from the local inbox
sleep 3
jq -r '.data' "$(ls -1t ~/.pilot/inbox/*.json | head -1)"

Enter fullscreen mode Exit fullscreen mode

The reply arrives as a file in ~/.pilot/inbox/. Fully parsed, structured JSON with no boilerplate to strip.

In Python using the SDK:

import pilot

client = pilot.Client()
client.handshake("frankfurter")

response = client.query("frankfurter", "/data", {"base": "USD", "symbols": ["EUR", "GBP", "JPY"]})
rates = response["data"]["rates"]
# {'EUR': 0.921, 'GBP': 0.789, 'JPY': 149.3}

Enter fullscreen mode Exit fullscreen mode

Compare that to the equivalent via the open web:

import requests

# manage your own session, retries, error handling, rate limits
resp = requests.get("https://api.exchangerate.host/latest", params={"base": "USD", "symbols": "EUR,GBP,JPY"})
resp.raise_for_status()
rates = resp.json()["rates"]

Enter fullscreen mode Exit fullscreen mode

Functionally similar. But the Pilot version doesn't burn tokens re-parsing HTML fallbacks when the primary API goes down, doesn't break at 3am when an API rotates its auth scheme, and routes to a fallback specialist automatically if one node goes offline.


The 12s vs 51s Breakdown

Where those 51 seconds actually go:

Step Avg time
DNS resolution 80-200ms
TLS handshake 200-400ms
API cold cache response 8-20s
Auth validation 1-3s
Error retry (happens ~30% of calls) 20-40s
Response parsing HTML to structured 0.5-2s
Total p95 ~51s

The Pilot path:

Step Avg time
Daemon IPC (local) less than 5ms
Encrypted tunnel to specialist 200-800ms
Specialist data fetch (pre-cached) 1-4s
Structured JSON returned less than 10ms
Total p95 ~12s

The daemon maintains persistent encrypted tunnels to specialists so there's no handshake penalty on repeat queries. The network uses X25519 key exchange and AES-256-GCM, the same primitives as TLS 1.3, so you're not trading speed for security.


What I Actually Changed in My Agent Code

Before:

def get_research_paper(doi):
    # try Crossref, fall back to Semantic Scholar, fall back to manual scrape
    for attempt in range(3):
        try:
            resp = requests.get(f"https://api.crossref.org/works/{doi}", timeout=30)
            return resp.json()["message"]
        except Exception:
            time.sleep(2 ** attempt)
    raise RuntimeError("All sources failed")

Enter fullscreen mode Exit fullscreen mode

After:

def get_research_paper(doi):
    return client.query("crossref-agent", "/data", {"doi": doi})["data"]

Enter fullscreen mode Exit fullscreen mode

The specialist handles the fallback logic, the retry, and the schema normalisation. My agent just gets a paper.


What It Doesn't Replace

This isn't a replacement for every API call. For services with deep auth flows tied to user identity, your own database, your company's internal APIs, OAuth-gated user data, you still go direct. Pilot's specialist network is for commodity external data: prices, public records, research papers, weather, logistics rates.

For anything in that category, I haven't gone back to direct API calls.


Getting Started

The core protocol is published as an IETF Internet-Draft, so the addressing and encryption specs are publicly reviewable. The free tier covers unlimited agents and connections on the public backbone with no signup required.