-
Notifications
You must be signed in to change notification settings - Fork 929
feat(docs): add AI apps page and add framework guide referenceso llms.txt #7885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aidankmcalister
wants to merge
4
commits into
main
Choose a base branch
from
feat/best-postgres-for-ai-apps-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+97
−0
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
da4ed95
feat(docs): rewrite AI apps page and add framework guide references t…
aidankmcalister 9776d24
fix(docs): incorrect codeblock fencing
aidankmcalister 1f96874
Merge branch 'main' into feat/best-postgres-for-ai-apps-page
aidankmcalister 06807bb
fix(docs): wording update
aidankmcalister File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
76 changes: 76 additions & 0 deletions
76
apps/docs/content/docs/postgres/best-postgres-for-ai-apps.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| --- | ||
| title: Best Postgres for AI apps | ||
| description: Why Prisma Postgres works well for AI and LLM workloads — built-in pooling, query caching, edge connectivity, pgvector, and MCP support. | ||
| url: /postgres/best-postgres-for-ai-apps | ||
| metaTitle: Best managed Postgres for AI apps | Prisma Postgres | ||
| metaDescription: Prisma Postgres for AI apps — built-in connection pooling, query caching for RAG pipelines, edge-native connectivity, pgvector support, and a first-party MCP server for agent workflows. | ||
| --- | ||
|
|
||
| AI apps have a different database profile than traditional web apps. Requests burst unpredictably, the same embeddings get retrieved repeatedly, inference runs at the edge, and agents increasingly need direct database access. Most managed Postgres services weren't designed with those patterns in mind. | ||
|
|
||
| Here's how Prisma Postgres handles them. | ||
|
|
||
| ## Built-in connection pooling | ||
|
|
||
| Serverless inference endpoints open a new database connection per invocation. At any meaningful load, that exhausts your Postgres connection limit fast. Prisma Postgres includes connection pooling by default — no pgBouncer to configure, no sidecar to run. | ||
|
|
||
| Your connection string already points to the pooler. Nothing extra to set up. | ||
|
|
||
| ## Query caching for RAG pipelines | ||
|
|
||
| Users asking similar questions trigger semantically similar retrievals. Without caching, every request is a full round-trip to the database. Prisma Postgres includes globally distributed query caching via Prisma Accelerate — opt in per query: | ||
|
|
||
| ```ts title="app.ts" | ||
| const chunks = await prisma.documentChunk.findMany({ | ||
| where: { documentId, similarity: { gte: 0.8 } }, | ||
| cacheStrategy: { ttl: 60, swr: 30 }, | ||
| }) | ||
| ``` | ||
|
|
||
| Repeated retrievals are served from edge nodes close to your users instead of from the database region. | ||
|
|
||
| ## Edge-native connectivity | ||
|
|
||
| Standard Postgres TCP drivers don't work in Cloudflare Workers, Vercel Edge Functions, or Deno Deploy. Prisma Postgres ships `@prisma/ppg`, a serverless driver that connects over HTTP — no workarounds needed. | ||
|
|
||
| See [Serverless driver](/postgres/database/serverless-driver) for setup. | ||
|
|
||
| ## pgvector for embeddings | ||
|
|
||
| Prisma Postgres supports the `pgvector` extension for storing and querying vector embeddings natively in Postgres. You can keep your embeddings alongside your application data without a separate vector store. | ||
|
|
||
| See [Postgres extensions](/postgres/database/postgres-extensions) for how to enable it. | ||
|
|
||
| ## MCP server for agent workflows | ||
|
|
||
| AI agents (Claude, Cursor, or custom) can connect to Prisma Postgres via the Prisma MCP server to introspect schemas, run queries, apply migrations, and manage environments — without raw SQL access. | ||
|
|
||
| See [Prisma MCP server](/ai/tools/mcp-server) for setup. | ||
|
|
||
| ## At a glance | ||
|
|
||
| | | Prisma Postgres | Neon | Supabase | | ||
| |---|---|---|---| | ||
| | **Built-in connection pooling** | Yes, included by default | Yes, PgBouncer-compatible | Yes, Supavisor pooler | | ||
| | **Query-level caching** | Yes — global via Accelerate | No native query cache | No native query cache | | ||
| | **Serverless / edge driver** | Yes — `@prisma/ppg` | Yes — `@neondatabase/serverless` | Partial, requires configuration | | ||
| | **pgvector support** | Yes | Yes | Yes | | ||
| | **MCP server** | Yes — official first-party | Yes — Neon MCP server | Yes — Supabase MCP server | | ||
| | **Database branching** | No | Yes | Limited | | ||
| | **Free tier** | Yes | Yes | Yes | | ||
|
|
||
| The query caching row is the differentiator for AI workloads. If you're building RAG pipelines or anything with repeated retrieval patterns, that column matters. | ||
|
|
||
| ## Get started | ||
|
|
||
| ```npm | ||
| npm create prisma@latest | ||
| ``` | ||
|
|
||
| Or provision from the [Prisma Console](https://console.prisma.io) and grab your connection string. | ||
|
|
||
| - [Connect to Prisma Postgres](/postgres/database/connecting-to-your-database) | ||
| - [Enable query caching](/accelerate/caching) | ||
| - [Use the serverless driver at the edge](/postgres/database/serverless-driver) | ||
| - [Enable pgvector](/postgres/database/postgres-extensions) | ||
| - [Set up the Prisma MCP server](/ai/tools/mcp-server) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.