SensibleDB is a high-performance graph-vector database built in Rust, optimized for RAG and AI applications. It combines graph traversals, vector similarity search, and full-text search in a single database.
We welcome contributions from the community! This guide will help you get started with contributing to SensibleDB.
- Check existing GitHub Issues to avoid duplicates
- Use a clear, descriptive title
- Include steps to reproduce for bugs
- Provide system information (OS, Rust version, SensibleDB version)
- Add relevant logs or error messages
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/sensibledb-db.git cd sensibledb-db - Create a feature branch from
main:git checkout -b feature/your-feature-name
- Make your changes following our coding guidelines
- Commit your changes with clear, descriptive commit messages:
git commit -m "feat: add new feature description" - Push to your fork:
git push origin feature/your-feature-name
- Open a Pull Request against the
mainbranch - Respond to feedback from reviewers
- Link related issues in the PR description
- Ensure all tests pass
- Add tests for new features
- Update documentation if needed
- Keep PRs focused on a single feature or fix
- Write clear commit messages following conventional commits format
- Rust: 1.75.0 or later (install via rustup)
- Cargo: Comes with Rust
- Git: For version control
- cargo-watch: For development auto-reloading
- cargo-nextest: Faster test runner
- rust-analyzer: IDE support
-
Clone the repository:
git clone https://github.com/SensibleDB/sensibledb-db.git cd sensibledb-db -
Build all components:
cargo build
-
Build in release mode (optimized):
cargo build --release
- CLI only:
cargo build -p sensibledb-cli - Core database:
cargo build -p sensibledb-db - Container:
cargo build -p sensibledb-container
-
Install the CLI (development version):
cargo install --path sensibledb-cli
-
Initialize a test project:
mkdir test-project && cd test-project nexus init
-
Deploy locally:
nexus push dev
The heart of SensibleDB containing all database functionality.
-
sensibledb_engine/- Database engine implementationbm25/- Full-text search using BM25 algorithmstorage_core/- LMDB-based storage backend via heed3traversal_core/- Graph traversal operations and query executionvector_core/- Vector storage and HNSW similarity searchtests/- Integration and unit teststypes.rs- Core type definitionsmacros.rs- Helper macros
-
sensibledb_gateway/- Network layerbuiltin/- Built-in query handlers (node_by_id, all_nodes_and_edges, node_connections, nodes_by_label)embedding_providers/- Integration with embedding servicesrouter/- Request routing to handlersworker_pool/- Concurrent request processing (formerly thread_pool)mcp/- Model Context Protocol supportgateway.rs- Main gateway implementationintrospect_schema.rs- Schema introspection utilities
-
sensibledbc/- Query compilerparser/- Parser for.hxfiles (using Pest grammar)analyzer/- Type checking, validation, and diagnosticsgenerator/- Rust code generation from parsed queries
-
grammar.pest- 295-line Pest grammar defining SensibleQL syntax -
protocol/- Wire protocol and data types -
utils/- Shared utilities across the codebase
The server process that hosts compiled queries and handles requests.
Files:
main.rs- Initializes graph engine and HTTP gatewayqueries.rs- Generated code placeholder (populated during build)docker-compose.yml- Container orchestration configurationDockerfile- Development container image
Architecture:
- Loads compiled queries via inventory crate route discovery
- Creates SensibleGraphEngine with LMDB storage backend
- Starts SensibleGateway on configured port (default: 6969)
- Routes HTTP requests to registered handlers
Environment Variables:
SENSIBLE_DATA_DIR- Database storage locationSENSIBLE_PORT- Server port
User-facing CLI for managing SensibleDB instances and deployments.
Directory Structure:
sensibledb-cli/
├── src/
│ ├── commands/ # CLI command implementations
│ │ ├── integrations/ # Cloud deployment integrations
│ │ │ ├── docker_hub.rs
│ │ │ ├── ecr.rs # AWS ECR
│ │ │ ├── fly.rs # Fly.io
│ │ │ ├── ghcr.rs # GitHub Container Registry
│ │ │ └── nexus.rs # SensibleDB Cloud
│ │ ├── add.rs # Add dependencies
│ │ ├── auth.rs # Authentication (login/logout/create-key)
│ │ ├── build.rs # Build queries
│ │ ├── check.rs # Validate schema and queries
│ │ ├── compile.rs # Compile queries
│ │ ├── delete.rs # Delete instances
│ │ ├── init.rs # Initialize new projects
│ │ ├── metrics.rs # Metrics configuration
│ │ ├── migrate.rs # Database migrations
│ │ ├── prune.rs # Cleanup unused resources
│ │ ├── pull.rs # Pull from cloud deployments
│ │ ├── push.rs # Push to cloud deployments
│ │ ├── start.rs # Start instances
│ │ ├── status.rs # Instance status
│ │ ├── stop.rs # Stop instances
│ │ └── update.rs # Update CLI
│ ├── tests/ # CLI tests
│ ├── config.rs # Configuration management
│ ├── docker.rs # Docker integration
│ ├── errors.rs # Error handling
│ ├── lib.rs # Library interface
│ ├── main.rs # Entry point
│ ├── metrics_sender.rs # Metrics collection
│ ├── project.rs # Project management
│ ├── update.rs # Self-update functionality
│ └── utils.rs # Utilities
Available Commands:
nexus add- Add dependencies to projectnexus auth- Authentication management (login/logout/create-key)nexus build- Build queries without deployingnexus check- Validate schema and query syntaxnexus compile- Compile queries to Rust codenexus delete- Remove instance and datanexus init- Create new project with template filesnexus metrics- Configure metrics collection (full/basic/off/status)nexus migrate- Run database migrationsnexus prune- Clean up unused resourcesnexus pull- Pull deployment from cloudnexus push- Push deployment to cloud (dev/staging/prod)nexus start- Start stopped instancesnexus status- Show instance statusnexus stop- Stop running instancesnexus update- Update CLI to latest version
Deployment Integrations:
- SensibleDB Cloud (managed hosting)
- AWS ECR (Elastic Container Registry)
- Fly.io
- Docker Hub
- GitHub Container Registry (GHCR)
- Local deployment
Build & Deploy Flow:
- Read
.hxfiles (schema.hx, queries.hx) - Parse and analyze using sensibledbc
- Generate Rust code with handler functions
- Write to container/src/queries.rs
- Build release binary with optimizations
- Push to target deployment (cloud or local)
Procedural macros for SensibleDB including route registration and code generation utilities.
Test files for the Nexus Query Language (SensibleQL).
Performance benchmarking and metrics collection.
SensibleDB uses a custom query language defined in .hx files:
QUERY addUser(name: String, age: I64) =>
user <- AddN<User({name: name, age: age})
RETURN user
- Nodes (N::) - Graph vertices with properties
- Edges (E::) - Relationships between nodes
- Vectors (V::) - High-dimensional embeddings
- Graph traversals:
In,Out,InE,OutE - Vector search: HNSW-based similarity search
- Text search: BM25 full-text search
- CRUD:
AddN,AddE,Update,Drop
- Definition: Write queries in
.hxfiles - Compilation:
nexus checkparses and validates - Deployment:
nexus deployloads into container - Execution: Gateway routes requests to compiled handlers
- Storage: LMDB handles persistence with ACID guarantees
- Prefer functional patterns (pattern matching, iterators, closures)
- Document code inline - no separate docs needed
- Minimize dependencies
- Use asserts liberally in production code
Run Clippy to check code quality:
./clippy_check.shThe clippy_check.sh script at the repository root runs clippy with project-specific rules:
- Treats warnings as errors
- Excludes
sensibleql-testscrate - Can run in dashboard mode with additional features
SensibleDB has a comprehensive test suite organized across multiple levels:
Unit Tests (within src/ directories)
/sensibledb-db/src/sensibledb_engine/tests/- Engine unit tests/sensibledb-db/src/sensibledb_gateway/tests/- Gateway unit tests- Inline
#[cfg(test)]modules throughout the codebase
Integration Tests
/sensibledb-db/tests/- Database integration tests
CLI Tests
/sensibledb-cli/src/tests/- Command-line interface testscheck_tests.rs- Validation testingcompile_tests.rs- Compilation testinginit_tests.rs- Project initializationproject_tests.rs- Project management
SensibleQL End-to-End Tests
/sensibleql-tests/tests/- 54+ test directories covering:- Graph operations (add_n, add_e, traversals)
- Vector search (search_v_with_embed)
- Text search (search_bm25)
- Aggregations and counting
- Migrations
- Cloud queries
- Rerankers
- Knowledge graphs
- Benchmarks
Benchmark Tests
/sensibledb-db/benches/bm25_benches.rs- Full-text search performance/sensibledb-db/benches/hnsw_benches.rs- Vector search performance
# Run all tests
cargo test --workspace
# Run specific crate tests
cargo test -p sensibledb-db
cargo test -p sensibledb-cli
# Run SensibleQL tests
cd sensibleql-tests
./test.sh
# Run benchmarks
cargo test --benches- Write tests for all new features
- Include both positive and negative test cases
- Add benchmarks before optimizing performance-critical code
- Ensure tests pass locally before opening PR
- DST (Deterministic Simulation Testing) coming soon
- Currently 1000x faster than Neo4j for graph operations
- On par with Qdrant for vector search
- LMDB provides memory-mapped performance
- Discord: Join our Discord community for real-time discussions, questions, and support
- GitHub Issues: Report bugs or request features at github.com/SensibleDB/sensibledb-db/issues
- Documentation: Check docs.sensibledb-db.com for comprehensive guides
- Twitter/X: Follow @sensibledb for updates and announcements
- Search existing GitHub issues and Discord for similar questions
- Check the documentation for relevant guides
- Try to create a minimal reproducible example
- Include error messages, logs, and system information
- Be respectful and constructive
- Help others when you can
- Share your use cases and learnings
- Follow our Code of Conduct
- Correctness: Does the code work as intended?
- Tests: Are there adequate tests? Do they pass?
- Code style: Does it follow Rust and SensibleDB conventions?
- Performance: Are there obvious performance issues?
- Documentation: Are complex parts explained?
- Scope: Is the PR focused on a single feature/fix?
- Failing tests or CI checks
- No tests for new functionality
- Breaks existing functionality
- Code style violations
- Too broad in scope (mixing multiple unrelated changes)
- Missing documentation for complex features
- Performance regressions without justification
- Address all reviewer comments
- Ask for clarification if feedback is unclear
- Make requested changes in new commits (don't force push during review)
- Mark conversations as resolved after addressing them
- Be patient and respectful - reviewers are volunteers
- Initial response: Usually within 2-3 days
- Follow-up reviews: 1-2 days after updates
- Complex PRs may take longer
- Feel free to ping on Discord if your PR hasn't been reviewed after a week
- Install CLI:
curl -sSL "https://install.sensibledb-db.com" | bash - Install Nexus:
nexus install - Initialize project:
nexus init --path <path> - Write queries in
.hxfiles - Deploy:
nexus deploy
AGPL (Affero General Public License)
For commercial support: founders@sensibledb-db.com