Guides functions
SQL table functions for managing Guides — markdown documents that capture metric definitions, join conventions, and domain context that AI agents use to answer your organization's data questions correctly.
Guides are identified by UUID, consistent with Dives and Flights. An optional topic — a slash-separated grouping label like revenue-billing or core/metrics — groups related guides for browsing and filtering. Topics carry no uniqueness: multiple guides can share a topic.
These functions run server-side on MotherDuck. They are not available on local-only DuckDB connections.
Use Guides through the MotherDuck MCP server to let AI assistants read and write them automatically, or run the SQL functions directly from any MotherDuck connection.
-- List all guides visible to you
SELECT * FROM MD_LIST_GUIDES();
-- Read a guide by id
SELECT title, content FROM MD_GET_GUIDE(id = '<guide_uuid>');
-- Create a guide
SELECT id, topic, title, current_version
FROM MD_CREATE_GUIDE(
topic = 'revenue-billing',
title = 'MRR and ARR Definitions',
content = '# MRR and ARR Definitions ...',
access = 'organization'
);
Available functions
MD_LIST_GUIDES
List Guides visible to you, filtered by topic subtree or reference
MD_GET_GUIDE
Read a Guide's full content by id, optionally at a historical version
MD_CREATE_GUIDE
Create a new Guide — a markdown document capturing org-specific context for AI agents
MD_UPDATE_GUIDE
Append a version to an existing Guide with updated content or references
MD_UPDATE_GUIDE_METADATA
Retitle or re-topic a Guide, or update its description, without creating a content version
MD_SET_GUIDE_ACCESS
Change a Guide's visibility between private and org-wide
MD_LIST_GUIDE_VERSIONS
List a Guide's version history without content
MD_DELETE_GUIDE
Soft-delete a Guide while preserving its version history