Skip to content

Commit 2597c36

Browse files
committed
update dependecies. update to 04-mini model
1 parent 4f332fb commit 2597c36

File tree

6 files changed

+59
-81
lines changed

6 files changed

+59
-81
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ npm run build
2525

2626
4. Run the cli version:
2727
```bash
28-
npm run start "Your research query here"
28+
npm run start
2929
```
3030
5. Test MCP Server with Claude Desktop:
3131
Follow the guide thats at the bottom of server quickstart to add the server to Claude Desktop:

package-lock.json

Lines changed: 47 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
"typescript": "^5.7.3"
3030
},
3131
"dependencies": {
32-
"@ai-sdk/openai": "^1.1.9",
32+
"@ai-sdk/openai": "^1.3.22",
3333
"@mendable/firecrawl-js": "^1.16.0",
3434
"@modelcontextprotocol/sdk": "^1.12.1",
35-
"ai": "^4.1.17",
35+
"ai": "^4.3.16",
3636
"dotenv": "^16.4.7",
3737
"express": "^5.1.0",
3838
"js-tiktoken": "^1.0.17",

src/ai/providers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ const openai = createOpenAI({
1515
baseURL: process.env.OPENAI_ENDPOINT || 'https://api.openai.com/v1',
1616
} as CustomOpenAIProviderSettings);
1717

18-
const customModel = process.env.OPENAI_MODEL || 'o3-mini';
18+
const customModel = process.env.OPENAI_MODEL || 'o4-mini-2025-04-16';
1919

2020
// Create model with Langfuse instrumentation
2121
const baseModel = openai(customModel, {
2222
reasoningEffort: customModel.startsWith('o') ? 'medium' : undefined,
2323
structuredOutputs: true,
2424
});
2525

26-
export const o3MiniModel = {
26+
export const o4MiniModel = {
2727
...baseModel,
2828
defaultObjectGenerationMode: 'json',
2929
async doGenerate(options) {

src/deep-research.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { compact } from 'lodash-es';
77
import pLimit from 'p-limit';
88
import { z } from 'zod';
99

10-
import { o3MiniModel, trimPrompt } from './ai/providers.js';
10+
import { o4MiniModel, trimPrompt } from './ai/providers.js';
1111
import { firecrawl as firecrawlConfig } from './config.js';
1212
import { OutputManager } from './output-manager.js';
1313
import { systemPrompt } from './prompt.js';
@@ -40,11 +40,6 @@ export type ResearchProgress = {
4040
followUpQuestions?: string[]; // Follow-up questions generated
4141
};
4242

43-
type ResearchResult = {
44-
learnings: string[];
45-
visitedUrls: string[];
46-
};
47-
4843
type SourceMetadata = {
4944
url: string;
5045
title?: string;
@@ -97,7 +92,7 @@ async function generateSerpQueries({
9792
: [];
9893

9994
const res = await generateObject({
100-
model: o3MiniModel,
95+
model: o4MiniModel,
10196
system: systemPrompt(),
10297
prompt: `Given the following prompt from the user, generate a list of SERP queries to research the topic. Return a maximum of ${numQueries} queries, but feel free to return less if the original prompt is clear. Make sure each query is unique and not similar to each other.
10398
@@ -176,7 +171,7 @@ async function evaluateSourceReliability(domain: string, context: string): Promi
176171
reasoning: string;
177172
}> {
178173
const res = await generateObject({
179-
model: o3MiniModel,
174+
model: o4MiniModel,
180175
system: systemPrompt(),
181176
prompt: `Evaluate the reliability of the following source domain for research about: "${context}"
182177
@@ -276,7 +271,7 @@ async function processSerpResult({
276271
log(`Ran ${query}, found ${contents.length} contents (${sourceMetadata.filter(m => m.reliabilityScore >= reliabilityThreshold).length} above reliability threshold ${reliabilityThreshold})`);
277272

278273
const res = await generateObject({
279-
model: o3MiniModel,
274+
model: o4MiniModel,
280275
abortSignal: AbortSignal.timeout(60_000),
281276
system: systemPrompt(),
282277
prompt: `Given the following contents from a SERP search for the query <query>${query}</query>, generate a list of learnings from the contents. Return a maximum of ${numLearnings} learnings, but feel free to return less if the contents are clear. Make sure each learning is unique and not similar to each other. The learnings should be concise and to the point, as detailed and information dense as possible. Make sure to include any entities like people, places, companies, products, things, etc in the learnings, as well as any exact metrics, numbers, or dates.
@@ -361,7 +356,7 @@ export async function writeFinalReport({
361356
);
362357

363358
const res = await generateObject({
364-
model: o3MiniModel,
359+
model: o4MiniModel,
365360
system: systemPrompt(),
366361
prompt: `Given the following prompt from the user, write a final report on the topic using the learnings from research. Make it as detailed as possible, aim for 3 or more pages, include ALL the learnings from research. Consider source reliability when drawing conclusions.
367362

src/feedback.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { generateObject } from 'ai';
22
import { z } from 'zod';
33

4-
import { o3MiniModel } from './ai/providers.js';
4+
import { o4MiniModel } from './ai/providers.js';
55
import { systemPrompt } from './prompt.js';
66

77
export async function generateFeedback({
@@ -12,7 +12,7 @@ export async function generateFeedback({
1212
numQuestions?: number;
1313
}) {
1414
const userFeedback = await generateObject({
15-
model: o3MiniModel,
15+
model: o4MiniModel,
1616
system: systemPrompt(),
1717
prompt: `Given the following query from the user, ask some follow up questions to clarify the research direction. Return a maximum of ${numQuestions} questions, but feel free to return less if the original query is clear: <query>${query}</query>`,
1818
schema: z.object({

0 commit comments

Comments
 (0)