Getting Started
Prerequisites
- Rust 1.85+ (2024 edition)
- ~500 MB RAM for ONNX Runtime (BGE-Small model, downloaded on first run)
Build
bash
git clone https://github.com/fabriziosalmi/nis2-model.git
cd nis2-model
cargo build --workspaceRun tests
bash
cargo test --workspace # 61 tests across 6 cratesIndex legal texts
The vector store must be populated before semantic search works:
bash
cargo run --bin indexerThis parses data/sources/nis2_articles.json (35 chunks) and data/sources/dora_articles.json (14 chunks) into LanceDB at data/lancedb/.
Semantic search
bash
cargo run --bin search -- "autenticazione multi-fattore"Generate a compliance report
bash
cargo run --bin report # Italian compliance report (template backend)
cargo run --bin demo # Raw ComplianceStatus JSONStart the REST API server
bash
cargo run --bin api-server # listens on 0.0.0.0:8080
cargo run --bin api-server -- --port 3000 # custom portStart the MCP server
bash
cargo run --bin mcp-server # JSON-RPC over stdioSee MCP Tools for tool definitions.
Run benchmarks
bash
cargo run --bin bench --release