In today's complex tech landscape, your data is rarely in one place. Your user profiles might live in a Postgres database, their activity logs in MongoDB, and their subscription details in a Stripe API. Trying to get a complete picture of a single customer can feel like a frantic scavenger hunt, cobbling together one-off scripts and fragile integrations.
This data fragmentation isn't just an inconvenience; it's a bottleneck. It slows down development, creates brittle code, and makes it incredibly difficult to answer even basic business questions. What if you could break down these data silos? What if you could define complex, cross-system data retrieval logic once and make it available as a simple, secure, and reusable API?
This is the promise of agentic search, a new paradigm for data retrieval. And it's the core of what we do at Searches.do.
Let's look at a common scenario: you need to build a "customer 360" dashboard. To get the data, your team has to:
The result? Three different pieces of logic, likely in three different languages, managed by three different parts of your codebase. Every time a new service needs this data, the logic is copied, rewritten, or reimplemented. This is "data query debt," and it's holding your business back.
Instead of writing endless one-off queries, Searches.do allows you to build Search Agents. Think of a Search Agent as a specialized, autonomous service that knows exactly how to retrieve a specific set of data. It encapsulates the what ("Find a Full Customer Profile") and abstracts away the how (the messy details of SQL, NoSQL, and API calls).
This is a Business as Code approach to data retrieval. You define a business need as a simple, versionable piece of code that instantly becomes a scalable API.
Here’s how simple it is to define a Search Agent with Searches.do:
import { Search } from 'searches.do';
const findUserByEmail = new Search({
name: 'Find User By Email',
description: 'Retrieves a single user record by their email address.',
parameters: {
email: { type: 'string', required: true }
},
handler: async ({ email }) => {
// Your data retrieval logic goes here
const user = await db.collection('users').findOne({ email });
return user;
}
});
// Now callable via API: POST /findUserByEmail
// { "email": "jane.doe@example.com" }
The handler is where the magic happens. It's just code, giving you the flexibility to connect to any data source imaginable.
Now, let's solve our "customer 360" problem the Searches.do way. We'll create a single agent, getFullCustomerProfile, that queries all our sources.
import { Search } from 'searches.do';
import { sql, mongo, stripe } from './data-connections';
const getFullCustomerProfile = new Search({
name: 'Get Full Customer Profile',
description: 'Retrieves a unified customer profile from multiple sources.',
parameters: {
userId: { type: 'string', required: true }
},
handler: async ({ userId }) => {
// 1. Fetch core data from Postgres (SQL)
const profilePromise = sql.query(
'SELECT id, name, email FROM users WHERE id = $1',
[userId]
);
// 2. Fetch recent orders from MongoDB (NoSQL)
const ordersPromise = mongo.collection('orders')
.find({ userId })
.sort({ createdAt: -1 })
.limit(5)
.toArray();
// 3. Fetch subscription status from Stripe API
const subscriptionPromise = stripe.subscriptions.list({
customer: userId, // Assuming user ID maps to Stripe customer ID
limit: 1
});
// Run all queries in parallel for maximum performance
const [profileResult, recentOrders, subscriptionData] = await Promise.all([
profilePromise,
ordersPromise,
subscriptionPromise
]);
if (!profileResult.rows.length) {
return null;
}
// 4. Combine into a single, clean object
return {
profile: profileResult.rows[0],
recentOrders: recentOrders,
subscriptionStatus: subscriptionData.data[0]?.status || 'inactive'
};
}
});
// Now callable via API: POST /getFullCustomerProfile
// { "userId": "user-12345" }
With this agent deployed, any developer, application, or service can get a complete, unified customer profile with a single API call. They don't need to know about your database schemas or API keys. Your data retrieval logic is now a decoupled, manageable, and reusable Data Retrieval API.
Because the handler is just code, you can do far more than just fetching and merging. You can easily integrate Large Language Models (LLMs) to create truly agentic search capabilities.
Imagine a support agent typing a query: "find me angry customers from last week who mentioned 'billing'."
You can build a Search Agent that takes this natural language input, uses an LLM to extract intent and entities (sentiment: 'angry', date_range: 'last week', keyword: 'billing'), and then dynamically queries the appropriate data sources. This transforms your data from a static repository into a dynamic, conversational partner.
The era of writing repetitive, single-use query scripts is over. By embracing a Search as a Service model with Searches.do, you can:
Ready to unlock your data's true potential? Get started with Searches.do today and transform your data queries into intelligent, reusable APIs.