# Lynk docs

## lynk Docs

- [Overview](https://docs.getlynk.ai/readme.md): Lynk is a semantic layer for AI — a brain organized by concept that teaches an agent how your business thinks.
- [Overview](https://docs.getlynk.ai/concepts/concepts.md): The router — every page in these docs and what it answers. Ground vocabulary here, then read the narrowest page.
- [Project](https://docs.getlynk.ai/concepts/project.md): A Lynk project is a self-contained git repository — one repo, one customer — consumed as versioned, validated builds.
- [lynk.yml](https://docs.getlynk.ai/concepts/lynk-yml.md): The required project settings file at the .lynk/ root — schema\_version, topology, and name.
- [LYNK.md](https://docs.getlynk.ai/concepts/lynk-md.md): LYNK.md is the agent's orientation and identity — who the business is, who a team is, and how they think. Always loaded.
- [GLOSSARY.yml](https://docs.getlynk.ai/concepts/glossary.md): GLOSSARY.yml is the team's vocabulary — the terms they use and what they mean, always loaded and merged across scopes.
- [Domain](https://docs.getlynk.ai/concepts/domain.md): A domain is an agent — one team's analytical surface, with its own vocabulary, entities, skills, and policies. A user talks to one at a time.
- [LYNK.md (domain)](https://docs.getlynk.ai/concepts/domain/lynk-md.md): A domain's LYNK.md — who this team is. Appended to the root LYNK.md; extends it, never replaces it.
- [GLOSSARY.yml (domain)](https://docs.getlynk.ai/concepts/domain/glossary.md): A domain's GLOSSARY.yml — the team's vocabulary, merged over the root glossary with the domain winning on a key collision.
- [Entity](https://docs.getlynk.ai/concepts/entity.md): An entity is a lazy, encapsulated representation of a thing in the business — a folder holding an ENTITY.md prose file and a schema.yml definition.
- [ENTITY.md](https://docs.getlynk.ai/concepts/entity/entity-md.md): ENTITY.md is the prose side of an entity — quirks, conventions, and business context the agent reads. Short by design, frontmatter required.
- [schema.yml](https://docs.getlynk.ai/concepts/entity/schema-yml.md): schema.yml is the structured definition of an entity — identity, keys, imports, features, metrics, and relationships.
- [Identity and Imports](https://docs.getlynk.ai/concepts/entity/schema-yml/identity-and-imports.md): identity roots an entity in a warehouse table or view, or another entity; keys identify its rows; imports cherry-pick definitions from a parent entity.
- [Feature](https://docs.getlynk.ai/concepts/entity/schema-yml/feature.md): A feature is a queryable, row-grain attribute of an entity — a column, a derivation, or a value pulled across a relationship.
- [Metric](https://docs.getlynk.ai/concepts/entity/schema-yml/metric.md): A metric is an aggregation defined on the entity it aggregates — sum, count, average, conditional aggregates — invoked with metric().
- [Relationships](https://docs.getlynk.ai/concepts/entity/schema-yml/relationships.md): Relationships declare a path from an entity to a physical table or another entity — directional, per-step joins with cardinality.
- [Policy](https://docs.getlynk.ai/concepts/policy.md): Policies are eager, always-apply behavioral commitments — output format, clarification behavior, and other rules for how the agent operates.
- [Skill](https://docs.getlynk.ai/concepts/skill.md): Skills are lazy prose procedures for classes of analytical reasoning — how the agent thinks through an analysis, not what exists in the data.
- [Reference Files](https://docs.getlynk.ai/concepts/reference-files.md): Reference files — user-organized files outside the domain primitives, the escape hatch for cross-cutting content, reached by absolute /.lynk/ references.
- [Placing knowledge in a layer](https://docs.getlynk.ai/guides/where-knowledge-goes.md): How to decide where a piece of knowledge belongs — entity prose, schema, glossary, metric, skill, policy, LYNK.md, or a reference file.
- [Choosing and shaping entities](https://docs.getlynk.ai/guides/designing-entities.md): How to decide what becomes an entity and how to shape it — the entity test, grain, promoting table relationships to entities, the upstream boundary, and base-row hygiene. Reach for it before adding or
- [Modeling metrics, time, and state](https://docs.getlynk.ai/guides/metrics-time-and-state.md): How to place a computation — feature, metric, skill, or glossary term — and how to model balances, time windows, cohorts, and ratio KPIs correctly.
- [Designing domains](https://docs.getlynk.ai/guides/designing-domains.md): How to decide how many domains to create, what belongs in the shared domain, and when to promote, extend, split, or merge.
- [Budgeting the agent's context](https://docs.getlynk.ai/guides/context-engineering.md): How to budget the agent's context — deciding @ injection vs a link, splitting a growing ENTITY.md, placing content at root vs domain, and when a rule earns a policy.
- [Evolving a live layer](https://docs.getlynk.ai/guides/evolving-the-layer.md): How to change a live semantic layer — logging definition changes, renaming a shared feature or metric safely, deprecating with enabled false, and landing breaking changes across domains.
- [Reading a complete layer](https://docs.getlynk.ai/guides/complete-example.md): A complete, annotated .lynk/ project for Grove (B2B SaaS) — every file of a small correct layer, end to end, with the reasoning behind each choice. Read when you want the whole shape at once instead o
- [Layout and Naming](https://docs.getlynk.ai/reference/layout-and-naming.md): The .lynk/ directory tree, the rules for naming folders and files, and the settings that control how a project is built.
- [Markdown Format](https://docs.getlynk.ai/reference/markdown-format.md): The frontmatter contract shared by every Markdown primitive, the reference grammar (@ injection, markdown links, bare paths), and how supporting files are organized.
- [SQL Expressions](https://docs.getlynk.ai/reference/sql-expressions.md): The reference grammar inside schema.yml sql fields — segment-count path resolution, the metric/first/last functions, filters, and join binding.
- [What Lynk doesn't do](https://docs.getlynk.ai/reference/what-lynk-does-not-do.md): The boundaries in one place — testing and evaluations, metric parameterization, templating, tags, scheduling, cross-domain queries — what Lynk doesn't do by design, what's planned, and what belongs up
- [API Reference](https://docs.getlynk.ai/api-reference/api.md): The programmatic interfaces — the Lynk SQL query dialect and the REST endpoints for validation and catalog inspection.
- [Lynk SQL](https://docs.getlynk.ai/api-reference/api/lynk-sql.md): The query dialect — warehouse SQL plus metric(\<entity>.\<name>) and USING('\<join\_name>'); entity references, joins, CTEs, windows, supported statements, pitfalls.
- [REST API](https://docs.getlynk.ai/api-reference/api/rest-api.md): HTTP endpoints for validating the semantic layer and inspecting the data catalog — full documentation in progress.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
This site has an agentic ask interface you may use to query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.getlynk.ai/index.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.
