Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.litigationlabs.io/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Langfuse uses PostgreSQL for transactional data and only uses the public schema. To keep Langfuse separate from the app’s Payload data, use a dedicated database in the same Neon project. Create a second database in your Neon project (e.g. langfuse). Langfuse will use that database and its public schema.

1. Create the Database

Neon Console (easiest)
  1. Open Neon Console and select your project.
  2. Go to Branches -> select your branch -> Databases.
  3. Click Create and name it langfuse.
SQL Editor
CREATE DATABASE langfuse;
CLI
neon databases create --name langfuse

2. Connection String

Use the same host and credentials as your existing Neon URL, and only change the database name:
  • Current (app): postgresql://USER:PASSWORD@ep-XXX-pooler.REGION.aws.neon.tech/neondb?sslmode=require
  • Langfuse: postgresql://USER:PASSWORD@ep-XXX-pooler.REGION.aws.neon.tech/langfuse?sslmode=require

3. Environment Variables

When self-hosting Langfuse, set:
  • DATABASE_URL — Connection string above (pooled URL is fine).
  • DIRECT_URL — Same URL or a direct (non-pooled) URL for migrations.

4. Use from this Repo (.env.local)

This project keeps Langfuse URLs in .env.local:
  • LANGFUSE_DATABASE_URL — Pooled URL (use as DATABASE_URL in Langfuse)
  • LANGFUSE_DIRECT_URL — Direct/unpooled URL (use as DIRECT_URL for migrations)
DATABASE_URL=$LANGFUSE_DATABASE_URL
DIRECT_URL=$LANGFUSE_DIRECT_URL

5. Optional: Script

pnpm tsx scripts/create-langfuse-database.ts

Option 2: Same Database (neondb)

You can run Langfuse against your existing neondb database. Langfuse will use the public schema. Your app uses PAYLOAD_DB_SCHEMA=payloadcms, so tables won’t conflict.
  • Pros: One database, no new DB to create.
  • Cons: Langfuse and app share the same DB; backups and scaling are shared.

Summary

ApproachWhere Langfuse LivesWhat You Do
New DB (recommended)New DB langfuse -> publicCreate DB in Neon, set DATABASE_URL with /langfuse.
Same DBExisting neondb -> publicSet Langfuse DATABASE_URL to your current Neon URL.