memql

command module
v0.22.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

README

MemQL

MemQL

Build applications where AI can work with your data, tools, and workflows.

MemQL is an open-source AI platform. Its engine combines typed, versioned records and relationships with queries, mutations, model routing, agent work, and event-driven automations. A single .memql language connects those pieces. Integrations bring in external systems; hosted sites and SDKs give people a way to use what you build.

Alpha / pre-1.0 — not production-ready. Expect breaking changes to the language, engine API, and wire protocol. Start with experiments and prototypes.

Get started · Documentation · Visual Studio Code and Cursor extension · MemQL OS

One engine, several ways to work

Part What it does Where you use it
MemQL engine Stores the memory graph, enforces declared access rules, executes constructs, routes model calls, and records agent work A cluster, reached through gRPC or the browser WebSocket bridge
MemQL OS The browser workspace for managing that cluster and working with its data Apps such as Fleet, Files, Deployables, Nexus, Concepts, and Logs
MemQL for Visual Studio Code and Cursor Edits .memql files offline; connects to clusters to inspect, run, and train constructs Your editor
Your applications Present your own product using MemQL's capabilities A hosted site or an external client built with an SDK

The engine is built on a time-series memory graph backed by PostgreSQL, TimescaleDB, and pgvector. That storage supports the platform; MemQL also runs the behavior around it. The agent harness is its durable work system, one part of the broader product. Explore the capabilities.

Start with something you can inspect

A concept describes a kind of record. A query names a reusable read operation. Here is a caller-owned reading list:

@rowAuthz(owner="ownerUserId")
concept readingItem {
  ownerUserId  string!
  title        string!
  finished     bool
}

@actor
query readingItem readingItems {
  args {
    finished  bool
  }
  filter row => row.ownerUserId == actor.userId && (args.finished == nil || row.finished == args.finished)
  sort "row.createdAt", "desc"
  paginate 50
}

@actor supplies the authenticated caller. The query filters to that caller, and @rowAuthz declares the ownership tier. paginate 50 bounds the first page. The complete reading-list tutorial adds a mutation and a tool, explains how to validate the file, and walks through running it in VS Code or Cursor. Saving a file does not deploy it.

Get started

A visual workspace for the cluster

MemQL OS is a single-page application made of focused apps. Fleet manages machines and execution resources; Files holds artifacts; Deployables manages what is served; Nexus exposes goals, runs, and approvals. It uses the same engine APIs as other clients.

Supervised Visual Composition is the approved design direction: compose objects and their relationships with mouse and keyboard, and review MemQL's proposals in the same visible workspace. Fleet provides visual composition, persistent routing-policy editing, and review of typed Ask proposals; generating proposals requires compatible inference to be configured. The approved Deployables redesign is implemented and verified locally. New Settings/Logs layouts await approval; generalized autonomous UI driving is future work.

Does it work?

The platform measures itself, and publishes what it did not measure with the same prominence as what it did. Every figure carries a median, its spread, its N, and the commit it came from; a figure nothing measured says so in words rather than reporting a zero.

Measured on every pull request, against the same model in a bare tool loop with the platform's machinery switched off:

  • A run stopped mid-plan resumes from its own journal and re-executes no step that already completed.
  • Its side effects are not delivered twice.
  • A goal the catalog already holds is compiled without reaching a model -- not even the cheap triage classifier.

Each zero ships with a negative control that must produce a non-zero, because a counter that never rises on any path reads as zero forever. Full figures, including everything a replay cannot honestly answer: the proving scorecard.

Go deeper

Contribute

See CONTRIBUTING.md for development and checks. Run make test for the workspace suite; testing only the root module does not reach all engine modules. Engine implementation guidance lives in CLAUDE.md. Report reproducible problems through GitHub issues. For security reports, follow SECURITY.md.

License

MemQL is licensed under Apache 2.0. Bundled infrastructure has its own licensing; see the database platform guide.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package app implements the phased bootstrap for the MemQL service.
Package app implements the phased bootstrap for the MemQL service.
cmd
admin-preview command
Command admin-preview renders the templ-backed pages the identity service still serves, with representative mock data, into /tmp/admin-preview/.
Command admin-preview renders the templ-backed pages the identity service still serves, with representative mock data, into /tmp/admin-preview/.
attributematrix command
Command attributematrix writes the attribute matrix page (docs/public/language/attribute-matrix.md) from the annotation registry in component/language/annotations and, with -check, fails when the committed page is stale (memql#5360).
Command attributematrix writes the attribute matrix page (docs/public/language/attribute-matrix.md) from the annotation registry in component/language/annotations and, with -check, fails when the committed page is stale (memql#5360).
conceptsnapshot command
Command conceptsnapshot regenerates the committed per-concept field snapshot and, in --check mode, fails when the committed copy has gone stale (memql#5209).
Command conceptsnapshot regenerates the committed per-concept field snapshot and, in --check mode, fails when the committed copy has gone stale (memql#5209).
deploy-gate-check command
Command deploy-gate-check is the in-cluster deploy-gate client (deployment-v2 Phase 3, znasllc-io/memql#701/#712).
Command deploy-gate-check is the in-cluster deploy-gate client (deployment-v2 Phase 3, znasllc-io/memql#701/#712).
docs-gen command
docs-gen emits the machine-generated reference for the documentation bundle: a concept catalog derived from the live DSL.
docs-gen emits the machine-generated reference for the documentation bundle: a concept catalog derived from the live DSL.
envscan command
Command envscan is the shared env-var classifier for Epic 7 (memql#2103).
Command envscan is the shared env-var classifier for Epic 7 (memql#2103).
envscan/scan
Package scan is the reusable core of the env-var classifier for Epic 7 (memql#2103).
Package scan is the reusable core of the env-var classifier for Epic 7 (memql#2103).
frontdoorhosts command
Command frontdoorhosts emits front-door manifests for each instance overlay from the cluster's role set and its domain.
Command frontdoorhosts emits front-door manifests for each instance overlay from the cluster's role set and its domain.
frontdoorpaths command
Command frontdoorpaths emits the Ingress path entries for the bff's HTTP edge on api.<domain>.
Command frontdoorpaths emits the Ingress path entries for the bff's HTTP edge on api.<domain>.
healthcheck command
Package main provides a minimal health check binary for distroless containers.
Package main provides a minimal health check binary for distroless containers.
memql-arch command
memql-arch walks a Go workspace and emits a topology.model.json describing its architecture: cluster, services, packages, types, and the relationships between them.
memql-arch walks a Go workspace and emits a topology.model.json describing its architecture: cluster, services, packages, types, and the relationships between them.
memql-bench command
Command memql-bench runs the proving corpus and publishes what it measured.
Command memql-bench runs the proving corpus and publishes what it measured.
memql-lsp command
Command memql-lsp is the MemQL offline Language Server: a standalone binary that speaks LSP over stdio and serves .memql files from disk, with no cluster and no auth (handoff Part I §4).
Command memql-lsp is the MemQL offline Language Server: a standalone binary that speaks LSP over stdio and serves .memql files from disk, with no cluster and no auth (handoff Part I §4).
memql-lsp/internal/grammar
Package grammar generates the baseline TextMate grammar (memql.tmLanguage.json) for .memql files from the machine-readable DSL spec (component/language/dslspec) and the v1 function catalog (component/language/functions) -- the same sources of truth MemQL Sense projects from.
Package grammar generates the baseline TextMate grammar (memql.tmLanguage.json) for .memql files from the machine-readable DSL spec (component/language/dslspec) and the v1 function catalog (component/language/functions) -- the same sources of truth MemQL Sense projects from.
memql-lsp/internal/position
Package position converts between LSP and MemQL Sense coordinate systems -- the single most likely source of bugs in the language server (handoff §4), so it is isolated here and gated by table-driven round-trip tests.
Package position converts between LSP and MemQL Sense coordinate systems -- the single most likely source of bugs in the language server (handoff §4), so it is isolated here and gated by table-driven round-trip tests.
memqlfmt command
memqlfmt is the canonical formatter for MemQL source files.
memqlfmt is the canonical formatter for MemQL source files.
memqllint command
memqllint runs the same DSL-load + diagnostic pipeline the engine runs at startup, on demand against a .memql file or a whole DSL root.
memqllint runs the same DSL-load + diagnostic pipeline the engine runs at startup, on demand against a .memql file or a whole DSL root.
memqlmigrate command
memqlmigrate applies named syntax rewrites to MemQL source files.
memqlmigrate applies named syntax rewrites to MemQL source files.
shopifyschema command
Package main -- allowlist.go: the reviewed list of what gets mirrored.
Package main -- allowlist.go: the reviewed list of what gets mirrored.
component
backup
Package backup is MemQL's portable data export: a whole cluster's graph written as a stream a LATER engine can still read.
Package backup is MemQL's portable data export: a whole cluster's graph written as a stream a LATER engine can still read.
campaigns
Package campaigns is the email-campaign SENDING ENGINE (memql#3348): the worker that drains v1:campaigns:sendJob rows, the suppression and idempotency rules that decide who actually gets mailed, the RFC 8058 one-click unsubscribe endpoint, and the DSL-callable surface an operator starts a send from.
Package campaigns is the email-campaign SENDING ENGINE (memql#3348): the worker that drains v1:campaigns:sendJob rows, the suppression and idempotency rules that decide who actually gets mailed, the RFC 8058 one-click unsubscribe endpoint, and the DSL-callable surface an operator starts a send from.
conceptfields
Package conceptfields reads what every concept in the DSL tree DECLARES -- its top-level field names, which of them are required, and the values of every enum -- and holds the committed snapshot of that answer.
Package conceptfields reads what every concept in the DSL tree DECLARES -- its top-level field names, which of them are required, and the values of every enum -- and holds the committed snapshot of that answer.
datasync
Package datasync is the RUNTIME half of data origins (epic memql#4378): the outbox drain worker, the inbound dispatcher, and the backfill and reconciliation runners.
Package datasync is the RUNTIME half of data origins (epic memql#4378): the outbox drain worker, the inbound dispatcher, and the backfill and reconciliation runners.
edge
component/edge/assetcache.go
component/edge/assetcache.go
logstore
Package logstore is the log store (epic memql#4893, design record docs/superpowers/specs/2026-09-03-logs-design.md): every node's log lines persisted beside the observability rows in a dedicated log_line hypertable, thirty days of retention with an archive before the sweep, and the Go-served reads the v1:observability:logLine builtins are executed by.
Package logstore is the log store (epic memql#4893, design record docs/superpowers/specs/2026-09-03-logs-design.md): every node's log lines persisted beside the observability rows in a dedicated log_line hypertable, thirty days of retention with an archive before the sweep, and the Go-served reads the v1:observability:logLine builtins are executed by.
packages
Package packages is the offline analysis that decides whether a tree is a deployable MemQL package, and what deploying it would do.
Package packages is the offline analysis that decides whether a tree is a deployable MemQL package, and what deploying it would do.
packages/githubapp
Package githubapp is the engine's half of the cluster's GitHub App (epic memql#4912, C1/C6).
Package githubapp is the engine's half of the cluster's GitHub App (epic memql#4912, C1/C6).
proving
Package proving runs the proving corpus and turns it into figures.
Package proving runs the proving corpus and turns it into figures.
proving/capability
Package capability implements the capability-script contract for a Go binary.
Package capability implements the capability-script contract for a Go binary.
proving/cassette
Package cassette is the CI tier's recorded model responses.
Package cassette is the CI tier's recorded model responses.
proving/figure
Package figure is the proving suite's honesty layer: a measured number, what it was measured on, and the vocabulary for saying that it was not measured at all.
Package figure is the proving suite's honesty layer: a measured number, what it was measured on, and the vocabulary for saying that it was not measured at all.
proving/scenario
Package scenario is the proving corpus's format: what a scenario says, and what the loader refuses.
Package scenario is the proving corpus's format: what a scenario says, and what the loader refuses.
proving/scorecard
Package scorecard is the committed artifact and the page generated from it.
Package scorecard is the committed artifact and the page generated from it.
proving/world
Package world is the fake external world a proving scenario runs against.
Package world is the fake external world a proving scenario runs against.
sitehealth
Package sitehealth measures published websites independently of their desired deployment state.
Package sitehealth measures published websites independently of their desired deployment state.
sitepublish
site_publish.go -- deploy a Library artifact to a hosted site (memql#4345).
site_publish.go -- deploy a Library artifact to a hosted site (memql#4345).
sitetraffic
Package sitetraffic is the edge's request log and the traffic figure folded from it (epic memql#4906, the Run epic of the Deployables program).
Package sitetraffic is the edge's request log and the traffic figure folded from it (epic memql#4906, the Run epic of the Deployables program).
actions module
architecture module
auth module
automations module
bus module
bus/gen module
compose module
config module
database module
deploycontrol module
envregistry module
events module
fileprocessor module
frontdoor module
genesis module
grpc module
grpc/gen module
harness module
healing module
identity module
inbound module
language module
language/ast module
mcp module
memql module
metadata module
metrics module
node module
node/gen module
observe module
outbound module
planner module
polyphon module
provenance module
router module
safety module
secret module
server module
service module
skills module
work module
worker module
workjournal module
core module
docs module
dsl module
examples
deploypack
Package deploypack is the MemQL DEPLOY PACK (Epic 2 / #2095) -- the dogfood pack that packages MemQL's own deployment workflow as a MemQL pack.
Package deploypack is the MemQL DEPLOY PACK (Epic 2 / #2095) -- the dogfood pack that packages MemQL's own deployment workflow as a MemQL pack.
referencepack
Package referencepack is the minimal REFERENCE PACK for the MemQL pack model (epic 2, issue 2.5).
Package referencepack is the minimal REFERENCE PACK for the MemQL pack model (epic 2, issue 2.5).
reviewspack
Package reviewspack is the client-agnostic reviews pack (memql#4139).
Package reviewspack is the client-agnostic reviews pack (memql#4139).
shopifypack
Package shopifypack is the client-agnostic Shopify pack (memql#4138).
Package shopifypack is the client-agnostic Shopify pack (memql#4138).
integrations module
email module
openai module
stt module
scripts
audit-pagination command
audit-pagination enumerates every list-returning query in the DSL tree and reports how each is bounded -- the pagination authoring rule audit (epic 5, issue 5.1 / memql#1965).
audit-pagination enumerates every list-returning query in the DSL tree and reports how each is bounded -- the pagination authoring rule audit (epic 5, issue 5.1 / memql#1965).
ci
Package ci hosts the static guards that verify this repository's CI configuration is what it claims to be.
Package ci hosts the static guards that verify this repository's CI configuration is what it claims to be.
cidb
Package cidb holds the CI drift gate for the db-tests lane (memql#2886).
Package cidb holds the CI drift gate for the db-tests lane (memql#2886).
citags
Package citags holds the CI drift gate for build-tagged test suites (memql#2903).
Package citags holds the CI drift gate for build-tagged test suites (memql#2903).
cluster/rolling-drain command
Command rolling-drain sends a single operator maintenance/drain trigger (memql#1270) to ONE target node and prints the typed result as JSON.
Command rolling-drain sends a single operator maintenance/drain trigger (memql#1270) to ONE target node and prints the typed result as JSON.
install/graph
Package graph is the install/uninstall STEP GRAPH: the declarative description of what a local MemQL cluster install does, in what order, what each step must prove before the next one runs, and what uninstall has to take back afterwards.
Package graph is the install/uninstall STEP GRAPH: the declarative description of what a local MemQL cluster install does, in what order, what each step must prove before the next one runs, and what uninstall has to take back afterwards.
migrate-concepts command
migrate-concepts reads all JSON-based concept definitions and generates concept.memql files.
migrate-concepts reads all JSON-based concept definitions and generates concept.memql files.
migrations/construct_invocation command
Command construct_invocation migrates the authored .memql tree from the legacy call forms to the kind-prefixed construct-invocation forms introduced in Story 2 (#2324) of epic #2322.
Command construct_invocation migrates the authored .memql tree from the legacy call forms to the kind-prefixed construct-invocation forms introduced in Story 2 (#2324) of epic #2322.
migrations/event_payload_args command
Command event_payload_args is the G5 (memql#2367 / event-payload-binding ADR Decision 6) tree migrator: for every FULL-FORM event-triggered automation it
Command event_payload_args is the G5 (memql#2367 / event-payload-binding ADR Decision 6) tree migrator: for every FULL-FORM event-triggered automation it
migrations/expressions_go_fixtures command
Command expressions_go_fixtures carries the MemQL source that Go test files embed in string literals onto the edition-2026 expression forms (epic memql#5363, memql#5368), with the rewrite `memqlmigrate --rewrite=expressions` runs over .memql files (langparser.RewriteExpressions).
Command expressions_go_fixtures carries the MemQL source that Go test files embed in string literals onto the edition-2026 expression forms (epic memql#5363, memql#5368), with the rewrite `memqlmigrate --rewrite=expressions` runs over .memql files (langparser.RewriteExpressions).
restructure-by-construct command
scripts/restructure-by-construct/main.go reorganizes dsl/<domain>/*.memql so that each construct kind lives in its own file:
scripts/restructure-by-construct/main.go reorganizes dsl/<domain>/*.memql so that each construct kind lives in its own file:
sdk-gen command
sdk-gen is the thin CLI wrapper over the importable generator package (sdk/gen).
sdk-gen is the thin CLI wrapper over the importable generator package (sdk/gen).
secrets command
scripts/secrets is a slim operator tool invoked internally by MemQL's dev-refresh flow.
scripts/secrets is a slim operator tool invoked internally by MemQL's dev-refresh flow.
sdk
gen
Package gen is the importable core of the typed-SDK generator.
Package gen is the importable core of the typed-SDK generator.
go/authoring
Package authoring is the Go SDK surface for MemQL's authoring operations -- the cockpit-facing way to VALIDATE and SESSION-DEFINE a user "bundle" (a set of .memql sources) over the engine's gRPC stream (issue memql#2128 / C1).
Package authoring is the Go SDK surface for MemQL's authoring operations -- the cockpit-facing way to VALIDATE and SESSION-DEFINE a user "bundle" (a set of .memql sources) over the engine's gRPC stream (issue memql#2128 / C1).
go/client
Package client is the canonical Go SDK for talking to a MemQL cluster.
Package client is the canonical Go SDK for talking to a MemQL cluster.
go/constructs
Package constructs is the Go SDK surface for the construct CATALOG -- what a cluster has actually loaded, at registry grain (memql#3749).
Package constructs is the Go SDK surface for the construct CATALOG -- what a cluster has actually loaded, at registry grain (memql#3749).
go/dslspec
Package dslspec is the Go SDK surface for the MemQL DSL spec export -- the portable, versioned JSON form of the DSL authoring surface (the top-level constructs, keywords, operators, field types, per-construct annotation legality, and "legal-next" completion rules).
Package dslspec is the Go SDK surface for the MemQL DSL spec export -- the portable, versioned JSON form of the DSL authoring surface (the top-level constructs, keywords, operators, field types, per-construct annotation legality, and "legal-next" completion rules).
go/modules
Package modules is the Go SDK surface for the module registry (epic memql#4183) -- the runtime inventory of what an instance runs: components, integrations, packs, and node-type modules, plus the one write, flipping a pack's per-instance enablement.
Package modules is the Go SDK surface for the module registry (epic memql#4183) -- the runtime inventory of what an instance runs: components, integrations, packs, and node-type modules, plus the one write, flipping a pack's per-instance enablement.
go/pack
Package pack is the Go SDK surface for the MemQL pack browser -- the read-only enumeration of a node's embedded + plugin-registered .memql tree.
Package pack is the Go SDK surface for the MemQL pack browser -- the read-only enumeration of a node's embedded + plugin-registered .memql tree.
go/sense
Package sense is the Go SDK surface for MemQL Sense -- the language-intelligence service that powers editor affordances over .memql source: syntax tokens, diagnostics, autocompletion, hover docs, and signature help.
Package sense is the Go SDK surface for MemQL Sense -- the language-intelligence service that powers editor affordances over .memql source: syntax tokens, diagnostics, autocompletion, hover docs, and signature help.
go/voice
Package voice is the SDK's voice subpackage.
Package voice is the SDK's voice subpackage.
go/worker
Package worker is the SDK's worker subpackage.
Package worker is the SDK's worker subpackage.
test
authoring
Package authoring holds the slice of the MemQL authoring / dry-run suite that needs the AUTOMATION STEPS registered as well as the engine.
Package authoring holds the slice of the MemQL authoring / dry-run suite that needs the AUTOMATION STEPS registered as well as the engine.
conformance
Package conformance is the automated MCP conformance suite (memql#1715), the capstone regression gate for epic #1704.
Package conformance is the automated MCP conformance suite (memql#1715), the capstone regression gate for epic #1704.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL