Canonry is a self-hosted, agent-first AEO platform. It measures brand mentions and domain citations for tracked queries across its supported providers. Its content engine and integrations use those observations. The Local adapter captures no structured sources, so its answers contribute to mention measurements only.
A project can define named locations and a default location. An Advanced Measurement plan also assigns queries and measurement contexts to Properties and markets.
The local installation runs as a single Node.js process with SQLite and an in-process job runner.
flowchart LR
User["Analyst"]
Target["AI answer engines"]
subgraph Process["canonry serve"]
direction LR
SPA["Static SPA<br/>/"] --> API["Fastify API<br/>/api/v1/*"]
API --> JobRunner["In-process<br/>job runner"]
API --> SQLite["SQLite"]
JobRunner --> Registry["Provider<br/>Registry"]
Registry --> Gemini["provider-gemini"]
Registry --> OpenAI["provider-openai"]
Registry --> OpenRouter["provider-openrouter (model routes)"]
Registry --> Muse["provider-muse"]
Registry --> Claude["provider-claude"]
Registry --> Perplexity["provider-perplexity"]
Registry --> Local["provider-local"]
Registry --> CDP["provider-cdp"]
Registry --> AnswerServices["provider-answer-services (profiles)"]
JobRunner --> SQLite
end
User --> SPA
User -. CLI .-> API
Gemini --> Target
OpenAI --> Target
OpenRouter --> Target
Muse --> Target
Claude --> Target
Perplexity --> Target
Local --> Target
CDP --> Target
AnswerServices --> Target
packages/canonry/ — publishable npm package (@canonry/canonry). Bundles CLI, Fastify server, job runner, and pre-built SPA.packages/api-routes/ — shared Fastify route plugins. The HTTP surface consumed by the local cnry serve process.packages/db/ — Drizzle ORM schema, backed by SQLite. Auto-migration on startup.packages/provider-*/ — Provider adapters. Each implements ProviderAdapter from contracts.packages/contracts/ — shared DTOs, enums, config-schema (Zod), error codes.apps/web/ — Vite SPA source. Built and bundled into packages/canonry/assets/.canonry run <project> with the project default location, an explicit --location, --all-locations, or no location contextlost, emerging) are computed at query time by comparing each measured snapshot with the last measured one before it. A not-measured snapshot is skipped, so it never gains or loses a citationflowchart TD
subgraph Apps
web["apps/web"]
api["apps/api"]
end
subgraph Packages
canonry["packages/canonry"]
routes["packages/api-routes"]
contracts["packages/contracts"]
db["packages/db"]
config["packages/config"]
intelligence["packages/intelligence"]
end
subgraph Providers
gemini["provider-gemini"]
openai["provider-openai"]
openrouter["provider-openrouter"]
muse["provider-muse"]
claude["provider-claude"]
local["provider-local"]
perplexity["provider-perplexity"]
cdp["provider-cdp"]
answerServices["provider-answer-services"]
end
subgraph Integrations
gsc["integration-google"]
ga4["integration-google-analytics"]
bing["integration-bing"]
wp["integration-wordpress"]
end
web -.-> contracts
api --> routes & db & config & contracts
canonry --> routes
canonry --> db
canonry --> config
canonry --> contracts
canonry --> intelligence
canonry --> gemini & openai & openrouter & muse & claude & local & perplexity & cdp & answerServices
routes --> db
routes --> contracts
routes --> gsc & ga4 & bing & wp
gemini & openai & openrouter & muse & claude & local & perplexity & cdp & answerServices --> contracts
gsc & ga4 & bing & wp --> contracts
db --> contracts
Key rules:
packages/api-routes/ must not import from apps/*.packages/canonry/ is published to npm. All other packages are bundled via tsup.@canonry/canonry-* naming convention.stateDiagram-v2
[*] --> queued: POST /runs
queued --> running: Job runner picks up
running --> completed: All providers succeed
running --> partial: Some providers fail
running --> failed: All providers fail
running --> cancelled: User cancels
completed --> [*]
partial --> [*]
failed --> [*]
cancelled --> [*]
Transitions:
queued → running: Job runner dequeues and starts executing providersrunning → completed: The sweep finished with all planned answersrunning → partial: The sweep saved answers and recorded provider errors, skipped providers, or a plan shortfallrunning → failed: The sweep saved no answers and recorded a failurerunning → cancelled: User explicitly cancelled via APIThe shared ProviderAdapter interface
defines execution, normalization, and optional capabilities such as batch
dispatch and text generation. The provider registry registers configured
connections. OpenRouter model routes and search answer service profiles use
their connection’s credentials and quota. Each route requires explicit selection.
The job runner executes the selected work and normalizes responses before it
persists them in query_snapshots. Plan-aware runs can store several answers
for one query and provider when the execution contexts differ.
Ad-hoc research uses the same provider adapters through a separate
research_runs → research_run_queries executor. It persists returned answer
evidence and applies the same provider quota guards, but it never creates a
tracked query, shared run, snapshot, insight, notification, or schedule event.
Run canonry serve on your own machine, a VPS, or a container. One process serves the SPA and REST API, runs jobs and schedules, and uses SQLite. See the deployment guide for setup.
The standalone apps/api entry point mounts the shared REST routes on Cloud Run and uses SQLite. The full engine runs through canonry serve.
@canonry/agent-readiness (formerly @canonry/aeo-audit) — published
audit engine used by the local packages/canonry Agent Readiness executor. It
provides the full-site crawl event and graph contract.apps/api/ — standalone Cloud Run REST entry point.packages/api-routes/ — HTTP surface, validation, orchestration, read APIs.packages/canonry/ — CLI, local server, job runner (the publishable artifact).packages/provider-*/ — Provider adapters and normalization layers.packages/integration-*/ — External service clients (Google, Bing, GA4, WordPress).packages/db/ — schema, migrations, database access.packages/contracts/ — DTOs, enums, config validation, error codes.packages/config/ — typed environment parsing.apps/web/ — SPA source code.@canonry/agent-readiness pin explicit@canonry/agent-readiness full crawlsThese remain separate to avoid mixing Agent Readiness with live-answer visibility.
Canonry ships a built-in AI agent (Aero) backed by @earendil-works/pi-agent-core, plus a webhook path for external agents (Claude Code, Codex, custom). See packages/canonry/src/agent/AGENTS.md for the full surface.
packages/canonry/src/agent/ (session.ts, session-registry.ts, tools.ts, agent-routes.ts).agent_sessions holds the active conversation and agent_conversations holds archived ones. Enabled viewer sessions are separate and in memory.RunCoordinator queues operator follow-ups after eligible runs. Probe runs do not wake Aero.canonry agent attach <project> --url <webhook-url> registers a webhook for run.completed, insight.critical, insight.high, citation.gained, mention.gained.The agent layer is a consumer of the same CLI/API surface — nothing in it is privileged. Per AGENTS.md, “If an AI agent can’t do something with canonry <command> --format json or an HTTP call, it’s a bug.”
packages/canonry bundles @canonry/canonry-integration-typesafe, whose only internal dependency is contracts. The adapter owns pinned Jev request construction and parsing; the host owns credentials and scheduling. Evidence is resolved to exact original sentence spans. Offline corpus scoring and the independent-evaluation targets, not yet met, live under evals/sentiment/.