Canary
Legal retrieval for Spanish law
An agentic legal assistant for Spanish law. It parses BOE documents into navigable temporal fragments and retrieves them with poly-vector matryoshka embeddings.
AI systems · 2026 · Pablo Hernández

The retrieval problem
A legal question depends on the provision, its surrounding context, and the version in force on a given date. Canary parses BOE documents into a hierarchy of legal fragments. Each fragment keeps its position, citation identity, temporal validity, and references to related material.
From candidate text to legal context
Smaller scout vectors retrieve initial candidates. Larger vectors rerank them, then the document hierarchy supplies surrounding context. References connect provisions to modifications, repeals, and related norms. This preserves relationships that a flat set of text chunks cannot express.
The implementation
Rust owns the parser, HTTP server, database access, and runtime workflows. Axum serves the API, SurrealDB stores operational state, and Temporal handles orchestration. TypeScript supplies the web client, terminal interface, and documentation. Canary is under active development.
For web development or product engineering, contact Pablo Hernández.