Thank you for your interest in contributing to Project RAG! We welcome contributions from the community.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/project-rag.git cd project-rag - Add the upstream repository:
git remote add upstream https://github.com/ORIGINAL_OWNER/project-rag.git
Create a new branch for your changes:
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fixFollow these guidelines when making changes:
- Format your code: Run
cargo fmtbefore committing - Lint your code: Run
cargo clippyand fix all warnings - Test your changes: Run
cargo test --liband ensure all tests pass - File size limit: Keep source files under 600 lines (enforced)
- Add unit tests for new functionality
- Ensure existing tests still pass
- Use
#[cfg(test)]modules in the same file as the code being tested - Example:
#[cfg(test)] mod tests { use super::*; #[test] fn test_your_feature() { // Your test here } }
- Use descriptive variable and function names
- Add doc comments for public APIs
- Use
anyhow::Resultfor error handling - Add
.context("Description")to provide error context - Follow existing patterns in the codebase
Write clear, descriptive commit messages:
git add .
git commit -m "Add feature: description of your changes"Good commit message examples:
Add support for Python language detectionFix binary file detection thresholdUpdate FastEmbed to use safe Mutex patternAdd tests for sliding window chunking
-
Push your changes to your fork:
git push origin feature/your-feature-name
-
Go to GitHub and create a Pull Request from your fork to the main repository
-
In your PR description:
- Describe what changes you made and why
- Reference any related issues (e.g., "Fixes #123")
- Include any testing you performed
- Note any breaking changes
- Respond to feedback from maintainers
- Make requested changes by pushing new commits to your branch
- Your PR will be merged once approved
Before submitting your PR, make sure:
- Code is formatted with
cargo fmt - No warnings from
cargo clippy - All tests pass with
cargo test --lib - New functionality includes tests
- Source files are under 600 lines
- Commit messages are clear and descriptive
- PR description explains the changes
We welcome contributions in these areas:
- Adding support for new programming languages
- Improving documentation
- Adding more unit tests
- Fixing typos or clarifying comments
- Alternative embedding models
- AST-based code chunking
- Configuration file support (TOML)
- Persistent hash cache for incremental updates
- Additional MCP tools or prompts
- Any bugs you encounter while using the project
- Performance improvements
- Memory optimization
-
Install Rust (1.83+ with Rust 2024 edition support):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Install protobuf compiler:
# Ubuntu/Debian sudo apt-get install protobuf-compiler
Note: LanceDB is the default embedded database and requires no additional setup. If using the optional Qdrant backend, start a Qdrant server:
docker run -p 6333:6333 -p 6334:6334 \
-v $(pwd)/qdrant_data:/qdrant/storage \
qdrant/qdrant# Build and run
cargo build
cargo run
# Run tests
cargo test --lib
# Check without building
cargo check
# Format code
cargo fmt
# Run lints
cargo clippy- Open an issue on GitHub for bug reports or feature requests
- Use discussions for questions about using or contributing to the project
By contributing to Project RAG, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing!