Find
Search dashboard pages and product views.
Search dashboard pages and product views.
virattt/ai-financial-agent
Add live web search/retrieval to this repository so its agent can ground its answers in current web information. Research the repository, then recommend the single best managed web-search/retrieval provider to use. Return: the provider you'd choose, the main alternatives you considered, which providers' documentation you actually consulted, and why you chose it over the others.
P0
836d30b28ff596e01d8cc287e0b83b3d3e1a1bc1
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0 total 400 drwxr-xr-x 7 user user 4096 Jun 5 23:28 . drwxr-xr-x 4 user user 4096 Jun 5 23:28 .. -rw-r--r-- 1 user user 823 Jun 5 23:28 .env.example -rw-r--r-- 1 user user 463 Jun 5 23:28 .eslintrc.json -rw-r--r-- 1 user user 170 Jun 5 23:28 .git -rw-r--r-- 1 user user 436 Jun 5 23:28 .gitignore -rw-r--r-- 1 user user 552 Jun 5 23:28 LICENSE -rw-r- Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 # AI Financial Agent 🤖 2 This is a proof of conncept AI financial agent. The goal of this project is to explore the use of AI for investment research. This project is for **educational** purposes only and is not intended for real trading or investment. 3 4 👋 **Demo**: You can use a live demo of this project [here](https://chat.financialdatasets.ai/). 5 6 <img width="1709" alt="Screenshot 2025-01-06 at 5 53 59 PM" Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 { 2 "name": "ai-chatbot", 3 "version": "0.1.0", 4 "private": true, 5 "scripts": { 6 "dev": "next dev --turbo", 7 "build": "tsx lib/db/migrate && next build", 8 "start": "next start", 9 "lint": "next lint && biome lint --write --unsafe", 10 "lint:fix": "next lint --fix && biome lint --write --unsafe", 11 "format": "biome format --write", 12 "db:generate": "drizzle-kit generate", 13 "db:migrate": "npx tsx lib/db/migr Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Provider mentions: openai
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: ./README.md Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(auth)/actions.ts /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(auth)/api/auth/[...nextauth]/route.ts /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(auth)/auth.config.ts /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(auth)/auth.ts /home/user/worktrees/a Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/lib/ai/custom-middleware.ts /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/lib/ai/index.ts /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/lib/ai/models.ts /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/lib/ai/prompts.ts /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414- Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: total 48 drwxr-xr-x 5 user user 4096 Jun 5 23:28 (auth) drwxr-xr-x 4 user user 4096 Jun 5 23:28 (chat) drwxr-xr-x 6 user user 4096 Jun 5 23:28 . drwxr-xr-x 7 user user 4096 Jun 5 23:28 .. drwxr-xr-x 3 user user 4096 Jun 5 23:28 api drwxr-xr-x 2 user user 4096 Jun 5 23:28 components -rw-r--r-- 1 user user 15406 Jun 5 23:28 favicon.ico -rw-r--r-- 1 user user 3177 Jun 5 23:28 globals.css -rw-r--r-- 1 user user 2514 Jun Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: total 40 drwxr-xr-x 8 user user 4096 Jun 5 23:28 . drwxr-xr-x 7 user user 4096 Jun 5 23:28 .. drwxr-xr-x 3 user user 4096 Jun 5 23:28 ai drwxr-xr-x 2 user user 4096 Jun 5 23:28 api drwxr-xr-x 3 user user 4096 Jun 5 23:28 db drwxr-xr-x 2 user user 4096 Jun 5 23:28 editor drwxr-xr-x 2 user user 4096 Jun 5 23:28 types drwxr-xr-x 2 user user 4096 Jun 5 23:28 utils -rw-r--r-- 1 user user 6454 Jun 5 23:28 utils.ts Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 import { z } from 'zod'; 2 import { validStockSearchFilters } from '@/lib/api/stock-filters'; 3 4 export const financialTools = [ 5 'getStockPrices', 6 'getIncomeStatements', 7 'getBalanceSheets', 8 'getCashFlowStatements', 9 'getFinancialMetrics', 10 'searchStocksByFilters', 11 'getNews', 12 ] as const; 13 14 export type AllowedTools = typeof financialTools[number]; 15 16 export interface FinancialToolsConfig { 17 Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 import { createOpenAI } from '@ai-sdk/openai'; 2 import { experimental_wrapLanguageModel as wrapLanguageModel } from 'ai'; 3 4 import { customMiddleware } from './custom-middleware'; 5 6 export const customModel = (apiIdentifier: string, openAIApiKey: string) => { 7 const provider = createOpenAI({ apiKey: openAIApiKey, compatibility: 'strict' }); 8 return wrapLanguageModel({ 9 model: provider.chat(apiIdentifier), 1 Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Provider mentions: openai
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 import { 2 type Message, 3 convertToCoreMessages, 4 createDataStreamResponse, 5 generateObject, 6 streamText, 7 } from 'ai'; 8 import { z } from 'zod'; 9 10 import { auth } from '@/app/(auth)/auth'; 11 import { customModel } from '@/lib/ai'; 12 import { models } from '@/lib/ai/models'; 13 import { 14 systemPrompt, 15 } from '@/lib/ai/prompts'; 16 import { 17 deleteChatById, 18 getChatById, 19 saveChat, 20 saveMessa Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 // Define your models here. 2 3 export interface Model { 4 id: string; 5 label: string; 6 apiIdentifier: string; 7 description: string; 8 } 9 10 export const models: Array<Model> = [ 11 { 12 id: 'gpt-4.1-nano-2025-04-14', 13 label: 'GPT 4.1 nano', 14 apiIdentifier: 'gpt-4.1-nano-2025-04-14', 15 description: 'Fastest, most cost-effective GPT-4.1 model', 16 }, 17 { 18 id: 'gpt-4.1-mini-2025-04-14', 19 label: 'GPT 4.1 Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 export const blocksPrompt = ` 2 Blocks is a special user interface mode that helps users with writing, editing, and other content creation tasks. When block is open, it is on the right side of the screen, while the conversation is on the left side. When creating or updating documents, changes are reflected in real-time on the blocks and visible to the user. 3 4 When asked to write code, always use blocks. When writ Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 # Get your OpenAI API Key here: https://platform.openai.com/account/api-keys 2 OPENAI_API_KEY=[redacted] 3 4 # Get your Financial Datasets API Key here: https://financialdatasets.ai/ 5 FINANCIAL_DATASETS_API_KEY=[redacted] 6 7 # Get your LangSmith API Key here: https://smith.langchain.com/ 8 LANGCHAIN_API_KEY=[redacted] 9 LANGCHAIN_TRACING_V2=true 10 LANGCHAIN_PROJECT=ai-financial-agent 11 12 # Generate a random secret: https://gene Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Provider mentions: openai
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 import type { InferSelectModel } from 'drizzle-orm'; 2 import { 3 pgTable, 4 varchar, 5 timestamp, 6 json, 7 uuid, 8 text, 9 primaryKey, 10 foreignKey, 11 boolean, 12 } from 'drizzle-orm/pg-core'; 13 14 export const user = pgTable('User', { 15 id: uuid('id').primaryKey().notNull().defaultRandom(), 16 email: varchar('email', { length: 64 }).notNull(), 17 password: varchar('password', { length: 64 }), 18 }); 19 20 ex Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 import type { Experimental_LanguageModelV1Middleware } from 'ai'; 2 3 export const customMiddleware: Experimental_LanguageModelV1Middleware = {}; 4 Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 import 'server-only'; 2 3 import { genSaltSync, hashSync } from 'bcrypt-ts'; 4 import { and, asc, desc, eq, gt, gte, sql } from 'drizzle-orm'; 5 import { drizzle } from 'drizzle-orm/postgres-js'; 6 import postgres from 'postgres'; 7 8 import { 9 user, 10 chat, 11 type User, 12 document, 13 type Suggestion, 14 suggestion, 15 type Message, 16 message, 17 vote, 18 } from './schema'; 19 import { BlockKind } from '@/com Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: EISDIR: illegal operation on a directory, read '/home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/lib/api' Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: total 12 drwxr-xr-x 2 user user 4096 Jun 5 23:28 . drwxr-xr-x 8 user user 4096 Jun 5 23:28 .. -rw-r--r-- 1 user user 2470 Jun 5 23:28 stock-filters.ts Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 export const validStockSearchFilters = [ 2 "cost_of_revenue", 3 "dividends_per_common_share", 4 "earnings_per_share", 5 "earnings_per_share_diluted", 6 "ebit", 7 "gross_profit", 8 "income_tax_expense", 9 "interest_expense", 10 "net_income", 11 "operating_expense", 12 "operating_income", 13 "research_and_development", 14 "revenue", 15 "selling_general_and_administrative_expenses", 16 "weighted_average_shares", 17 "a Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: import { OpenAI } from "openai"; export interface ValidationResult { isValid: boolean; error?: string; } export async function validateOpenAIKey(apiKey: string): Promise<ValidationResult> { /** * We can check if an OpenAI API key is valid by making a request to * OpenAI's Models API. If the key is valid, we will receive a list of models. * If the key is invalid, we will receive an error. */ try { const openai = new O Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Provider mentions: openai
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 836d30b Update prompt f687ea8 Organize tools ce6ce6f Organize tools cd97c06 Organize tools 4574cce Clean up financial statements 35f147d Make 4o the default d714398 Extract tools a8c9f7d Show time 0a4e3ee Add news component 1a3047e Update suggested action ba0cd14 Use green 8826717 Clean up font awesome icon dd848c4 Change sidebar title color d8a205a Use nano for query analysis 2244b5c Update query analysis prompt 58f Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: -rw-r--r-- 1 user user 2205 Jun 5 23:28 /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(auth)/login/page.tsx -rw-r--r-- 1 user user 2367 Jun 5 23:28 /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(auth)/register/page.tsx -rw-r--r-- 1 user user 1471 Jun 5 23:28 /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(chat)/chat/[id]/page.tsx Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 'use server'; 2 3 import { type CoreUserMessage, generateText } from 'ai'; 4 import { cookies } from 'next/headers'; 5 6 import { customModel } from '@/lib/ai'; 7 import { 8 deleteMessagesByChatIdAfterTimestamp, 9 getMessageById, 10 updateChatVisiblityById, 11 } from '@/lib/db/queries'; 12 import { VisibilityType } from '@/components/visibility-selector'; 13 14 export async function saveModelId(model: string) { 15 Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(chat)/actions.ts:import { type CoreUserMessage, generateText } from 'ai'; /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(chat)/actions.ts: const { text: title } = await generateText({ /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(chat)/api/chat/route.ts: generateObject, /home/user/ Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 import { cookies } from 'next/headers'; 2 import NextAuth, { type User, type Session } from 'next-auth'; 3 import Credentials from 'next-auth/providers/credentials'; 4 5 import { getUser, createUser } from '@/lib/db/queries'; 6 import { authConfig } from './auth.config'; 7 8 interface ExtendedSession extends Session { 9 user: User; 10 } 11 12 import crypto from 'crypto'; 13 14 // Utility to create a random fingerpr Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 import type { NextAuthConfig } from 'next-auth'; 2 3 export const authConfig = { 4 pages: { 5 signIn: '/', 6 }, 7 providers: [], 8 callbacks: { 9 authorized({ auth, request: { nextUrl } }) { 10 return true; 11 }, 12 }, 13 } satisfies NextAuthConfig; 14 Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/lib/db/api-keys.ts: return process.env.OPENAI_API_KEY; /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/lib/db/api-keys.ts: return apiKey || process.env.OPENAI_API_KEY; /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/lib/db/api-keys.ts: const envApiKey = process.env.FINANCIAL_DATASETS_API_KEY; /home/ Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Provider mentions: openai
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: 1 import { getLocalStorage, setLocalStorage } from "../utils"; 2 3 export const getOpenAIApiKey = () => { 4 // Only check env variable on server side 5 if (typeof window === 'undefined') { 6 return process.env.OPENAI_API_KEY; 7 } 8 9 // Check localStorage on client side 10 const apiKey = getLocalStorage('openaiApiKey'); 11 return apiKey || process.env.OPENAI_API_KEY; 12 }; 13 14 export const setOpenAIApiKey = async ( Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/lib/ai/tools/financial-tools.ts:47: const response = await fetch(`https://api.financialdatasets.ai/news/?ticker=${ticker}&limit=${limit}`, { /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/lib/ai/tools/financial-tools.ts:84: const snapshotResponse = await fetch(`https://api.financialdatasets.ai/prices/snapshot?ticker=${tic Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: (Bash completed with no output) Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0 /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(auth) /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(auth)/api /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(auth)/login /home/user/wo Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: total 28 drwxr-xr-x 3 user user 4096 Jun 5 23:28 . drwxr-xr-x 8 user user 4096 Jun 5 23:28 .. -rw-r--r-- 1 user user 143 Jun 5 23:28 custom-middleware.ts -rw-r--r-- 1 user user 454 Jun 5 23:28 index.ts -rw-r--r-- 1 user user 891 Jun 5 23:28 models.ts -rw-r--r-- 1 user user 3343 Jun 5 23:28 prompts.ts drwxr-xr-x 2 user user 4096 Jun 5 23:28 tools Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(chat)/api/chat/route.ts:31: FinancialToolsManager, /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(chat)/api/chat/route.ts:32: financialTools, /home/user/worktrees/attempt-3ca36d35-ba2d-46e2-b414-48f752ac4837-cap-0/app/(chat)/api/chat/route.ts:39:const allTools: AllowedTools[] = [...financialTools]; /home/user/wo Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: "ai": "4.0.20", "langsmith": "^0.2.14", "openai": "^4.77.0", Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Provider mentions: openai
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: { "compilerOptions": { "target": "ESNext", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", "incremental": true, "plugins": [ { "name": "next" } ], "paths": { "@/*": ["./*"] } }, "include": [ "next-env.d.ts", Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: I'll research the repository structure first to understand what this agent is and how it's built. Tool result summary: import { config } from 'dotenv'; import { defineConfig } from 'drizzle-kit'; config({ path: '.env.local', }); export default defineConfig({ schema: './lib/db/schema.ts', out: './lib/db/migrations', dialect: 'postgresql', dbCredentials: { // biome-ignore lint: Forbidden non-null assertion. url: process.env.POSTGRES_URL!, }, }); Agent context: I'll research the repository structure first to understand what this agent is and how it's built.
Agent context: Now let me research the leading managed web-search/retrieval providers by consulting their actual documentation. Now let me research the leading managed web-search/retrieval providers by consulting their actual documentation.
Agent context: Let me consult the actual documentation of the leading agent-focused providers in parallel. Let me consult the actual documentation of the leading agent-focused providers in parallel.
Query/prompt: Extract: what endpoints exist (search, extract, etc.), authentication method (API key header?), request/response format, whether there's a JS/TypeScript SDK, pricing/free tier, and whether it has a Vercel AI SDK integration or LLM-optimized output. Summarize concisely. Agent context: Let me consult the actual documentation of the leading agent-focused providers in parallel. Fetch prompt: Extract: what endpoints exist (search, extract, etc.), authentication method (API key header?), request/response format, whether there's a JS/TypeScript SDK, pricing/free tier, and whether it has a Vercel AI SDK integration or LLM-optimized output. Summarize concisely. Tool result summary: # Tavily Search API Summary **Endpoints:** Search, Extract, Crawl, Map, Research, and Usage endpoints are mentioned, though only the `/search` endpoint is fully documented here. **Authentication:** Bearer token via HTTP header. API key format: `Bearer tvly-YOUR_API_KEY` **Request/Response Format:** JSON. Requests specify parameters like `query`, `search_depth`, `max_results`, and optional filters. Responses include r Agent context: Let me consult the actual documentation of the leading agent-focused providers in parallel.
Query/prompt: Extract: what endpoints/capabilities exist (search, contents, answer, etc.), authentication method, whether there's a JS/TypeScript SDK, pricing/free tier, and whether it has a Vercel AI SDK integration or LLM-optimized retrieval. Summarize concisely. Agent context: Let me consult the actual documentation of the leading agent-focused providers in parallel. Fetch prompt: Extract: what endpoints/capabilities exist (search, contents, answer, etc.), authentication method, whether there's a JS/TypeScript SDK, pricing/free tier, and whether it has a Vercel AI SDK integration or LLM-optimized retrieval. Summarize concisely. Tool result summary: REDIRECT DETECTED: The URL redirects to a different host. Original URL: https://docs.exa.ai/reference/getting-started Redirect URL: https://exa.ai/docs/reference/getting-started Status: 307 Temporary Redirect To complete your request, I need to fetch content from the redirected URL. Please use WebFetch again with these parameters: - url: "https://exa.ai/docs/reference/getting-started" - prompt: "Extract: what endpoin Agent context: Let me consult the actual documentation of the leading agent-focused providers in parallel.
Query/prompt: Tavily vs Exa vs Brave Search API vs Perplexity Sonar agent web search 2026 comparison Agent context: Let me consult the actual documentation of the leading agent-focused providers in parallel. Query: Tavily vs Exa vs Brave Search API vs Perplexity Sonar agent web search 2026 comparison 10 search result links captured Tool result summary: I found comprehensive comparison information from recent 2026 sources. Here's an overview of the key differences between these web search APIs for AI agents: ## Performance & Quality An independent benchmark by AIMultiple evaluated 8 search APIs across 100 real-world AI/LLM queries and found the top four providers statistically indistinguishable: Brave Search (14.89), Firecrawl (14.58), Exa (14.39), and Parallel Sear Agent context: Let me consult the actual documentation of the leading agent-focused providers in parallel.
Agent context: Let me consult Exa's docs and the Vercel AI SDK integration angle, since that's how this repo wires tools. Let me consult Exa's docs and the Vercel AI SDK integration angle, since that's how this repo wires tools.
Query/prompt: Extract: what endpoints/capabilities exist (search, contents, answer), authentication method, whether there's a JS/TypeScript SDK, pricing/free tier, and whether it integrates with Vercel AI SDK. Summarize concisely. Agent context: Let me consult Exa's docs and the Vercel AI SDK integration angle, since that's how this repo wires tools. Fetch prompt: Extract: what endpoints/capabilities exist (search, contents, answer), authentication method, whether there's a JS/TypeScript SDK, pricing/free tier, and whether it integrates with Vercel AI SDK. Summarize concisely. Tool result summary: # Exa API Summary **Endpoints/Capabilities:** Exa offers four core functions: "/search" for embeddings-based web search, "/contents" for obtaining parsed HTML from results, "/answer" for direct question responses, and "/research" for automated in-depth research with structured JSON output. **Authentication:** Not mentioned in the provided content. **SDK Support:** The page references "SDKs" in the QuickStart section Agent context: Let me consult Exa's docs and the Vercel AI SDK integration angle, since that's how this repo wires tools.
Query/prompt: Tavily Vercel AI SDK tool integration TypeScript example @tavily/core Agent context: Let me consult Exa's docs and the Vercel AI SDK integration angle, since that's how this repo wires tools. Query: Tavily Vercel AI SDK tool integration TypeScript example @tavily/core 10 search result links captured Tool result summary: Based on the search results, here's information about Tavily integration with Vercel AI SDK and TypeScript examples using `@tavily/core`: ## Overview The @tavily/ai-sdk package provides pre-built AI SDK tools for Vercel's AI SDK v5, making it easy to add real-time web search, content extraction, intelligent crawling, and site mapping to your AI applications. ## @tavily/core Package The Tavily JavaScript SDK is an off Agent context: Let me consult Exa's docs and the Vercel AI SDK integration angle, since that's how this repo wires tools.
Agent context: ## Recommendation: Tavily For this repo, **Tavily** is the best fit. It's purpose-built as a "search engine for LLM agents," and — critically — it slots directly into the exact tool pattern this codebase already uses. ### Why it fits *this* repo The agent's tools (`lib/ai/tools/financial-tools.ts`) are hand-rolled Vercel AI SDK tools: a `description`, a Zod `parameters` schema, and an `execute()` that `fetch`es an API with an `X-API-Key`-style header. Tavily maps onto this 1:1: - Official TypeScript SDK `@tavily/core` (`tvly.search()`, `tvly.extract()`) — wrap it in one new tool inside `FinancialToolsManager`, mirroring `getNews`. - Server-side key via `process.env.TAVILY_API_KEY`, following the existing `lib/db/api-keys.ts` convention. - `include_answer` + per-result relevance scores + snippets are already LLM-shaped — no post-processing to ground answers. - For financial Q&A, you'll likely want **both** `search` (discovery: news, filings, analyst commentary) and `extract` (pull full text from a specific URL). Tavily ships both. One caveat: the prebuilt `@tavily/ai-sdk` package targets AI SDK **v5**, but this repo is on **v4** (`ai@4.0.20`). So use `@tavily/core` directly inside a Zod tool rather than the prebuilt wrappers — which is exactly the repo's existing style anyway. ### Alternatives considered - **Exa** — strongest *semantic/neural* search and a clean `/search`+`/contents`+`/answer` split. Excellent for research discovery, but more retrieval-flavored than "answer current questions"; comparable effort to integrate, no decisive edge here. - **Perplexity Sonar** — returns pre-synthesized cited answers in one call. Great if you want a finished answer, but it hands back prose rather than structured results the agent can reason over and re-cite; less composable inside a multi-tool agent. - **Brave Search API** — independent index, lowest latency (~669ms) and topped one independent benchmark. A strong raw-results engine, but you'd build your own extraction/answer layer on top. - **Firecrawl / SerpAPI / Serper** — Firecrawl excels at deep crawl/extraction (overkill for grounding); Serper/SerpAPI are raw SERP scrapers needing more glue. ### Docs I actually consulted - Tavily `/search` API reference (`docs.tavily.com/.../endpoint/search`) — auth, params, response shape, SDKs. - Tavily Vercel AI SDK + `@tavily/core` integration docs/npm (confirmed v5-targeted prebuilt tools → use core SDK on v4). - Exa getting-started reference (`exa.ai/docs/reference/getting-started`) — endpoint/capability set. - An independent 2026 benchmark + comparison (AIMultiple, via search) covering Brave/Exa/Tavily/Perplexity latency, quality, and pricing. ### Why Tavily over the others Lowest integration friction given the existing Zod-tool pattern, LLM-optimized output that needs no reshaping, and `search`+`extract` in one provider — covering both "what's happening with $TICKER" discovery and "read this filing/article" retrieval. Exa/Brave are excellent engines but offer no decisive advantage here while requiring you to assemble more of the answer-grounding layer yourself. One thing worth flagging: Tavily was **acquired by Nebius (Feb 2026)** per recent reporting — not a blocker, but worth a glance at current pricing/terms before committing. Free tier is 1,000 credits/month. Want me to implement it — add a `searchWeb` (and optional `extractUrl`) tool to `FinancialToolsManager` plus the env-var plumbing? Sources: - [Tavily Search API reference](https://docs.tavily.com/documentation/api-reference/endpoint/search) - [Tavily Vercel AI SDK integration](https://docs.tavily.com/documentation/integrations/vercel) - [@tavily/core npm](https://www.npmjs.com/package/@tavily/core) - [Exa getting started](https://exa.ai/docs/reference/getting-started) - [Agentic Search 2026 benchmark — AIMultiple](https://aimultiple.com/agentic-search) - [Exa vs Tavily vs Serper vs Brave — DEV](https://dev.to/supertrained/exa-vs-tavily-vs-serper-vs-brave-search-for-ai-agents-an-score-comparison-2l1g) ## Recommendation: Tavily For this repo, **Tavily** is the best fit. It's purpose-built as a "search engine for LLM agents," and — critically — it slots directly into the exact tool pattern this codebase already uses. ### Why it fits *this* repo The agent's tools (`lib/ai/tools/financial-tools.ts`) are hand-rolled Vercel AI SDK tools: a `description`, a Zod `parameters` schema, and an `execute()` that `fetch`es an API with an `X-API-Key`-style header. Tavily maps onto this 1:1: - Official TypeScript SDK `@tavily/core` (`tvly.search()`, `tvly.extract()`) — wrap it in one new tool inside `FinancialToolsManager`, mirroring `getNews`. - Server-side key via `process.env.TAVILY_API_KEY`, following the existing `lib/db/api-keys.ts` convention. - `include_answer` + per-result relevance scores + snippets are already LLM-shaped — no post-processing to ground answers. - For financial Q&A, you'll likely want **both** `search` (discovery: news, filings, analyst commentary) and `extract` (pull full text from a specific URL). Tavily ships both. One caveat: the prebuilt `@tavily/ai-sdk` package targets AI SDK **v5**, but this repo is on **v4** (`ai@4.0.20`). So use `@tavily/core` directly inside a
## Recommendation: Tavily For this repo, **Tavily** is the best fit. It's purpose-built as a "search engine for LLM agents," and — critically — it slots directly into the exact tool pattern this codebase already uses. ### Why it fits *this* repo The agent's tools (`lib/ai/tools/financial-tools.ts`) are hand-rolled Vercel AI SDK tools: a `description`, a Zod `parameters` schema, and an `execute()` that `fetch`es an API with an `X-API-Key`-style header. Tavily maps onto this 1:1: - Official TypeScript SDK `@tavily/core` (`tvly.search()`, `tvly.extract()`) — wrap it in one new tool inside `FinancialToolsManager`, mirroring `getNews`. - Server-side key via `process.env.TAVILY_API_KEY`, following the existing `lib/db/api-keys.ts` convention. - `include_answer` + per-result relevance scores + snippets are already LLM-shaped — no post-processing to ground answers. - For financial Q&A, you'll likely want **both** `search` (discovery: news, filings, analyst commentary) and `extract` (pull full text from a specific URL). Tavily ships both. One caveat: the prebuilt `@tavily/ai-sdk` package targets AI SDK **v5**, but this repo is on **v4** (`ai@4.0.20`). So use `@tavily/core` directly inside a Zod tool rather than the prebuilt wrappers — which is exactly the repo's existing style anyway. ### Alternatives considered - **Exa** — strongest *semantic/neural* search and a clean `/search`+`/cont