Contributing¶
Contributions to RavenRustRAG are welcome. This guide covers the development workflow.
Prerequisites¶
- Rust 1.88+ (MSRV)
- Ollama (for integration tests with real embeddings)
- Git
Getting Started¶
Development Workflow¶
- Check GitHub Issues for open work
- Create a branch from
main - Implement your changes
- Run the full check suite:
- Commit with a conventional message
- Open a Pull Request
Commit Messages¶
Use conventional commits:
feat: add batch embedding support #12
fix: handle empty document gracefully closes #15
refactor: extract BM25 into separate module
docs: add hybrid search documentation
test: add property tests for splitter
perf: switch to DashMap for cache
Code Standards¶
- Edition: Rust 2021
- Async runtime: Tokio (full features)
- Error handling:
thiserrorfor library errors,anyhowonly in CLI - Traits: Use
async-trait; all traits must beSend + Sync - Serialization:
serde+serde_json - Logging:
tracingcrate (info!,warn!,error!— neverprintln!in libraries) - No
unwrap()in library code: Use?and proper error types - Tests: Unit tests in each crate, use
MemoryStore+DummyEmbedderfor isolation
Project Structure¶
ravenrustrag/
├── Cargo.toml # Workspace root
├── book.toml # mdBook config
├── mkdocs.yml # MkDocs config
├── docs/ # Documentation (shared by mkdocs + mdbook)
├── crates/
│ ├── raven-core/ # Foundation types
│ ├── raven-embed/ # Embedding backends
│ ├── raven-split/ # Text chunking
│ ├── raven-load/ # File loading
│ ├── raven-store/ # Vector storage
│ ├── raven-search/ # Pipeline orchestrator
│ ├── raven-server/ # HTTP API
│ ├── raven-mcp/ # MCP server
│ └── raven-cli/ # CLI binary
└── .github/workflows/ # CI/CD
Testing¶
Run all tests:
Run tests for a specific crate:
For test isolation, use MemoryStore (in-memory vector store) and DummyEmbedder (deterministic fake embeddings). This avoids needing Ollama running for unit tests.
Building Documentation¶
MkDocs (primary, used for GitHub Pages)¶
pip install mkdocs-material mkdocs-minify-plugin
mkdocs serve # Local preview at http://127.0.0.1:8000
mkdocs build # Build to site/
mdBook¶
cargo install mdbook
mdbook serve # Local preview at http://127.0.0.1:3000
mdbook build # Build to book/
Release Process¶
Releases are automated via GitHub Actions when a tag is pushed:
This triggers cross-compilation for 5 targets and creates a GitHub Release with binaries and checksums.