Context infrastructure for AI agents

IGOR turns changing data into reliable, traceable, task-ready context

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.

Qualified against 100 EU legal records across 12 domains
617
lineage nodes
1,001
edges
18/18
eval checks
69.7s
100 records

The problem

Agents hallucinate because they get the wrong context, not because models are bad

Today

  • RAG returns "relevant" chunks with no authority
  • No temporal awareness — yesterday's law looks identical to today's
  • Best-effort publication — wrong context gets flagged, not blocked
  • No lineage — when an output is wrong, you can't trace why
  • Cache invalidation by TTL, not content identity

With IGOR

  • Authority resolved by declared policy, not retrieval rank
  • Same data + different point in time = different authoritative answer
  • Fail-closed — deny and abstain produce zero packages
  • Every output traceable through 8 layers to its source
  • Content-addressed invalidation — SHA-256, not timestamps

Market timing

dbt Labs just named the category. IGOR already runs in it.

dbt Labs published two pieces naming context engineering as the next frontier — the same infrastructure IGOR already ships as working code.

dbt Labs: Context engineering is the new analytics engineering
dbt Labs Blog
"Context engineering is the new analytics engineering: a practical guide for dbt users"
Beyond the Semantic Layer: Context Architecture for AI-Native Analytics
Medium
"Beyond the Semantic Layer: Why Context Architecture May Define AI-Native Analytics"

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.

What dbt Labs is saying

Context engineering = selecting, transforming, and delivering the right information to AI agents at the right time.

What IGOR already does

Declarative project definitions, temporal snapshots, authority resolution, contract-governed publication, content-addressed lineage, independent evaluation.

Architecture

8-layer derivation chain: every output traceable to its source

1
Source
2
Snapshot
3
Enrich
4
Retrieve
5
Resolve
6
Contract
7
Package
8
Item
SpecLayerWhat it governs
S1Source contractPinned acquisition, identity fields, connector bindings
S2SnapshotTemporal versioning, effective intervals, supersession
S3Authority + temporal resolutionPolicy-driven selection for a requested as_of time
S4Context contractConsumer, task, purpose, budgets, deny/abstain behavior
S5Context packageFail-closed publication, ranked items, evidence
S6LineageContent-addressed derivation graph, readable display names
S7MutationSelective invalidation, identity-matched reuse

Developer experience

Six commands from empty directory to independently evaluated context

$ 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.

Declarative project

Context infrastructure defined in YAML, not code

recare-legal/v0.1/ ├── igor_project.yml # project identity and schema version ├── runtime.yml # CLI command bindings ├── packages.yml # dependency declarations ├── igor.lock # pinned dependency versions ├── sources/ │ └── legal_amendments.yml # source contract + Hugging Face binding ├── models/ │ └── legal_context.yml # context model: objects, derivations, tests ├── schemas/ │ └── legal.yml # domain data schemas ├── enrichments/ │ └── legal.yml # enrichment recipe and prompt version ├── taxonomies/ │ └── legal.yml # amendment action taxonomy ├── policies/ │ └── legal.yml # authority + temporal resolution policy ├── retrievals/ │ └── article_search.yml # ANN vector retrieval configuration ├── contracts/ │ └── legal_agent.yml # context contract for consumer agent ├── profiles/ │ ├── completions.yml # completion model profile │ ├── embeddings.yml # embedding model profile │ └── providers/ │ ├── mistral-small-4-text.yaml │ └── voyage-multimodal-3.yaml ├── outputs/ │ └── legal_delivery.yml # package output configuration ├── evals/ │ └── qualification.yml # evaluation suite definition ├── semantic-definition.yaml # amendment enrichment taxonomy ├── domain-schema.yaml # domain-specific type definitions ├── coverage.yaml # coverage requirements ├── selection.json # selected amendment events └── fixtures.json # deterministic test fixtures

No scenario-specific code. The ReCaRe qualification is defined entirely through these YAML declarations — the same CLI commands run any scenario template.

Source contract

Pinned to a specific dataset revision, not "latest"

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 contract

Publication governed by explicit rules, not best-effort

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

Allow

100 items published. Consumer, task, purpose, authority, evidence all satisfied.

Deny

Zero packages. Unauthorized consumer or prohibited purpose.

Abstain

Zero packages. Missing authoritative evidence — not guessed, not published.

Semantic SQL

DataFusion: query context with WHERE clauses on semantic search

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.

ReCaRe qualification

100 EU legal amendment records, 12 domains, one pipeline

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.

100 records

Acquired from Hugging Face, pinned to revision 6281b8c7

200 snapshots

Before + after temporal versions of each article

12 events

Across securities, taxation, food safety, emissions, pensions, statistics, criminal justice, professional qualifications, ship pollution, cosmetics

Provider efficiency

12 completions for 12 events — not 100 per row

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.

12 completions

Mistral Small (2603)
113K tokens total

201 embeddings

Voyage Multimodal 3
200 snapshots + 1 query

69.7 seconds

End to end
0.70s per record

Selective invalidation

1 source changed. 1 output invalidated. 199 reused.

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.

199 identity-matched reuse (99.5%) 1 invalidated (0.5%)

Invalidated

  • Art. 18 "Investment rules"
  • Law: 32003L0041
  • SHA: 337cebd6
  • Snapshot, enrichment, decision, and package item all invalidated
  • Previous version remains queryable

Why this isn't cache invalidation

  • Content-addressed (SHA-256), not time-based (TTL)
  • Impact traced through all 8 derivation layers
  • Invalidated snapshot preserved for historical queries
  • Zero wasted provider calls for unchanged content

Generated artifacts

Every CLI command produces a traceable output

.igor/ # all generated state, gitignored ├── target/ # compiled project state │ ├── manifest.json # resolved context model │ ├── graph.json # dependency graph │ ├── catalog.json # discovered relations │ ├── execution-plan.json # what will run │ ├── sync.json # acquisition result │ ├── resolve.json # resolution decisions │ ├── query.json # retrieval results │ ├── qualify.json # qualification binding │ ├── evaluate.json # evaluation binding │ ├── status.json # project status │ └── compile-report.html # human-readable report ├── sources/ │ └── acquisition.json # raw acquisition artifact └── runtime/ ├── qualification/ │ └── qualification.json # 1.9 MB — full qualification └── evaluation/ └── evaluation.json # independent evaluation

Independent evaluation

18 checks, all passing — verified by a separate evaluator

The 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.

Source pinning
Schema validity
Snapshot preservation
Temporal correctness
Authority correctness
Superseded exclusion
Native semantic retrieval
Query vector provenance
Contract allow/deny/abstain
Fail-closed publication
Mutation invalidation
Unaffected reuse
Deterministic ordering
Artifact integrity
Lineage coverage
Live provider coverage
Historical selection
Temporal grounding

Temporal correctness

Same data, different point in time, different authoritative answer

Current query

  • as_of = 2025-01-06
  • After-amendment versions selected as authoritative
  • Before-amendment versions rejected (superseded)
  • Result: current state of the law

Historical query

  • as_of = 2007-01-02
  • Before-amendment versions selected (they were current then)
  • After-amendment versions don't exist yet
  • Result: the law as it was in 2007

Both queries run against the same 200 snapshots. The authority resolution policy — not retrieval ranking — determines which version is authoritative for the requested time.

Lineage

617 nodes, 1,001 edges — every derivation traceable

Edge typeCountWhat it connects
ingest200Source observation → context snapshot
supersedes100After-version → before-version
enrichment100Snapshot → semantic enrichment
retrieve200Snapshot → retrieval candidate
resolution200Candidate → authority decision
contract100Decision → contract evaluation
publish1Contract allow → context package
item100Package → 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

Declared once, reused across deterministic and live runs

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.

What the 100-record run proves

Not a toy — infrastructure that works across domains

Securities / Prospectus

21 articles in Directive 2003/71/EC amended by 2010/73/EU

Emissions trading

32 articles in the EU ETS Directive amended by 2023 reform

Food safety / Zoonoses

7 articles on monitoring obligations amended by 2013/20/EU

Pensions / Investment

1 article — the mutation case. Investment rules in pension fund regulation.

Professional qualifications

5 articles on recognition of qualifications amended by 2024/505/EU

Ship-source pollution

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.

Contract evaluation flow

Three requests, three different outcomes — all from the same data

The context contract is evaluated per request. Each evaluation checks consumer identity, task, purpose, authority, evidence, and budget — every gate must pass for publication.

ALLOW Authorized legal research agent
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
DENY Unauthorized agent
consumer: unauthorized-agent
# Not in permitted_consumers
decision: deny
packages: 0
ABSTAIN Prohibited purpose
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.

Context package

What the agent actually receives — traceable, bounded, cited

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.

context_package 1 package, 100 items
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...

100

package items

100%

with citations

100%

with lineage

100%

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 semantic SQL

Query context like data — semantic search meets structured filtering

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.

Current authoritative context
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';
Historical state (2007)
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
Filter by domain
SELECT display_name, semantic_score
FROM semantic_search(...)
WHERE amendment_action = 'modify'
  AND law_id = '32003L0071';
-- Securities directive only
-- Structured + semantic in one query
Package-eligible only
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
Mutation impact
SELECT display_name,
       identity_matched, invalidated
FROM mutation_analysis
WHERE invalidated = true;
-- Find exactly what changed
-- Art. 18 "Investment rules" →
--   1 invalidated, 199 reused
LanceDB execution plan (captured)
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.

Live query proof

Real SQL, real data, real results — through the CLI, not a notebook

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"
RankArticleScoreEvidence 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.

59

runner tests

33

CLI tests

18/18

eval checks

pass

architecture

Context quality metrics

Quantified trust — not just "it works"

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.

MetricValueWhat it measures
Source pinning100%All records trace to pinned revision 6281b8c7
Temporal coverage100%200/200 snapshots have effective_from, supersession chains complete
Authority resolution100%100/100 after-versions selected, 100/100 before-versions superseded
Citation coverage100%Every package item references its source, snapshot, and enrichment
Enrichment coverage100%All 100 items enriched with action, rationale, relationship type
Lineage coverage100%617/617 nodes, 1,001/1,001 edges — zero orphans
ANN retrievalnativeLanceDB IVF-partitioned, not brute-force
Fail-closedverifiedDeny → 0 packages. Abstain → 0 packages. No leakage.
Mutation precision99.5%1 invalidated, 199 reused — zero false invalidations
Deterministic orderingverifiedSame input → same output, byte-identical

Provider accounting

Completions
Model: Mistral Small (2603)
Calls: 12 (one per event)
Tokens: 113,241 total
Avg latency: 2.1s per call
Embeddings
Model: Voyage Multimodal 3
Calls: 201 (200 snapshots + 1 query)
Dimensions: 1024
Index: IVF with 16 partitions
End-to-end timing
4.2s
Acquisition
12.1s
Snapshots
28.4s
Enrichment
8.3s
Retrieval
16.7s
Resolution + Package
Total: 69.7 seconds for 100 records across 12 domains — 0.70s per record

Why this matters

Context infrastructure is the missing layer in the AI stack

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.

Not another RAG framework

RAG retrieves. IGOR governs. Authority resolution, contract evaluation, selective invalidation, and temporal correctness are infrastructure concerns — not retrieval improvements.

Model-independent

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.

Declarative, not imperative

No scenario-specific code. ReCaRe legal, financial analysis, healthcare — same CLI, same pipeline, different YAML.

What's next

From qualification to production

Open specification

S1–S7: Source Contract, Snapshot, Authority+Temporal Resolution, Context Contract, Context Package, Lineage, Mutation. Published and implementation-neutral.

Multi-scenario qualification

Financial, healthcare, and legal scenarios through the same declarative project structure and CLI chain.

Production runtime

API serving, streaming updates, OTel instrumentation, and managed context delivery for agent fleets.