> ## Documentation Index
> Fetch the complete documentation index at: https://vlyai-1c28d863.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge base

> Project-specific reference material the agent reads on every prompt. Drop in design system docs, brand voice, schema patterns, anything you'd otherwise repeat.

The knowledge base is **project-specific reference the agent always has access to**. Anything you'd repeat across many prompts ("our brand color is #6D28D9", "we always use named functions for top-level components", "the `tasks` table uses `dueAt` not `due_date`") belongs here, not in individual prompts.

## What to put in it

<CardGroup cols={2}>
  <Card title="Brand voice and copy guidelines" icon="megaphone">
    "Tone is warm but professional. Avoid exclamation marks. Use 'we' not 'the company'."
  </Card>

  <Card title="Design system rules" icon="palette">
    "Buttons use `variant=primary` for primary actions. Use `bg-violet-600` not `#6D28D9`. Inline icons go on the left of text."
  </Card>

  <Card title="Schema conventions" icon="database">
    "All timestamps use `Date.now()` (number). All IDs are Convex IDs. Soft delete via `deletedAt: number?`."
  </Card>

  <Card title="Architecture decisions" icon="layers">
    "We use TanStack Query for cross-page state. We don't use Redux. Server state lives in Convex; client state in Zustand."
  </Card>

  <Card title="Acronyms and jargon" icon="text-search">
    "MRR = monthly recurring revenue. ARR = annual recurring revenue. NPS = net promoter score."
  </Card>

  <Card title="External references" icon="link">
    "Our brand kit lives at https\://...; refer to it for color and typography. Our design system is the shadcn/ui defaults plus the customizations in `components/ui/`."
  </Card>
</CardGroup>

## Adding entries

<Steps>
  <Step title="Project → Knowledge → Add">
    Either type entries inline or upload a markdown file.
  </Step>

  <Step title="Categorize">
    Tag entries (design / data / brand / etc.) so the agent can prioritize relevant ones.
  </Step>

  <Step title="Verify it's used">
    Submit a prompt that should benefit from a knowledge entry. Check the agent's response references it.
  </Step>
</Steps>

## Structure of a good entry

Knowledge entries are **short, declarative, and rule-shaped**:

> "Buttons in the primary brand color use the `primary` variant of the shadcn/ui Button. Don't add custom CSS to override colors — extend the variant if a new style is needed."

Not:

> "We have lots of buttons throughout the app. Sometimes they're violet, sometimes they're gray. There's a Button component but I'm not sure how the variants work."

The first is actionable; the second is a story.

## Knowledge base vs. custom instructions

<table className="vly-compare">
  <thead>
    <tr>
      <th>Surface</th>
      <th>Knowledge base</th>
      <th>Custom instructions</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Scope</td>
      <td>Project</td>
      <td>Project or workspace-wide</td>
    </tr>

    <tr>
      <td>Length</td>
      <td>Long-form, can be many entries</td>
      <td>Short rules, \~10–20 lines total</td>
    </tr>

    <tr>
      <td>Best for</td>
      <td>Reference material, conventions, jargon</td>
      <td>Direct rules ("always", "never")</td>
    </tr>
  </tbody>
</table>

Use both. They complement each other.

## Tips

<Tip>
  **Update it as you learn.** When you find yourself correcting the agent twice on the same thing, that's a knowledge base entry waiting to be written.
</Tip>

<Tip>
  **Don't dump your README.** The README is for humans; knowledge entries are for the agent. Be selective and rule-shaped.
</Tip>

## Related

<CardGroup cols={3}>
  <Card title="Custom instructions" icon="settings-2" href="/building/custom-instructions">
    The shorter, rule-shaped sibling.
  </Card>

  <Card title="Cross-project referencing" icon="link" href="/building/cross-project-referencing">
    Pulling components from one project into another.
  </Card>

  <Card title="Templates" icon="file-stack" href="/building/templates">
    Pre-built starting points.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.