For AI agents: the documentation index is at /llms.txt. Markdown versions of pages are available by appending .md to the URL.
Skip to main content
AI

Just-in-Time Indexing: Using Agents to Answer Onchain Questions

Author:Denham PreenDenham Preen··3 min read
Just-in-Time Indexing: Using Agents to Answer Onchain Questions

Just-in-time indexing is a way of using an AI agent to answer one-off questions about onchain data without maintaining permanent infrastructure or finding a pre-indexed data point. Rather than building an indexer in advance and keeping it running, the dataset is built on demand when a question comes up, read once, and deleted afterward.

How it Works

One user, Michael K from Curve Finance, uses it for ad hoc analysis of pool activity. The flow starts with a plain-language prompt to Claude, for example: "Use Envio to parse all the trades from this pool."

Claude, using Envio's tooling, generates the indexer: the config, schema, and event handlers, scoped to the specific contract and events in the question. It deploys to Envio's free development plan cloud service with envio-cloud, the CLI, and the indexer backfills from scratch. After 5 to 10 minutes, the data is ready to query. Once the researcher has pulled what they need, they delete the indexer.

"One of the simplest ways to get large datasets of onchain data for our research purposes."

Michael K, Researcher at Curve Finance

Why the Free Tier Covers it

The workflow runs on Envio's free hosted cloud tier. The requests are one-off, so a single repo is enough: the agent manages it and deploys each question as a branch. A backfill of 5 to 10 minutes is acceptable for ad hoc work, where the alternative is building a pipeline by hand.

The Pattern

Traditional indexing requires deciding what data is needed, building the pipeline, and then querying it, which limits the user to questions planned for in advance. Just-in-time indexing reverses the order: the question comes first, and the dataset is built to answer it.

This works because backfilling takes minutes rather than days, and because an agent can stand up the indexer from a natural-language prompt without anyone writing config by hand. The same pattern applies to any agent or user asking one-off onchain questions.

"We use Envio regularly to parse all kinds of data from all kinds of contracts across dozens of chains."

Michael K, Researcher at Curve Finance

Build With Envio

Envio is a real-time multichain blockchain indexer that turns onchain events into a queryable GraphQL API. Supports any EVM chain, plus Solana and Fuel. Use Envio Cloud or self-host. If you're building onchain, come talk to us about your data needs.

Subscribe to our newsletter 💌

Website | X | Discord | Telegram | GitHub | YouTube | Reddit