> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upsolve.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Encode Your Context

> A framework for deciding where to put your business knowledge so the agent can use it effectively.

An agent is only as good as the context it has. It can write flawless SQL and still give the wrong answer — because it doesn't know that "revenue" at your company means `gross_sales` minus refunds, or that a refund is only valid within 30 days, or that the person asking always wants a monthly view.

**Encoding your context** is how you hand that knowledge to the agent. Your business knowledge lives in different forms — the structure of your data, the rules you always follow, examples of good answers, reference documents, individual user preferences, and live systems outside your warehouse. Agent Studio gives you a different entry point matched to each form. This page is the map: what the entry points are, how to decide which one a piece of knowledge belongs in, and where to start.

## The seven entry points

| Entry point                                                | What it's for                                                                                                |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| [Data Model & Schema](/ai-agent-builder/data-model-schema) | What data the agent can see, and what each table and column means. The foundation everything else builds on. |
| [System Prompts](/ai-agent-builder/system-prompts)         | Business rules, terminology, and behavioral guardrails the agent always applies.                             |
| [Golden Assets](/ai-agent-builder/golden-assets)           | Example question → SQL → chart pairs the agent retrieves when a similar question is asked.                   |
| [Skills](/ai-agent-builder/skills)                         | Reusable instructions the agent loads on demand when it needs to perform a specific task.                    |
| [Knowledge Base](/ai-agent-builder/knowledge-base)         | Markdown reference documents the agent can search and read at query time.                                    |
| [User Memory](/ai-agent-builder/user-memory)               | Per-user preferences the agent remembers and applies across conversations.                                   |
| [MCP as Context Source](/ai-agent-builder/mcp-context)     | External data and tools, connected via MCP, that extend what the agent can access live.                      |

## Where does this piece of context go?

When you're holding a piece of business knowledge and wondering where to put it, ask these questions in order:

**Is it about which data exists and what it means?** → [Data Model & Schema](/ai-agent-builder/data-model-schema). Table and column selections, descriptions, and which values are valid filters all live here. If the agent picks the wrong table or misreads a column, the fix starts in the data model.

**Is it a rule that should *always* apply?** → [System Prompts](/ai-agent-builder/system-prompts). "Revenue means gross sales minus refunds." "Use fiscal quarters, not calendar quarters." "Never show HR data." If a rule should hold on every single message, it's a system prompt.

**Is it a specific example of how to answer a recurring question?** → [Golden Assets](/ai-agent-builder/golden-assets). When your team gets the same question every week and there's one correct way to answer it, record the question with its confirmed SQL (and chart, if the visualization matters).

**Is it a procedure the agent needs to execute on demand?** → [Skills](/ai-agent-builder/skills). A cohort analysis, a churn calculation, a specific investigative workflow — multi-step know-how the agent should load only when the task calls for it.

**Is it reference material the agent might need to look up?** → [Knowledge Base](/ai-agent-builder/knowledge-base). Policies, definitions, company background, known data caveats — anything too long for a prompt that the agent should search and read when relevant. A two-page refund policy belongs here, not in your system prompt.

**Is it about what a specific user prefers?** → [User Memory](/ai-agent-builder/user-memory). Preferred chart types, default time ranges, how much detail someone wants. You don't write this — the agent records it per person as they chat, and you shape *what* it pays attention to.

**Is it data or a capability from an external system?** → [MCP as Context Source](/ai-agent-builder/mcp-context). Things that are true *right now* outside your warehouse — the state of a support ticket, an incident tracker, a CRM — reached through connected MCP tools.

## Always-on, on-demand, and per-user context

The entry points differ not just in *what* they hold but in *when* the agent sees them — and that should influence where you put things.

**Always-on** context is read on every message: the data model and your system prompts. This is the most expensive attention the agent spends, so keep it tight — a focused 200–400 character system prompt outperforms a sprawling one that tries to cover everything.

**On-demand** context is loaded only when relevant: skills, knowledge base documents, and Golden Assets (retrieved by similarity to the user's question). This is where volume is safe — a large library costs nothing until retrieval says it matters. When a piece of knowledge is important but only *sometimes* relevant, prefer an on-demand entry point over lengthening your prompts.

**Per-user** context adapts to who's asking: user memory. The agent builds it up automatically from each person's conversations, so different users can get their preferred style of answer without you encoding anything by hand.

<Note>
  A common mistake: stuffing long reference material into the system prompt. If a rule must always apply, keep it as a short, sharp prompt line. If the agent needs to *read the details* when a topic comes up, move the detail to the Knowledge Base and keep the prompt to a one-line pointer.
</Note>

## Where to start

You don't need all seven on day one. A practical sequence:

1. **Data Model** — configure this first; every other entry point assumes it. Select the right tables and columns, and write clear descriptions.
2. **System Prompts** — add your most important always-on rules: KPI definitions, terminology, hard boundaries.
3. **Golden Assets** — add examples for your top 10–15 most common questions. This is usually the single biggest accuracy win after the data model.
4. **Skills and Knowledge Base** — add these as you encounter questions the agent can't answer: procedures it fumbles become skills, documents it needs become knowledge base files.
5. **User Memory** — adopt when your agent serves many users with different preferences worth remembering.
6. **MCP** — add when answers depend on data or tools outside your warehouse.

## Explore the entry points

<CardGroup cols={2}>
  <Card title="Data Model & Schema" icon="database" href="/ai-agent-builder/data-model-schema">
    Choose what the agent can see and describe what it means — the foundation.
  </Card>

  <Card title="System Prompts" icon="message" href="/ai-agent-builder/system-prompts">
    Encode always-on business rules, terminology, and guardrails.
  </Card>

  <Card title="Golden Assets" icon="star" href="/ai-agent-builder/golden-assets">
    Record trusted question → SQL → chart examples for recurring questions.
  </Card>

  <Card title="Skills" icon="graduation-cap" href="/ai-agent-builder/skills">
    Package procedures the agent loads when a task calls for them.
  </Card>

  <Card title="Knowledge Base" icon="book-open" href="/ai-agent-builder/knowledge-base">
    Store reference documents the agent searches and reads on demand.
  </Card>

  <Card title="User Memory" icon="brain" href="/ai-agent-builder/user-memory">
    Let the agent remember and apply each user's preferences.
  </Card>

  <Card title="MCP as Context Source" icon="plug" href="/ai-agent-builder/mcp-context">
    Connect external tools and live systems as real-time context.
  </Card>
</CardGroup>
