> Full Neon documentation index: https://neon.com/docs/llms.txt

# Gemini Nano Banana 2.1, Managed Better Auth logs, new Functions templates, and more

## Gemini Nano Banana 2.1 on the AI Gateway

**Gemini Nano Banana 2.1** (`gemini-nano-banana-2-1`) is now available on the [AI Gateway](https://neon.com/docs/ai-gateway/overview). Describe an image in a prompt, or pass in an image to edit, and it returns a generated image along with any text. It joins Gemini 3 Pro Image and Gemini 3.1 Flash Image, which we added last week.

Try it with the AI SDK:

```typescript
import { writeFile } from 'node:fs/promises';
import { generateText } from 'ai';
import { neon } from '@neon/ai-sdk-provider';

const { files } = await generateText({
  model: neon('gemini-nano-banana-2-1'),
  prompt: 'Generate an image of a green apple on a wooden table.',
});

for (const [i, file] of files.entries()) {
  await writeFile(`image-${i}.png`, file.uint8Array);
}
```

The AI Gateway lets you add AI features to your app, such as generating product images or answering customer questions, with one Neon credential and no provider API keys. To start building, see [Get started with the AI Gateway](https://neon.com/docs/ai-gateway/get-started). For more examples, see [Gemini Nano Banana 2.1](https://neon.com/docs/ai-gateway/models/gemini-nano-banana-2-1).

## Logs for Managed Better Auth

[Managed Better Auth](https://neon.com/docs/auth/overview) can now export your branch's auth events to your branch logs (beta). When a user can't sign in, you can see every sign-up and sign-in attempt, failed ones included.

View events on the **Auth** tab of the [Monitoring page](https://neon.com/docs/introduction/monitor-logs), or query them from the terminal:

```bash
neon logs query --source neon_auth --since 1h
```

Export is on by default when you enable Managed Better Auth. On a branch that already had Managed Better Auth, it may be off. Turn it on in **Settings** > **Better Auth** under **Logs**, or run `neon neon-auth config logs-export enable`. Logs export is available in four AWS regions: US East (N. Virginia), US East (Ohio), Europe (Frankfurt), and Asia Pacific (Singapore). See [Export Managed Better Auth logs](https://neon.com/docs/auth/guides/manage-auth-api#export-managed-better-auth-logs).

## New Neon Functions templates

A [Neon Function](https://neon.com/docs/compute/functions/overview) is backend code, such as an API, a webhook handler, or an AI agent, that runs on Neon next to your database, so you don't need a separate server. Four new templates in the [Function Registry](https://neon.com/functions/templates) give you a working function to deploy and adapt:

- [`lakebase-search-memory`](https://neon.com/functions/templates/lakebase-search-memory): Give your app or agent a memory in Postgres that it can search by meaning, by keyword, or both at once. It's built on [Lakebase Search](https://neon.com/docs/ai/lakebase-search), and hybrid recall also finds exact terms such as names and IDs that embeddings alone can miss.
- [`pgvector-memory`](https://neon.com/functions/templates/pgvector-memory): The same idea with [pgvector](https://neon.com/docs/extensions/pgvector). It stores text as embeddings from the [AI Gateway](https://neon.com/docs/ai-gateway/overview) and recalls the closest matches by meaning.
- [`sql-alerts`](https://neon.com/functions/templates/sql-alerts): Run SQL checks on a [schedule](https://neon.com/docs/compute/functions/triggers/schedule) and post to Slack when a value crosses a threshold, such as a long-running query or an idle transaction.
- [`google-adk`](https://neon.com/functions/templates/google-adk): A fact-checking agent built with [Google ADK](https://google.github.io/adk-docs/). It searches Google through the AI Gateway and returns a verdict, an explanation, and its sources.

Start a function from a template with the [Neon CLI](https://neon.com/docs/cli):

```bash
neon functions new lakebase-search-memory
```

## Fixes & improvements

<details>

<summary>**Managed Better Auth**</summary>

- Run your own code when something happens in [Managed Better Auth](https://neon.com/docs/auth/overview), like sending a welcome email when someone signs up. You can now point a [webhook](https://neon.com/docs/auth/guides/webhooks#webhook-url-requirements) at a [Neon Function](https://neon.com/docs/compute/functions/overview), so that code runs on Neon alongside your database.
- Sign-in now works when you run your app locally at `127.0.0.1` with **Allow localhost** on. Before, it only worked at `localhost`. See [Localhost access](https://neon.com/docs/auth/production-checklist#localhost-access).

</details>

<details>

<summary>**Neon CLI**</summary>

- When `neon deploy` finishes, your functions are live. It now waits for their builds and tells you if one fails, so a script or agent doesn't call a function before it's ready. Pass `--no-wait` to return right away. See [`neon deploy`](https://neon.com/docs/cli/deploy).
- You can now connect your app as a specific Postgres role, such as a role with fewer privileges than the owner: `neon env pull --role-name app_user` writes a `DATABASE_URL` for that role. See [`neon env pull`](https://neon.com/docs/cli/env#pull).
- If [`neon.ts`](https://neon.com/docs/reference/neon-ts) lists a service you haven't deployed yet, [`neon env pull`](https://neon.com/docs/cli/env#pull), [`neon link`](https://neon.com/docs/cli/link), and [`neon checkout`](https://neon.com/docs/cli/checkout) now write the variables you do have and tell you to run `neon deploy` for the rest. They also stop overwriting `AWS_*` keys that belong to your own storage.
- [`neon logs query`](https://neon.com/docs/cli/logs#query) now accepts `--source functions`, and `--search` as a shorter name for `--body-contains`.
- Coding agents and CI can now run [`neon bootstrap --install`](https://neon.com/docs/cli/bootstrap) to scaffold a project and install its dependencies in one step, without waiting for a prompt.
- New projects created with [`neon init`](https://neon.com/docs/cli/init) now scaffold their [Object Storage](https://neon.com/docs/storage/overview) bucket as `uploads`, the name the [Object Storage guides](https://neon.com/docs/storage/get-started) use, so the guide examples work as written.
- In Windows PowerShell, comma-separated values like `--services postgres,auth` now work without quotes, for example with [`neon init`](https://neon.com/docs/cli/init).
- [`neon me`](https://neon.com/docs/cli/me) now works in a directory linked to a [claimable project](https://neon.com/docs/cli/claim) and shows the project it authenticates as.

To upgrade, run `npm install -g neon@latest`. See [Install the Neon CLI](https://neon.com/docs/cli/install).

</details>

<details>

<summary>**Neon MCP Server**</summary>

- Your agent can now call any [Neon API](https://neon.com/docs/reference/api) route, including ones the built-in tools don't cover. If you ask it to change a project setting, for example, it looks up the right API route with `search_api` and runs it with `call_api`. See [Neon MCP Server](https://neon.com/docs/ai/neon-mcp-server).
- Your agent now gets the final result of a change from the [Neon MCP Server](https://neon.com/docs/ai/neon-mcp-server). Deleting a branch returns the deleted branch, so the agent can confirm what it removed.
- Read-only [MCP Server](https://neon.com/docs/ai/neon-mcp-server) tool calls now retry when a connection drops before the response arrives, instead of failing with a network error.

</details>

<details>

<summary>**Realtime**</summary>

- Live queries update more efficiently with the [Realtime SDK](https://neon.com/docs/realtime/sdks/typescript/client) 0.2.2: when data changes, the server can now send only the part of a result that changed. It also recovers when a WebSocket gets stuck closing, which could leave live data stale.
- Fixed [Realtime](https://neon.com/docs/realtime/overview) refusing queries with many `LEFT JOIN`s, such as ORM queries that include several related tables.

</details>

<details>

<summary>**Console**</summary>

- Domain auto-join settings have moved from the organization **People** page to **Settings** > **Verified domains**. A new **Auto-add new users** setting there lets you turn automatic joining off without removing your verified domains. It's on by default. See [Add organization members by domain](https://neon.com/docs/manage/orgs-add-members-by-domain).
- Cmd-K now finds every settings page and matches synonyms, so searching for "2fa" or "pitr" takes you to the right setting.
- The support center's AI chat was renamed **Neon Agent** to better describe it. See [Support](https://neon.com/docs/introduction/support#neon-ai-chat-assistance).
- The [Import Data Assistant](https://neon.com/docs/import/import-data-assistant) now checks extensions correctly for Postgres 18 sources. Before, it flagged every extension as unsupported.
- For Vercel-managed organizations, the **Projects** page shows the Vercel project connected to each Neon project, and the Vercel **Branches** page is now a table with preview branches nested under production. See [Vercel-managed integration](https://neon.com/docs/guides/vercel-managed-integration).

</details>

<details>

<summary>**Neon TypeScript SDK**</summary>

- The [Neon TypeScript SDK](https://neon.com/docs/reference/typescript-sdk) 7.16.0 adds `neon.request` for calling any API route, and an `@neon/sdk/openapi` entry point for listing and describing endpoints.

</details>
