Files
big-agi/docs/config-database.md
T
2024-02-05 10:40:45 -05:00

3.5 KiB

Connecting Your Database for Enhanced Features:

This guide outlines the database options and setup steps for enabling features like Chat Link Sharing in your application.

Choose Your Database:

1. Serverless Postgres (default):

  • Available on Vercel, Neon, and other platforms.
  • Less feature-rich but a suitable option depending on your needs.
  • Connection String: Replace placeholders with your Postgres credentials.
    • postgres://USER:PASS@SOMEHOST.postgres.vercel-storage.com/SOMEDB?pgbouncer=true&connect_timeout=15

2. MongoDB Atlas (alternative):

  • Highly Recommended: More than a database, it's a data platform. MongoDB Atlas is a robust cloud-based platform that offers scalability, security, and a suite of developer tools. No need for a separate vector database, you can query your vector embeddings right within your operational database!
  • Additional Features: MongoDB Atlas is packed with unique features designed to streamline the development process such as: Atlas App Services, Atlas search (with vector search), Atlas charts, Data Federation, and more.
  • Connection String: Replace placeholders with your Atlas credentials.
    • mongodb://USER:PASS@CLUSTER-NAME.mongodb.net/DATABASE-NAME?retryWrites=true&w=majority

Environment Variables:

Postgres:

Variable
POSTGRES_PRISMA_URL postgres://USER:PASS@SOMEHOST.postgres.vercel-storage.com/SOMEDB?pgbouncer=true&connect_timeout=15
POSTGRES_URL_NON_POOLING (optional) URL for the Postgres database without pooling (specific use cases)

MongoDB:

Variable
MDB_URI mongodb://USER:PASS@CLUSTER-NAME.mongodb.net/DATABASE-NAME?retryWrites=true&w=majority

Initial Setup Steps:

  1. Run npx prisma db:push: Create or update the database schema (run once after connecting).

Additional Resources: