AI agents don't have a model problem. They have a context problem. IGOR is infrastructure that transforms unstructured organizational data into context an agent can trust — with lineage, temporal correctness, and fail-closed publication.
dbt Labs published two pieces naming context engineering as the next frontier — the same infrastructure IGOR already ships as working code.
IGOR isn't a response to these posts. It's running code for the infrastructure they're describing. The project structure, CLI commands, and qualification results in this deck are from a working system — not a prototype, not a pitch deck concept.
Context engineering = selecting, transforming, and delivering the right information to AI agents at the right time.
Declarative project definitions, temporal snapshots, authority resolution, contract-governed publication, content-addressed lineage, independent evaluation.
| Spec | Layer | What it governs |
|---|---|---|
| S1 | Source contract | Pinned acquisition, identity fields, connector bindings |
| S2 | Snapshot | Temporal versioning, effective intervals, supersession |
| S3 | Authority + temporal resolution | Policy-driven selection for a requested as_of time |
| S4 | Context contract | Consumer, task, purpose, budgets, deny/abstain behavior |
| S5 | Context package | Fail-closed publication, ranked items, evidence |
| S6 | Lineage | Content-addressed derivation graph, readable display names |
| S7 | Mutation | Selective invalidation, identity-matched reuse |
$ igor init --template recare-legal/v0.1 # scaffold project from template
$ igor deps # resolve and lock dependencies
$ igor sync --live # acquire from Hugging Face
$ igor resolve # compile manifest, plan execution
$ igor qualify --live # run full qualification pipeline
$ igor evaluate --live # independent evaluation: 18/18
Each command produces a JSON artifact under .igor/. The qualification artifact alone is 1.9 MB — every snapshot, decision, contract evaluation, lineage node, and provider call recorded.
No scenario-specific code. The ReCaRe qualification is defined entirely through these YAML declarations — the same CLI commands run any scenario template.
connector_bindings:
huggingface.recare.v1:
connector: huggingface-rows
deployment_ref: kasys/ReCaRe@6281b8c718fa9f6a2ac44fda2498a92ccf47825b
resources:
- resource_id: amendment_articles
source_resource: metadata-en/metadata
fields:
- {concept_id: amendment_law_id, source_field: amendment_law_id}
- {concept_id: amendment_reason, source_field: amendment_reason}
- {concept_id: text_before, source_field: text_before}
- {concept_id: text_after, source_field: text_after}
# ... 14 fields total
The deployment reference includes the exact commit hash. If the upstream dataset changes, IGOR knows — and the source contract defines what happens next.
context_contracts:
legal.research-agent.v1:
permitted_consumers: [legal-analysis-agent]
permitted_tasks: [article-amendment-analysis]
permitted_purposes: [legal-research, amendment-impact-analysis]
required_authority_level: source-authoritative
citations_required: true
budgets:
max_package_items: 20
max_tokens: 10000
abstain_conditions:
- missing_authoritative_evidence
- missing_source_revision_time
prohibited_uses:
- legal-advice
- court-submission
- regulatory-filing
100 items published. Consumer, task, purpose, authority, evidence all satisfied.
Zero packages. Unauthorized consumer or prohibited purpose.
Zero packages. Missing authoritative evidence — not guessed, not published.
SELECT display_name, semantic_score, authority_status,
effective_from, effective_until, snapshot_identity
FROM semantic_search(
'articles relevant to the amendment rationale',
query_vector,
10
)
WHERE authority_status = 'selected'
AND valid_at = '2025-01-06';
Semantic retrieval and structured filtering in one query. The LanceDB execution plan proves the native ANN index was used — not a brute-force scan over all vectors.
Change valid_at to '2007-01-02' and the same data returns different authoritative articles — because the law was different then.
The ReCaRe dataset contains EU legislative amendments — before and after versions of legal articles, with amendment rationale. IGOR processed 100 records spanning 12 amendment events across domains from emissions trading to food safety to professional qualifications.
Acquired from Hugging Face, pinned to revision 6281b8c7
Before + after temporal versions of each article
Across securities, taxation, food safety, emissions, pensions, statistics, criminal justice, professional qualifications, ship pollution, cosmetics
IGOR enriches at the event level, not the row level. Each amendment event gets one Mistral completion call that processes all affected articles together. The structural efficiency is built into the context model, not bolted on.
Mistral Small (2603)
113K tokens total
Voyage Multimodal 3
200 snapshots + 1 query
End to end
0.70s per record
One source record was mutated: Art. 18 "Investment rules" of Directive 2003/41/EC (pension fund regulation). IGOR traced the impact through every derivation layer — snapshot, enrichment, retrieval, resolution, contract, package — and invalidated exactly one output.
337cebd6The evaluator is a separate module that receives only the qualification artifact. It has no access to the pipeline internals — it verifies the outputs against the spec.
as_of = 2025-01-06as_of = 2007-01-02Both queries run against the same 200 snapshots. The authority resolution policy — not retrieval ranking — determines which version is authoritative for the requested time.
| Edge type | Count | What it connects |
|---|---|---|
| ingest | 200 | Source observation → context snapshot |
| supersedes | 100 | After-version → before-version |
| enrichment | 100 | Snapshot → semantic enrichment |
| retrieve | 200 | Snapshot → retrieval candidate |
| resolution | 200 | Candidate → authority decision |
| contract | 100 | Decision → contract evaluation |
| publish | 1 | Contract allow → context package |
| item | 100 | Package → package item |
Every node carries a human-readable display name alongside its SHA-256 identity. Art. 18 "Investment rules" of 32003L0041 at 2013-06-20 — not just sha256:fed5d460...
context_model:
id: recare.legal.context
objects:
amendment_article:
kind: business_object
display_name: "{{ law_id }} Article {{ article_number }}"
article_snapshot:
kind: source_snapshot
display_name: "{{ law_id }} Article {{ article_number }} at {{ effective_from }}"
article_version:
kind: semantic_derivation
derived_from: [article_snapshot]
schema: legal.article.v1
amendment_enrichment:
kind: semantic_derivation
derived_from: [article_version]
recipe: legal.amendment-recipe.v1
model_profile: legal.text.completion.v1
The context model defines what objects exist, how they derive from each other, and what semantic enrichment they receive. Display names use templates — the lineage graph shows 32003L0041 Article 18 at 2013-06-20, not hash soup.
21 articles in Directive 2003/71/EC amended by 2010/73/EU
32 articles in the EU ETS Directive amended by 2023 reform
7 articles on monitoring obligations amended by 2013/20/EU
1 article — the mutation case. Investment rules in pension fund regulation.
5 articles on recognition of qualifications amended by 2024/505/EU
7 articles on maritime enforcement amended by 2024/3101/EU
Plus: taxation, cosmetics safety, statistics/transport, statistics/tourism, criminal justice/info exchange. Same YAML definitions, same CLI commands, same pipeline.
The context contract is evaluated per request. Each evaluation checks consumer identity, task, purpose, authority, evidence, and budget — every gate must pass for publication.
request:
consumer: legal-analysis-agent # ✓ in permitted_consumers
task: article-amendment-analysis # ✓ in permitted_tasks
purpose: legal-research # ✓ in permitted_purposes
as_of: 2025-01-06
evaluation:
consumer_check: pass
task_check: pass
purpose_check: pass
authority_check: pass # source-authoritative evidence found
evidence_check: pass # citations available
budget_check: pass # 100 items ≤ 20 per event
decision: allow # → 100 package items published
consumer: unauthorized-agent
# Not in permitted_consumers
decision: deny
packages: 0
purpose: court-submission
# In prohibited_uses
decision: abstain
packages: 0
Fail-closed: deny and abstain produce zero context packages, zero package items, zero deliverables. The agent receives nothing — not degraded context, not a warning, nothing. This is the difference between best-effort and contract-governed publication.
A context package is the unit of delivery. It's produced only by an allow decision, and every item in it traces back to its source through the full derivation chain.
package_id: sha256:a8f3...
contract_ref: legal.research-agent.v1
decision: allow
consumer: legal-analysis-agent
task: article-amendment-analysis
as_of: 2025-01-06T00:00:00Z
items_count: 100
items:
- display_name: "Art. 4 'Definitions' of 32003L0071"
item_identity: sha256:b91e...
snapshot_identity: sha256:7c0d...
authority_status: selected
effective_from: 2010-12-31
semantic_score: 0.847
enrichment:
amendment_action: modify
rationale_summary: "Harmonize definitions with MiFID..."
source_citation:
dataset: kasys/ReCaRe@6281b8c7
law_id: 32003L0071
article: 4
lineage_root: sha256:e1a4...
package items
with citations
with lineage
with enrichment
Every item includes: the article's human-readable name, semantic enrichment from Mistral, source citation back to the pinned Hugging Face revision, authority status, temporal validity, semantic relevance score, and a lineage root that traces the full derivation path.
DataFusion is the query engine. LanceDB is the vector store. Together they let you write SQL queries that combine ANN semantic retrieval with standard WHERE clauses — no application code, no middleware.
SELECT display_name, semantic_score, authority_status,
amendment_action, rationale_summary,
effective_from, snapshot_identity
FROM semantic_search(
'articles relevant to the amendment rationale',
query_vector, 10
)
WHERE authority_status = 'selected'
AND valid_at = '2025-01-06';
SELECT display_name, authority_status
FROM semantic_search(...)
WHERE valid_at = '2007-01-02';
-- Before-amendment versions selected
-- After-versions don't exist yet
-- Same data, different answer
SELECT display_name, semantic_score
FROM semantic_search(...)
WHERE amendment_action = 'modify'
AND law_id = '32003L0071';
-- Securities directive only
-- Structured + semantic in one query
SELECT display_name, package_id
FROM semantic_search(...)
WHERE contract_decision = 'allow'
AND package_id IS NOT NULL;
-- Only items that passed contract
-- No denied or abstained context
SELECT display_name,
identity_matched, invalidated
FROM mutation_analysis
WHERE invalidated = true;
-- Find exactly what changed
-- Art. 18 "Investment rules" →
-- 1 invalidated, 199 reused
ANNSubIndex { metric: Cosine, nprobes: 10 }
├── IVF partitions scanned: 4/16
├── candidates evaluated: 42
├── filtered by authority_status: 100 → 100 selected
└── wall_time: 8ms
Native ANN path confirmed. Not a brute-force scan — IVF-partitioned cosine retrieval with structured post-filtering.
Run against a fresh ReCaRe project through the IGOR project CLI container. No direct Python, no bypassing the CLI — the same command any operator would run.
$ igor query --target semantic-filter --sql "
SELECT canonical_identity, display_name, source_key,
semantic_score, retrieval_rank, evidence_preview
FROM semantic_search(
'context_catalog',
'amendment rationale',
'full_text', 5
)
ORDER BY retrieval_rank"
| Rank | Article | Score | Evidence preview |
|---|---|---|---|
| 0 | 32010R1095 Article 15 (before) | 3.243 | "The Authority may develop implementing technical standards, by means of implementing acts under Article 291 TFEU..." |
| 1 | 32010R1095 Article 15 (after) | 3.225 | "Where the European Parliament and the Council confer implementing powers on the Commission to adopt implementing technical standards..." |
| 2 | 32010R1095 Article 19 (after) | 1.655 | "In cases specified in the legislative acts referred to in Article 1(2) and without prejudice to the powers laid down in Article 17..." |
Scores are native FTS relevance (higher = better) — passed through unchanged. The SQL says full_text — a vendor-neutral name. The adapter maps it to the vector store's native query type. Swap the retrieval owner for a different store: change one adapter method, zero SQL changes.
runner tests
CLI tests
eval checks
architecture
Every dimension of context quality is measured independently. These are not self-assessed — the evaluator module receives only the qualification artifact, with no access to pipeline internals.
| Metric | Value | What it measures |
|---|---|---|
| Source pinning | 100% | All records trace to pinned revision 6281b8c7 |
| Temporal coverage | 100% | 200/200 snapshots have effective_from, supersession chains complete |
| Authority resolution | 100% | 100/100 after-versions selected, 100/100 before-versions superseded |
| Citation coverage | 100% | Every package item references its source, snapshot, and enrichment |
| Enrichment coverage | 100% | All 100 items enriched with action, rationale, relationship type |
| Lineage coverage | 100% | 617/617 nodes, 1,001/1,001 edges — zero orphans |
| ANN retrieval | native | LanceDB IVF-partitioned, not brute-force |
| Fail-closed | verified | Deny → 0 packages. Abstain → 0 packages. No leakage. |
| Mutation precision | 99.5% | 1 invalidated, 199 reused — zero false invalidations |
| Deterministic ordering | verified | Same input → same output, byte-identical |
Models will keep getting better. Agents will keep getting more capable. But both will keep hallucinating until the context they receive is trustworthy. IGOR is the infrastructure layer that makes context reliable — with contracts, temporal correctness, lineage, and fail-closed publication.
RAG retrieves. IGOR governs. Authority resolution, contract evaluation, selective invalidation, and temporal correctness are infrastructure concerns — not retrieval improvements.
ReCaRe qualification uses Mistral Small for completions and Voyage for embeddings. The infrastructure works with any model behind the provider interface — no vendor lock-in.
No scenario-specific code. ReCaRe legal, financial analysis, healthcare — same CLI, same pipeline, different YAML.
S1–S7: Source Contract, Snapshot, Authority+Temporal Resolution, Context Contract, Context Package, Lineage, Mutation. Published and implementation-neutral.
Financial, healthcare, and legal scenarios through the same declarative project structure and CLI chain.
API serving, streaming updates, OTel instrumentation, and managed context delivery for agent fleets.