The Last Mile: From Proofs to Answers

Encryption, commitments, ZK proofs, and selective disclosure are all infrastructure. What a developer or AI agent actually needs is an answer: "Give me verified attributes matching this condition."

Lemma's attributes.query API is that last mile. It accepts natural language or structured queries and returns verified attributes with complete provenance metadata.

Natural Language Queries

import { attributes } from "@lemmaoracle/sdk";

const results = await attributes.query(client, {
  query: "users over 18 in Japan",
  mode: "natural",
  proof: { required: true, type: "zk-snark" },
  targets: { schemas: ["user-kyc-v1"] },
});

The response includes, for each matching subject:

This is not a key-value lookup. It is a provenance-rich response that lets your application or AI agent make trust decisions.

RAG Policy Integration

The provenance metadata returned by attributes.query is designed to feed directly into RAG policy layers. Common patterns:

These policies are implemented in your application layer, not in Lemma itself. Lemma provides the facts and their provenance; your application decides which facts to trust.

What Sets This Apart

Traditional oracles return values. Lemma returns values with proof. When your AI says "this user qualifies," it can point to the exact circuit, schema, issuer, and on-chain verification event that supports the claim. This is the difference between an assertion and evidence.