AI Integration
Lore generates skill files that teach AI coding agents how to use your database. Each supported platform gets instructions in its native format.
Supported Platforms
| Platform | Skill Location |
|---|---|
| Claude Code | ~/.claude/skills/lore/SKILL.md + managed block in ~/.claude/CLAUDE.md |
| Cursor | ~/.cursor/rules/lore.mdc |
| Codex CLI | ~/.agents/skills/lore/SKILL.md + managed block in ~/.codex/AGENTS.md |
| OpenCode | ~/.agents/skills/lore/SKILL.md + managed block in ~/.config/opencode/AGENTS.md |
| OpenClaw | ~/.openclaw/workspace/skills/lore/SKILL.md + managed block in ~/.openclaw/workspace/AGENTS.md |
Platform aliases accepted with --platforms:
# These are equivalent
lore init --platforms claude
lore init --platforms claudecode
What Skill Files Teach
The generated skill files instruct AI agents on:
Core Behavior
- Proactive storage — the agent stores information without being asked
- Schema ownership — the agent creates and evolves tables as needed
- State-first writes — read schema, plan, apply (never guess)
- Language fidelity — store data in the language the user used
The Remember Flow
- Run
lore schemato read the current database state - Compose a JSON plan with the right
baseSchemaHash - Run
lore apply -f -to execute
The Recall Flow
- Run
lore read --sql "SELECT ..."to query data - Answer user questions based on stored data
Hard Rules
- Must read schema before any write
- Must include a descriptive
messagein every plan - Must use
whereclauses on updates and deletes - Never store secrets, passwords, or API keys
- One semantic unit per apply (don’t mix unrelated changes)
Managed Blocks
For platforms that use a central config file (like CLAUDE.md or AGENTS.md), Lore uses idempotent managed blocks:
<!-- lore:init:claude:start -->
... lore configuration ...
<!-- lore:init:claude:end -->
Running lore init again updates the block in place. Running lore clean removes it.
OpenClaw Heartbeat
When OpenClaw is selected during init, you can optionally enable heartbeat patrol:
lore init --platforms openclaw
# Prompts: Enable heartbeat? (or use --no-heartbeat to skip)
The heartbeat instructs the agent to:
- Run
lore statusperiodically - Alert on due or overdue time-sensitive entries
- Run
lore verifyonce per day - Auto-clean stale completed tasks and past events
Cleaning Up
Remove all Lore-generated skill files:
lore clean
This removes skill directories, managed blocks, and rule files for all platforms. It does not delete your database.