Synced Data or Live API Calls: How an AI Agent Uses Both
When an agent should read a synced copy in your own store, when it should call the customer's app live, and how one connected account feeds both.
The Truto Team
·
·
4 min read
Your team’s apps in
An AI agent in a B2B product works with each customer's own apps: their CRM, help desk, files and HR system. Some questions need many records at once: "which accounts mention a renewal risk this quarter?" Others need one record, as it is right now: "what is the status of ticket 4812?" And some tasks write back: "close the ticket and log a note."
No single path fits all three, but one connected account on Truto can feed every path.
Two paths from one connected account
Your customer connects an app once. Truto keeps the credentials and refreshes the tokens. From that one connected account:
- The synced path. A sync job reads the account on a schedule and writes the records into your own Postgres, BigQuery, Snowflake, Pinecone, Qdrant or bucket (Datastores docs). The agent queries that store.
- The live path. The agent calls the app through the Proxy API, or through an MCP server that Truto creates for that one account (MCP servers docs).
The setup of the synced path is in How to sync your customers' SaaS data into your own database, warehouse or bucket.
Which path for which task
| Task | Path | Why |
|---|---|---|
| Semantic search, RAG | Synced | Needs embeddings over many records |
| Questions across many records | Synced | One query, not hundreds of API pages |
| Reports and trends | Synced | History the app's API may not keep |
| Current status of one record | Live | Must be correct right now |
| Create, update, delete | Live | Writes go to the app |
| Data the sync does not cover | Live | Any method on the integration |
Truto's docs make the same split for unified calls. A live call costs about the app's own latency plus a few tens of milliseconds. That suits request-time reads, and it is the wrong shape for jobs over millions of records (realtime data model).
The synced path for an agent
For retrieval, write the records into a store the agent can search:
- Pinecone.
upsertDocumentswrites documents, with an optionalnamespaceper customer (method inputs). See Pinecone: upserts and namespaces for RAG. - Qdrant.
upsertPointswrites points with their payload. - Postgres with pgvector.
upsertRowskeeps one row per record. See Postgres, Neon and Supabase.
A JSONata transform shapes each record before the write. Keep the text the agent needs, the record's id in the app, the account id and the last-modified time.
Keep the copy current:
- Schedules. A schedule runs the job at most every five minutes (Schedules).
- Incremental state.
get_stateandupdate_statekeep a watermark, so each run fetches only what changed (V4 sync job reference). - Webhook-driven runs. A workflow can start a run when a batch of the app's webhook events arrives for the account.
The live path for an agent
The Proxy API calls the app's own API through Truto. Truto picks the account's credentials, refreshes OAuth tokens and turns the app's pagination into one next_cursor (Proxy API).
For an agent, the MCP server is the simpler form. POST /integrated-account/:id/mcp creates a server for one account. Its tools are the Proxy API methods that have a description. You can limit them by method, such as read only, or by tag, and give the server an expiry (MCP servers docs).
Rate limits stay visible. On a live call, Truto passes a 429 back with the rate-limit headers, and Retry-After when the app sends one. Your agent's code decides when to retry.
Use both in one answer
A common pattern for a support agent:
- Search the synced copy. Find the 5 past tickets most like the new one, from Pinecone or pgvector.
- Check live. Fetch the current state of the new ticket through the MCP server, so the agent does not act on a stale status.
- Write live. Post the reply or update the ticket through the same MCP server, with the customer's own permissions in the app.
Step 1 uses your store. Steps 2 and 3 use the app. The record ids in your store match the ids the live calls return, because both come from the same connected account.
Keep customers apart in both paths
An agent must never mix up two customers' data. Keep them apart on both paths:
- In your store. Use one path, tenant column or namespace per connected account. Filter every query by it.
- In live calls. Give the agent the MCP server of one account. The server sees that account only.
For where the synced copy lives and what Truto keeps, read Keep your customers' SaaS data in your own storage.
Pricing
Live calls and MCP tool calls are API calls at $5 per 100,000, from the first call. Connections are free. Calls on Truto's managed Google and QuickBooks apps are priced separately. Datastores for the synced path are part of the Pro add-on, at $499 a month, with a 30-day trial on the Free plan (pricing).
FAQ
- Should my AI agent read synced data or call the customer's app live?
- Use both. Read the synced copy for search, retrieval and questions across many records. Call the app live when the answer must be current to the second, and for every create, update or delete.
- How does the synced copy get into my own store?
- A Truto sync job reads each connected account and writes the records into your datastore, such as Postgres, Pinecone or Qdrant. A schedule and incremental state keep it current. Datastores are part of the Pro add-on.
- How does the agent make live calls?
- Through the Proxy API, or through an MCP server that Truto creates for one connected account. The MCP server shows only that account's tools, limited to the methods you allow, such as read only.
- How fresh is the synced copy?
- As fresh as its schedule. A Truto schedule runs at most every five minutes, and a workflow can start a run when a batch of the app's webhook events arrives.
- How do I stop the agent mixing up customers?
- Keep each customer apart in both paths. In your store, use a path, tenant column or namespace per account. For live calls, give the agent the MCP server of that one account.