Evidence — Profile
Named SQL fences plus Markdoc tags that write their own SQL. The pinned repo is a rewrite that abandoned in-browser DuckDB for live warehouse queries, which is the exact trade flave's parked `sql` fences have not yet made.
- Path
- profiles/Profile__Evidence.md
- Authors
- Michael Staton
- Augmented with
- Claude Code on Claude Opus 5.5
- Tags
- Profile · Evidence · BI · SQL · Markdoc · Reports · MCP
Evidence — Profile
A profile of Evidence as it lives in this study (studies/content-authoring-tools/evidence, pinned at b0aa37512, 2026-11-19). MIT (LICENSE: “Copyright (c) 2026 Evidence”). TypeScript/Svelte, with a Bun-built CLI.
This is the study’s Markdown-as-BI-report entry. Read the pinned tree as a new product, not as the Evidence you may remember. AGENTS.md:7 says “This is a read-only projection of a larger repo”, and docs/migration-guide.mdx:6 draws the line itself: “Legacy Evidence is a static website generator: Markdown and DuckDB SQL which queries data you package up in a build step. Evidence Studio has a live connection to a database, and an updated set of components that can generate SQL.”
TL;DR
A page is a .md file. SQL lives in named code fences, components are Markdoc tags ({% line_chart … /%}), and a component’s data= can be a table, an inline query, or a .sql file path (docs/core-concepts/markdown.mdx:20-76). The README now opens: “Evidence is an agent-ready tool for creating reports using your data” (README.md:8).
One sentence: Evidence is the most agent-ready entry in this group, with Markdown pages, a query CLI, an MCP server and an agent/ skills folder, and it got there by giving up the self-contained, in-browser data bundle in favor of a live warehouse.
How it works
- Layout.
core/(components, query engine, rendering primitives) andcli/(theevidenceCLI that renders reports, built with Bun) (AGENTS.md). The CLI wraps a SvelteKit app with a custom adapter (cli/README.mdarchitecture diagram). - Syntax. Components use Markdoc syntax (
docs/core-concepts/markdown.mdx:22). Markdoc config is incore/src/markdoc/config.ts. Built-in tags live one folder each undercore/src/user-components/tags/. - SQL engine. Fences “run the ClickHouse SQL dialect … (unless you are using a Direct connector)” (
markdown.mdx:36).defaultDialect = new ClickHouseDialect()(core/src/sql-dialect.ts:35), with dialect classes for Snowflake, BigQuery, Postgres, MotherDuck, Databricks, Redshift, SQL Server, Athena, Fabric and Cube (:10-20). - Where the data lives. Either the managed Evidence Warehouse (Evidence extracts from about 140 connector pages listed under
docs/data-sources/,docs/evidence-warehouse.mdx), or aconnection.yamldirect connector for self-hosting/offline work (docs/cli/connections.mdx).evidence serveself-hosts “no Evidence Studio account … required”, but only with a direct connector (docs/cli/commands.mdx:288-306).
What’s on disk
Project folders: pages/, queries/, components/, partials/, plus a reserved agent/ (docs/features/evidence-agent.mdx:35). A page with a named query and a component, from docs/core-concepts/markdown.mdx:39-50:
```sql ten_daily_orders
select * from demo.daily_orders limit 10
```
{% table
data="ten_daily_orders"
%}
A real fixture page (cli/test-environment/pages/order-analysis.md) shows inputs driving charts, with no SQL written at all:
{% dropdown id="channel_filter" data="demo.order_headers"
value_column="sales_channel" title="Sales Channel" initial_value="All" /%}
{% line_chart data="demo.order_headers" x="date" y="count(*)"
series="sales_channel" date_grain={{time_grain}}
filters=["payment_filter"] /%}
Agent reach
Read and write: yes, as text, and the product is designed around it. Pages, queries and components are .md / .sql files in a Git repo. The CLI install docs assume “Claude Code / Cursor etc” (README.md:22).
- CLI for agents:
evidence query(json/jsonl/csv output,--file, stdin),tables,describe,schema,lineage --json(where a table is used across pages, models and queries), andevidence validate --jsonfor syntax and SQL errors (docs/cli/commands.mdx:86-180). An agent can check its own write before a human looks. - MCP: a Studio MCP at
https://evidence.studio/api/mcp(query data, read published reports, runs as the signed-in user) and a no-auth Docs MCP (docs/mcp/overview.mdx,docs/mcp/studio.mdx). Both are hosted, not in this repo. - Agent customization as files:
agent/context/*.mdis always loaded, andagent/skills/<name>/SKILL.mdloads on demand. Both are version-controlled with the pages (docs/features/evidence-agent.mdx:35-53). Even the migration path is a SKILL.md you hand to your coding agent (docs/migration-guide.mdx:12-18).
What’s clever or unique
1. Components write the SQL. {% bar_chart data="orders" x="order_date" y="sum(sales)" /%} takes a table and an aggregate expression. The component generates the query (core/src/user-components/COMPONENT_SYSTEM.md:21-27). The resolution pipeline is two stages: interpolate {{variables}}, then, if the name matches an inline query or SQL file, substitute it as a parenthesized subquery (:56-67). Prose authors get charts without writing GROUP BY, and filters compose in as WHERE clauses.
2. Queries compose by reference. Inside a fence, {{top_categories}} inlines another named query as a subquery (docs/core-concepts/markdown.mdx:53-76). data="/queries/orders_by_date" addresses a .sql file by project path, and a leading slash means project root (docs/features/sql-files.mdx). Named fences and .sql files share one namespace.
3. User-defined components are Markdown files with a typed schema. components/kpi_card.md becomes {% kpi_card /%} (docs/core-concepts/custom-components.mdx:10). Frontmatter declares attributes: with types string | number | boolean | column | query | format | sql | date_range | comparison | filter (:56). Types drive autocomplete, and call sites are validated “while you type”. A preview: block is “the component’s built-in test fixture” (:79-94). Runtime values flow through, so an input passed to a component “becomes a real filter reference (the query re-runs when the input changes)” (:70). There is a {% html %} escape hatch with an evidence.query() JS SDK, run in a sandbox (:215; core/src/user-components/sandbox/).
4. Lineage is a first-class command. evidence lineage table orders answers “where is this table used?” across pages, models and queries, per branch (docs/cli/commands.mdx:153-168). That is dependency provenance, not just rendering.
5. The agent’s knowledge ships with the repo. agent/context/ replaces org-level custom instructions, so business definitions (“Revenue always means net revenue”) are versioned and reviewed like code (docs/features/evidence-agent.mdx:39-49).
Costs / limits
- Not self-contained. Data lives in a warehouse, not in the project. The migration guide lists the trade: “Support for one data warehouse only”, “SQL written in native dialect not DuckDB”, “SQL executes against a backend, not in browser with WASM” (
docs/migration-guide.mdx:34-36). A page is unreadable as a report without a live connection. - Studio gravity. The managed warehouse, the agent and the Studio MCP are Studio-only (
<StudioOnly />snippets).evidence devdefaults toevidence login(docs/cli/connections.mdx). Self-hosting works but loses the managed engine. - A mirror, not the source. Contributions go upstream through a sync (
AGENTS.md:7-11,copy.bara.sky). The nearest Git tag predates the rewrite. - Narrow genre. No citations, footnotes or cross-references. It is a reporting format, not a document format.
- Scalar-only component attributes: lists must be passed as comma-separated strings (
custom-components.mdx:285).
Relevance to flave
- The named
sqlfence is a convergent design. Evidence’s```sql ten_daily_ordersand flave §7.4’s```sql name=arr_by_segmentare the same idea. Evidence adds{{name}}composition between fences and path-addressed.sqlfiles, both worth adopting when the fences are unparked. - Evidence left DuckDB-WASM; flave is headed toward it, and the reasons point opposite ways. Evidence moved to live warehouses because BI wants fresh numbers (
migration-guide.mdx:6,:34-36). flave’s thesis is “a document that keeps its workings”: the data ships in the file. So flave should keep DuckDB-over-data/and borrow the cache-the-result snapshot from [[Profile__Notebook-Kit]], not Evidence’s live connection. - Typed attributes are the missing half of trigger-packs. A trigger-pack is “a Svelte component plus one line of registration”. Evidence’s
attributes:frontmatter (typed,required,default,options,preview:fixture) is a declarative schema a pack could carry alongside its component. It gives agents validation and autocomplete without an inverse serializer. Compare MyST’sDirectiveSpecin [[Profile__mystmd]]. - Aggregate-expression attributes (
y="sum(sales)") are a good model for flave Figures (§7.6): a figure that names a dataset and an expression, not a full query. validate --jsonandlineage --jsonare the agent loop flave needs: write, check, see what depends on it.agent/skills/*/SKILL.mdinside the project is a direct precedent for shipping a document’s own agent instructions inside the.flavebundle.
Read next
docs/core-concepts/markdown.mdx: the whole authoring surface in one pagecore/src/user-components/COMPONENT_SYSTEM.md: howdata=resolves to SQLdocs/core-concepts/custom-components.mdx: typed attributes,preview:fixtures, slotsdocs/migration-guide.mdx: the legacy-to-Studio delta, stated by the vendordocs/features/evidence-agent.mdxanddocs/cli/commands.mdx: the agent surfaces
Related
- [[Profile__Notebook-Kit]]: the snapshot-the-data counterpoint (
.observable/cache), with SQL as a cell type - [[Profile__mystmd]]: typed directive specs and the scholarly features Evidence lacks
- [[Profile__Deepnote]]: the other data-notebook entry with SQL blocks
- [[Profile__Outline]]: another doc tool whose agent surface is a hosted API/MCP