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

# Agent Skill File

> Drop-in SKILL.md teaching AI agents how to use BaseLayer's memory and knowledge graph.

# Agent Skill File

BaseLayer provides a canonical skill file that teaches AI agents how to use your knowledge graph properly. Point your agent framework at this URL:

```
https://baselayer.id/SKILL.md
```

## What it teaches

The skill file focuses on **usage patterns**, not setup:

* **Ask-first workflow** - Search before asking, write back learnings
* **Tool usage patterns** - When to use ask\_question vs record\_memory vs vault\_fact
* **Best practices** - Entity quality, avoiding duplication, relationship naming

The file is concise (\~140 lines) and assumes MCP connection is already working. It contains zero setup instructions — if an agent is reading it, they're already connected. Pure usage guidance only.

## Core principle: Ask first, guess second

The skill file teaches agents to search your memory before asking you questions:

```
User: "What did Alice say about the API design?"

Agent (good):
1. ask_question("What did Alice say about the API design?")
2. Synthesize answer from results
3. Only ask user if no results found

Agent (bad):
1. Ask user "Who is Alice?"
2. Waste time on info already in your memory
```

<Tip>
  Each ask\_question result is a synthesized answer. It's cheap to search often and expensive to miss context.
</Tip>

## Using with agent frameworks

### OpenClaw

OpenClaw agents can reference the skill file directly from their config:

```json theme={null}
{
  "skills": {
    "baselayer": "https://baselayer.id/SKILL.md"
  }
}
```

### LangChain / LangGraph

Fetch the skill content and include it in your system prompt:

```python theme={null}
import requests
skill = requests.get("https://baselayer.id/SKILL.md").text

system_prompt = f"""
You have access to BaseLayer memory via MCP.
{skill}
"""
```

### CrewAI / AutoGen

Add BaseLayer tools with the skill content as guidance:

```python theme={null}
from crewai import Tool

baselayer_tools = [
    Tool(name="ask_question", description="Search knowledge graph..."),
    # ... with skill content as context
]
```

## Setup is separate

The skill file contains **zero connection instructions**. If an agent is reading it, the MCP connection is already working. Setup info lives in human-readable docs only.

## What about llms.txt?

`SKILL.md` is for agents (usage patterns). `llms.txt` is for discovery (architecture, all integrations, connection endpoints).

* Agent learning BaseLayer? → [SKILL.md](https://baselayer.id/SKILL.md)
* Understanding BaseLayer architecture? → [llms.txt](https://baselayer.id/llms.txt)

## Keeping it updated

The skill file at `baselayer.id/SKILL.md` is always the latest version. If you've copied it into your agent config, check back periodically for updates — we improve the guidance as we learn what works.
