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)
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 viascripts/seed_surfsense_docs.pysurfsense_docs_documentsDesired Behavior
A script (e.g.
surfsense_backend/scripts/seed_db.py) that can populate the database with realistic sample data, including:Use Cases
Suggested Implementation
surfsense_backend/scripts/seed_db.pyas a standalone async script (similar toseed_surfsense_docs.py)--resetflag to wipe and re-seed from scratchpyproject.tomlscript entry pointRelated
surfsense_backend/scripts/seed_surfsense_docs.pysurfsense_backend/app/tasks/surfsense_docs_indexer.pysurfsense_backend/app/db.py(create_db_and_tables)