CogOS supports two schema construction modes:Documentation Index
Fetch the complete documentation index at: https://docs.cogos.natureselect.ai/llms.txt
Use this file to discover all available pages before exploring further.
- LLM Auto-Generation — The CM agent creates schema fields dynamically during
build()(default) - From Template — Select a preset template; CogOS copies it as a new schema file (
{name}_{YYYYMMDD}_{HHmmss}.json) and subsequent chats dynamically update it via the CM agent
Built-in Templates
CogOS ships with two built-in templates:| Template | Domains | Description |
|---|---|---|
general | user_profile, user_interests, memory_events | Long-term user memory for personalised AI assistants |
roleplay | chatbot_settings, relationship_schema, user_schema | Character and relationship tracking for roleplay scenarios |
cogos init to export them as editable JSON files:
Template Sources & Priority
Templates are loaded from three sources, with later sources overriding earlier ones:| Priority | Source | Directory | Description |
|---|---|---|---|
| 1 (lowest) | Built-in | Bundled in code | general and roleplay |
| 2 | User (shared) | templates_dir (./templates/) | Project-level templates, version-controlled |
| 3 (highest) | Custom (personal) | custom_templates_dir (./templates/custom/) | Personal templates, git-ignored |
Template File Format
Templates use the same JSON format as schema files, with an optional_meta key:
_meta.name field determines the template identifier. The file name can be anything ending in .json.
Using Templates
- CLI
- Python
- YAML Config
- OpenClaw Slash Commands
{template_name}_{YYYYMMDD}_{HHmmss}.json and binds the current session to it. Subsequent conversations dynamically update this schema via the CM agent — the template simply provides the starting structure.
Creating Custom Templates
Via Web UI
- Open the Build Schemas modal → switch to From Template mode
- Click + New Template to open the template editor
- Fill in the template name, description, and fields
- Click Save Template — the file is saved to
./templates/custom/
Via File
Place any.json file in ./templates/ (shared) or ./templates/custom/ (personal):
Via API
Save a custom template through the REST API:Via OpenClaw Slash Command
Create templates directly from the chat using the compact text format:- First line:
template_name description(name allows letters, numbers,_,-) - Following lines:
domain_name: field1 | description, field2 | description - Fields separated by
,, field name and description separated by|
Only custom templates can be deleted via the API or slash commands. Built-in and shared (user) templates are protected.
Template Resolution
Templates are resolved by name across all three sources. The resolution order (highest priority first):- Custom templates in
custom_templates_dir(./templates/custom/) - User templates in
templates_dir(./templates/) - Built-in templates bundled with CogOS