Skip to content

[FEATURE] : Seed general user data for demo/testing purposes #1160

@JoeMakuta

Description

@JoeMakuta

Summary

SurfSense currently only seeds SurfSense documentation into the database on startup (seed_surfsense_docs). There is no way to seed general user data (search spaces, connectors, users, etc.) for development, testing, or demo purposes.

Current Behavior

  • seed_surfsense_docs() runs automatically on backend startup and via scripts/seed_surfsense_docs.py
  • It only indexes MDX documentation files into surfsense_docs_documents
  • No seeder exists for core application data

Desired Behavior

A script (e.g. surfsense_backend/scripts/seed_db.py) that can populate the database with realistic sample data, including:

  • Users — sample user accounts (for non-OAuth auth modes)
  • Search Spaces — one or more pre-configured search spaces per user
  • Connectors — example connector configurations (e.g. GitHub, Notion, etc.)
  • Documents & Chunks — a small set of sample documents with embeddings
  • Podcasts / Chats — optional sample conversation history

Use Cases

  • Local development: quickly get a working app state without manual setup
  • Testing: reproducible DB state for integration/E2E tests
  • Demo environments: pre-populated data to showcase the product

Suggested Implementation

  • Add surfsense_backend/scripts/seed_db.py as a standalone async script (similar to seed_surfsense_docs.py)
  • Make it idempotent (safe to run multiple times)
  • Support a --reset flag to wipe and re-seed from scratch
  • Optionally expose it as a pyproject.toml script entry point

Related

  • surfsense_backend/scripts/seed_surfsense_docs.py
  • surfsense_backend/app/tasks/surfsense_docs_indexer.py
  • surfsense_backend/app/db.py (create_db_and_tables)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions