What’s in a context document
Each document combines two things:- Prose that describes a metric, segment, rule, or definition in plain language.
- Annotations that link the prose to specific resources in your workspace, so the AI knows exactly which tables, fields, and pipelines the definition refers to.
| Annotation | Links to |
|---|---|
| Table | A table in the Catalog |
| Field | A column inside a table |
| Layer | A storage layer in the Lakehouse |
| Query | A saved Query |
| Notebook | A saved Notebook |
| Source | A Sources connector |
| Destination | A Destinations connector |
| Context document | Another document, for cross-references |
Creating a context document
Open Context from the sidebar. You’ll see two views:- All documents — every context document in your workspace.
- Templates — starter prompts that help your agent draft your first documents.
Start from a template or blank
Pick a template that matches what you want to document, or click New document to start from scratch. If you don’t know where to begin, the Don’t know where to start? template lets your agent explore your workspace and propose what to document first.
Write the definition in prose
Explain the concept the way you would to a new analyst. Focus on intent — what counts, what doesn’t, why — rather than how the SQL should be written.
Add annotations
Reference the tables, fields, layers, queries, notebooks, sources, or destinations the definition depends on. Annotations keep the document anchored to real resources as your warehouse evolves.
Templates
Nekt ships with starter prompts that cover the definitions most teams need first:Revenue & MRR
How revenue is recognized and MRR is calculated, including multi-currency handling.
Active customers definition
Which subscription statuses count as paying, and the internal orgs that never do.
Sales funnel stage definitions
What counts as an MQL, SAL, and SQL, and which lead sources are excluded.
Product usage & credits
How customers consume the product, unit conversions, and plan-limit signals.
Cross-cutting rules
The gotchas that apply to every analysis: exclusions, soft deletes, currencies.
Don't know where to start?
Let your agent explore your workspace and propose what to document first.
How agents use Context
When you ask a question through the MCP Server or any other AI integration, Nekt runs a semantic search over your context documents and feeds the most relevant ones into the SQL generation step. The agent reads the business rules first, then writes a query that respects them. This means the same question — “What was revenue last month?” — produces different SQL for different organizations, because each organization’s definition of revenue lives in its own context library.Best practices
Prefer prose plus annotations over raw SQL. Describe what a metric means, not how to compute it. Schemas change; definitions don’t.
Programmatic access
AI agents can also create, update, and delete context documents through the MCP Server. Seecreate_context_document, update_context_document, and delete_context_document for the full schemas.