PluginsTavily
Tavily Database Schema
Database schema for the Tavily plugin
The Tavily plugin is a search API and does not sync data to the database. Search results are returned directly from the API and are not stored locally.
New to Corsair? Learn about database operations and API access.
Full Implementation: See the Tavily plugin source code.
No Database Entities
Tavily search results are stateless — each search call returns fresh results directly from the web. There are no entities synced to the Corsair database.
If you want to store search results for later analysis, save them to your own database after receiving the response:
export const searchAndStore = inngest.createFunction(
{ id: "search-and-store" },
{ event: "app/research-requested" },
async ({ event }) => {
const results = await corsair.tavily.api.search({
query: event.data.query,
search_depth: "advanced",
include_answer: true,
});
// Store results in your own database
await db.searchResults.create({
query: event.data.query,
answer: results.data.answer,
urls: results.data.results.map(r => r.url),
createdAt: new Date(),
});
return results.data;
}
);