new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

maxim/setup

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Maxim setup requirements

To set up Maxim with the AI SDK, the following packages are required: ai, @ai-sdk/openai, @ai-sdk/anthropic, @ai-sdk/google, and @maximai/maxim-js.

Maxim environment variables

The following environment variables must be configured for Maxim: MAXIM_API_KEY, MAXIM_LOG_REPO_ID, OPENAI_API_KEY, and ANTHROPIC_API_KEY.

Maxim logger initialization code

Initialize the Maxim logger by importing Maxim from @maximai/maxim-js, creating an instance with apiKey, and calling the logger() method with the MAXIM_LOG_REPO_ID. Example: const maxim = new Maxim({ apiKey }); const logger = await maxim.logger({ id: process.env.MAXIM_LOG_REPO_ID || '' });

Maxim model wrapping with wrapMaximAISDKModel

Wrap AI SDK models using the wrapMaximAISDKModel function from @maximai/maxim-js/vercel-ai-sdk, passing the model and logger instance. Example: const model = wrapMaximAISDKModel(openai('gpt-5'), logger);

Maxim Next.js API route integration

To integrate Maxim in a Next.js API route, initialize Maxim and logger at the top of the route handler, wrap the model, and use streamText with custom metadata in the providerOptions.maxim field. The result should be returned using result.toAIStreamResponse().

Give your agent this brain