Thank you for your interest in contributing! This document provides guidelines and information for contributors.
- Python 3.11+
- Ollama with qwen2.5:7b
- Tesseract OCR
- Git
# Clone the repository
git clone https://github.com/alihassan/sovereign-order-intelligence.git
cd sovereign-order-intelligence
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/macOS
# venv\Scripts\activate # Windows
# Install with dev dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=src --cov-report=html
# Run specific test file
pytest tests/test_grader.py -v# Format code
black src/ tests/
# Lint code
ruff check src/ tests/
# Type checking
mypy src/src/
├── llm/ # LLM client, embeddings, prompts
├── storage/ # ChromaDB, caching
├── tools/ # Tavily, OCR, scraper
├── models/ # Pydantic data models
├── graphs/ # LangGraph workflows
├── processors/ # Business logic (grader, document)
├── api/ # FastAPI server
├── ui/ # Streamlit UI
└── cli.py # CLI entry point
- Use Black for formatting (line length: 100)
- Follow PEP 8
- Use type hints everywhere
- Write docstrings for all public functions
Use conventional commits format:
feat: add vendor comparison feature
fix: correct OCR text extraction for PDFs
docs: update API documentation
test: add tests for grading workflow
refactor: simplify document processor
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
pytest tests/ -v) - Run linting (
ruff check src/) - Commit your changes
- Push to your fork
- Open a Pull Request
- Tests pass
- Linting passes
- Documentation updated (if applicable)
- Type hints added
- Docstrings added
- Create file in
src/tools/ - Implement async functions
- Add LangGraph-compatible wrapper if needed
- Add tests in
tests/ - Update
DOCS.md
- Add route in
src/api/server.py - Add request/response models
- Update
API.md - Add tests in
tests/test_api.py
- Add node function in
src/graphs/ - Update state definition if needed
- Wire into graph with edges
- Add tests
- Local deployment for data sovereignty
- Easy model switching
- GPU/CPU flexibility
- Embedded vector database
- No external service needed
- Persistent storage
- Cyclic graph support (RAG loops)
- State management
- Easy debugging
- CPU-optimized (no GPU required)
- Low memory footprint (~200MB)
- Well-established and reliable
- Open an issue for bugs
- Start a discussion for feature requests
- Check existing issues before creating new ones
By contributing, you agree that your contributions will be licensed under the MIT License.