Skip to main content
A context is background knowledge you inject into an agent so it understands the context to do a specific task. It is not a task instruction (prompt) or a behavioral rule (persona) - it is information. Architecture decisions, product requirements, team conventions, domain knowledge, reference documentation. This is the asset type that solves the “every new session starts from zero” problem. Instead of re-explaining your stack and conventions every time, you write it once as a context asset and ingest manually or your agents do when needed automatically.

What goes in a context

  • Architecture decisions and technical conventions
  • Product requirements or domain-specific terminology
  • Reference material the AI needs to reason correctly
  • Team standards (code style, naming, patterns to use or avoid)
  • Any background the AI would otherwise need to ask about

Tips

  • Keep a context file (.md, .docx, .txt, .pdf, etc.) under 2000 tokens when possible — shorter context produces more coherent output.
  • Write references to other context files, so your contexts are task-scoped and provide only essential information AI needs to complete a task.
  • Use markdown over plain text. LLMs understand markdown formatting better, which helps them prioritize information and make better decisions.
  • Define metadata such as tags, keywords, related files, importance, recency, etc. for better agent discoverability and decisiveness.

API value

"assetType": "context"

Example

{
  "name": "Frontend conventions",
  "assetType": "context",
  "content": "
  This project uses Next.js 14 with the App Router.
  
  - Components are written in TypeScript.
  - Styling uses Tailwind CSS — no inline styles, no CSS modules.
  - State management uses Zustand.
  - All API calls go through /src/lib/api.ts.
  - Components live in /src/components, pages in /src/app.
  - We do not use useEffect for data fetching — use React Query instead.
  "
}