Skip to content

rose-database (CLI, Advanced)

This page covers the low-level database-specific CLI tools: rose-mongo and rose-neo4j. These are advanced tools for database-specific maintenance tasks.

Use rose-tenant Instead

For most tenant operations, use rose-tenant which provides unified management across both MongoDB and Neo4j with consistency guarantees.

Installation

Both CLI tools are available after activating the Poetry shell in the backend directory:

cd backend
poetry shell

rose-mongo

MongoDB-specific operations for the vector storage layer.

Usage

rose-mongo --env <environment> <command> [OPTIONS]

Available Commands

Run rose-mongo --help to see all available commands:

Command Description
test-connection Test MongoDB connection
test-envs Test connections to all environments
list-tenants List all tenant data
inspect-tenant Inspect data for specific tenant
clear-tenant Clear all data for tenant
clear-orphaned Clear orphaned documents with missing tenant IDs
consistency-check Check database consistency for LightRAG data
sanitize-name Show sanitized tenant name for company
copy-tenant Copy tenant data between environments

Example

# Test MongoDB connection
rose-mongo --env staging test-connection

# Check consistency
rose-mongo --env staging consistency-check

rose-neo4j

Neo4j-specific operations for the knowledge graph layer.

Usage

rose-neo4j --env <environment> <command> [OPTIONS]

Available Commands

Run rose-neo4j --help to see all available commands:

Command Description
test-connection Test Neo4j connection
test-envs Test connections to all environments
list-databases List all company databases
create-database Create database for company
ensure-database Ensure database exists for company
database-info Get information about a database
drop-database Drop a database
drop-company Drop database for company
sanitize-name Show sanitized database name for company
copy-company Copy company data between environments
most-recent-env Find which environment has the most recent data
compare-envs Compare data between two environments
verify-labels Verify label standardization logic

Example

# Test Neo4j connection
rose-neo4j --env staging test-connection

# List all databases
rose-neo4j --env staging list-databases

When to Use These Tools

Use rose-mongo or rose-neo4j directly when you need:

  • Database-specific diagnostics: Consistency checks, orphan cleanup
  • Low-level operations: Database creation/deletion, label verification
  • Debugging: When rose-tenant operations fail and you need to investigate

For all other tenant operations, prefer rose-tenant.