Skip to main content
Agent context is shared background knowledge every AI agent in a project reads before answering. It lives in a single file, lightdash.project_context.yml, that sits next to lightdash.config.yml inside your dbt or native Lightdash YAML project — in the Project directory path you set on the connection, which isn’t always your repository root. Notes you add here change future agent behavior without changing the semantic layer. The file is committed to your project repository and travels with the rest of your project metadata.

When agents load it

Agents load project context only when the organization setting Review AI agent turns (Settings → Ask AI → General) is on. With it on, Lightdash picks up the file in two ways:
  • On refresh. Click Refresh dbt (Refresh models for native projects), or run lightdash refresh. Lightdash reads the file from the branch set on the project connection, so commit and push an edit before you refresh. A preview built from a connected branch reads the file from that branch.
  • From the CLI. lightdash deploy and lightdash preview upload the file from your local project directory, so projects and previews without a repository connection get project context too. If Review AI agent turns is off, the CLI warns that the file was ignored. This needs Lightdash and the CLI v3.158.0 or later.
In Slack, agents use project context only when the AI Agents OAuth requirement setting is on.

When to use it

Reach for agent context when the data model itself is fine but the agent is missing background knowledge — terminology, which table to prefer, or business rules that aren’t expressible as semantic definitions. If the fact would also help a new analyst joining the team, edit the semantic layer instead. Agents pick up new context on their next turn, so the loop between “notice a gap” and “agents behave better” is short. Agent context replaces agent memories, which are deprecated. Agents no longer learn new memories or read existing ones. Settings → Ask AI → Memories still lists memories saved earlier so you can review them; add anything worth keeping here instead.

How entries are added

There are two ways entries land in the file:
  • Through Issues writeback. When a project context fix runs, Lightdash proposes a single entry and opens a pull request against your project repository. The first time this happens the file is created (with a header explaining what it’s for). Subsequent fixes add or update entries in the same file.
  • By hand. You can edit lightdash.project_context.yml directly. Writeback uses the GitHub API to merge one entry at a time, preserving comments, quoting, and key order in the rest of the file, so manual edits and writeback coexist cleanly.
Either way, the same validation rules apply: an invalid file fails the refresh, and the error marks the part of the file that broke the schema. The two most common causes are a { entries } document with no version and plain strings in the objects of a version: 2 file, both covered in File shape. The full JSON Schema is published at lightdash-project-context-2.0.json — point your editor at it for autocomplete and validation.

File shape

lightdash.project_context.yml
The top-level document is { version, entries }. A bare array of entries is also accepted for backward compatibility, but new files are written in the canonical shape. If you use the document shape, version: 2 is required: leaving it out fails validation at the document root.

Top-level properties

Entry properties

Each item in entries is a single self-contained fact your agents should know. Unknown keys on an entry are preserved on round-trip, so a field a newer Lightdash version adds won’t be silently dropped if you edit the file by hand.
  • Issues — the board that proposes project context fixes and opens pull requests against this file.
  • Effective analytics with agents — knowledge documents and other ways to hand agents context upfront.