Step 2: Domains
With business context written, decide who the audiences are.
Why Define Domains Now?
Domains determine where context files live and who they apply to. Knowing the audiences before writing task instructions and behavior files means you write them for the right audience from the start — rather than writing generic files and retrofitting them later.
At Grove, two audiences ask questions: the analytics team and the customer success team. They care about different things, use different language, and sometimes need different definitions of the same concept.
What Is a Domain?
A domain is a named audience or business unit with its own view of the data. Different domains can have different context files, different examples, and — when necessary — different feature definitions.
The key rule: Entities are always defined in the main domain (default). Domains customize how context is presented, not the entity structure itself. If two audiences need different feature definitions for the same entity, that is when a custom domain gets its own entity YAML.
The Main Domain (default)
default)Every Lynk project has a main domain called default. It contains:
All entity YAML files
The canonical feature definitions
Business-wide knowledge, glossary, and behavior files
Every other domain is an overlay on top of default. If a custom domain does not define something, the agent falls back to default.
When to Create a Custom Domain
Create a custom domain when an audience needs:
Different context — the customer success team needs guidance about at-risk flags, renewal dates, and escalation signals that the analytics team does not need
Different examples — CSM questions focus on individual account risk; analytics questions focus on aggregate metrics
Different feature definitions — only when the same feature means something genuinely different to this audience (rare)
Do not create a domain to organize files. If the definitions and context are the same, one domain is enough.
Grove Example: Two Domains
default
Analytics and data engineering
All entity definitions, business-wide knowledge, glossary, SQL rules, output format
cs
Customer success team
CS-specific knowledge about at-risk accounts, renewal focus, CSM question examples
The cs domain does not need its own customer.yml — it uses the same feature definitions. It gets a cs_knowledge.md with CS-specific context and its own evaluations.yml with CSM-oriented test cases. No entity YAML overrides needed.
Domain Folder Structure
Rules for custom domain folders:
Only add entity YAML in a custom domain if feature definitions must differ from
defaultContext files in a custom domain apply only to that domain and shadow their
defaultequivalentsentities_relationships.ymllives only indefault— relationships are shared across domainsGlossary and behavior files scoped to
domain: "*"apply to all domains
The cs Domain Knowledge File
cs Domain Knowledge FileLocation: .lynk/cs/domain_context/cs_knowledge.md
This behavioral rule belongs in the knowledge file, not in task instructions. The agent reads the knowledge file when planning a query in the cs domain and applies this definition automatically. Task instructions are the right place when you need a specific SQL pattern — here, the plain-English definition is enough.
Key Point
Entities are defined once in default and shared. Domains are the mechanism for customization without duplication. Before creating a custom domain entity YAML, ask: does this audience need a different definition of this feature, or just different context about it?
If the answer is "different context" — add a context file to the custom domain folder. If the answer is "different definition" — then a custom entity YAML in that domain is warranted.
Last updated