RPC Agents
Think of RPC Agents as personal assistants for your project - deployed globally, always active, and constantly working in the background to keep everything fast, consistent, and reliable.
They observe how your traffic flows, what data is accessed most frequently, and which providers perform best in each region. Using real-time telemetry and AI-driven analysis, they route requests efficiently, refresh cached data, predict what’s needed next, and keep the global read layer continuously up to date.
Each project and network has its own dedicated set of RPC Agents, distributed worldwide. They operate at massive scale, analyzing traffic patterns and making split-second decisions that boost performance and reliability - without requiring any input from you.
RPC Agents are a core part of Direct’s infrastructure. They power advanced features like predictive prefetching, smart routing, cache propagation, health monitoring, automatic failover, and more.
What RPC Agents Do
RPC Agents work behind the scenes to optimize every request. Their key capabilities include:
- 🧠 Smart Routing
- 🔁 Popularity-Based Caching
- 🔮 Predictive Prefetching
- 📊 Real-Time Monitoring
🧠 Smart Routing
RPC Agents dynamically route each call to the optimal endpoint based on real-time conditions. They continuously monitor every connected provider’s health and performance - tracking latency, error rates, and synchronization status in each region. Using this live telemetry, they intelligently send requests to whichever provider is fastest and most reliable at that moment.
If a provider slows down or goes offline, the agents automatically reroute traffic to avoid any slowdown. Routing decisions are made at the network edge, minimizing latency and ensuring that your users’ requests are handled by the best available node without any manual intervention.
🔁 Popularity-Based Caching
RPC Agents maintain and update the global read layer for your project. The read layer is a real-time cache that holds your most requested data, continuously revalidated to stay accurate and fresh. RPC Agents detect which queries are most frequently requested and ensure that these results are readily available across the network.
As new blockchain data arrives, the agents proactively update cached responses, pushing fresh data out to edge locations near your users. This system drastically reduces the need to hit upstream providers. Importantly, all revalidation happens internally within Direct’s infrastructure - it does not generate extra load against your Web3 providers. In many cases, the majority of reads can be fulfilled directly from the read layer, offloading traffic from your Web3 provider and keeping access fast.
🔮 Predictive Prefetching
RPC Agents continuously analyze your application’s traffic patterns and the relationships between different pieces of data. By understanding which data is often requested together or follows common usage sequences, RPC Agents proactively keep relevant data fresh in the global read layer. This ensures that important responses are already available before your application explicitly requests them.
The Direct Client automatically receives predictive prefetching results through the Wire Protocol as part of normal communication. Prefetched data is streamed in the background alongside regular responses, without introducing additional requests or impacting performance. Because the data is already held in the local client cache, your application can retrieve it instantly when needed - turning many future requests into immediate local cache hits.
RPC Agents also prepare the Starter Pack: a bundle of essential startup data based on common initialization patterns. When your application starts, the Direct Client automatically receives the Starter Pack as part of its early communication with Direct. This ensures that key data is available right from the beginning, reducing startup latency and avoiding a burst of initial RPC calls.
Predictive prefetching and the Starter Pack work together to improve responsiveness throughout the application lifecycle, without requiring changes to your code or behavior.
📊 Real-Time Monitoring
While optimizing traffic and caching, RPC Agents continuously collect telemetry about your application’s Web3 interactions. They surface real-time insights across networks, providers, and regions - including metrics like latency trends, cache hit rates, and provider reliability.
Much of this telemetry is also shared through your Direct Dashboard, giving you live visibility into how your application is performing and how providers are behaving globally. You can monitor patterns, identify bottlenecks, and make informed decisions based on real usage data.
These insights are not just for observation. RPC Agents use them internally to fine-tune system behavior in real time - adjusting caching strategies, refining routing priorities, and ensuring your application keeps running smoothly as conditions evolve.