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

# Knowledge

> Add custom knowledge to improve Leo's understanding of your project

The Knowledge section allows you to provide Leo with project-specific context through instructions and memories. This helps Leo make better decisions and follow your preferences consistently.

## Instructions & Guidelines

Instructions are saved in a `LEO_RULES.md` file at the root of your project. Leo reads this file at the start of each conversation to understand your project's requirements.

### What to Include

* **Project-specific rules** - "Always use TypeScript strict mode"
* **Coding style preferences** - "Use 2-space indentation", "Prefer arrow functions"
* **Naming conventions** - "Use camelCase for variables, PascalCase for components"
* **External documentation** - Links to design systems or API docs
* **Business logic** - Key rules Leo should always follow

### How to Use

1. Go to **Settings** → **Knowledge**
2. Enter your instructions in the text area
3. Click **Save**

Leo will automatically read these instructions at the start of each conversation.

### Example Instructions

```markdown theme={null}
## Project Guidelines

### Tech Stack
- Framework: React with TypeScript
- Styling: Tailwind CSS
- State: React Query for server state

### Coding Style
- Use arrow functions for components
- Always add proper TypeScript types
- Use 2-space indentation
- Prefer named exports

### UI/UX
- Default to dark mode
- Use blue (#0066CC) as primary color
- Show loading spinners for async operations
- Display error messages below form fields

### Business Rules
- All prices in EUR
- Date format: DD/MM/YYYY
- Language: French for user-facing text
```

## Project Memories

Memories are pieces of information that Leo remembers across all conversations. They're perfect for context that should always be applied.

[Learn more about Project Memories](/features/project-memories)

## When to Use Each

| Use Case               | Instructions | Memories |
| ---------------------- | ------------ | -------- |
| Coding standards       | Yes          | -        |
| Business rules         | Yes          | Yes      |
| Company info           | -            | Yes      |
| Design preferences     | Yes          | Yes      |
| Technical requirements | Yes          | -        |
| Quick facts            | -            | Yes      |

### Instructions vs Memories

* **Instructions** - Detailed guidelines and rules (technical, structured)
* **Memories** - Quick facts and preferences (simple, contextual)

## Best Practices

1. **Be specific** - Vague instructions lead to inconsistent results
2. **Keep it concise** - Focus on what matters most
3. **Update regularly** - Adjust as your project evolves
4. **Use examples** - Show Leo what good output looks like
5. **Organize with sections** - Use markdown headers for clarity

## Inspiration

Need ideas for your instructions? Check out the [Aider Conventions Repository](https://github.com/Aider-AI/conventions) for community-contributed examples.

<CardGroup cols={2}>
  <Card title="Project Memories" icon="bookmark" href="/features/project-memories">
    Store important context for Leo
  </Card>

  <Card title="Prompting Best Practices" icon="lightbulb" href="/prompting/best-practices">
    Learn how to write effective prompts
  </Card>
</CardGroup>
