DenchClaw Object System: Build Any CRM Schema You Need
A complete guide to DenchClaw's flexible Object system — create custom tables, define fields, and model any data structure without code.
DenchClaw Object System: Build Any CRM Schema You Need
DenchClaw's Object system is what makes it a CRM platform rather than a CRM product. Instead of a fixed schema with preset "Contacts" and "Deals" tables you can't change, DenchClaw lets you create any data structure you need — custom tables, custom fields, custom relationships between tables — through a conversation with the AI or by editing YAML files directly.
This guide explains how Objects work, how to create and customize them, and the technical architecture underneath.
What Is an Object?#
In DenchClaw, an Object is a table. It represents a type of thing you want to track:
people— individual contactscompany— organizationsdeal— sales opportunitiesproject— active client engagementstask— to-do itemsproperty— real estate listingscandidate— job applicantsmedia_contact— journalists and pressportfolio_company— VC investments
There's no hardcoded list. You define the objects you need.
Creating an Object#
The simplest way to create an object is to ask DenchClaw:
"Create a new object called 'Events' for tracking client events and conferences."
DenchClaw will:
- Insert a row into the
objectstable in DuckDB - Create a directory in your workspace:
~/.openclaw-dench/workspace/crm/events/ - Generate a
.object.yamlfile defining the object's fields, views, and UI configuration - Create a DuckDB PIVOT view:
v_events - Add the object to your sidebar navigation
The entire process takes seconds. You're immediately ready to start adding fields and entries.
The .object.yaml File#
Every Object has a .object.yaml file that drives the frontend UI. Here's what a typical one looks like:
name: events
label: Events
icon: calendar
entry_count: 0
default_view: kanban
view_settings:
kanbanField: "Status"
tableColumns:
- Event Name
- Date
- Client
- Status
- Budget
fields:
- name: Event Name
type: text
required: true
- name: Date
type: date
- name: Client
type: relation
related_object: company
- name: Status
type: enum
options:
- Planning
- Confirmed
- Complete
- Cancelled
- name: Budget
type: number
format: currency
- name: Notes
type: richtext
views:
- name: This Month
filters:
- field: Date
operator: this_month
- name: Planning
filters:
- field: Status
operator: equals
value: Planning
statuses:
- name: Planning
color: blue
- name: Confirmed
color: green
- name: Complete
color: gray
- name: Cancelled
color: redThe AI generates and maintains this file. You can also edit it directly in any text editor.
The Database Layer#
DenchClaw uses an EAV (Entity-Attribute-Value) schema in DuckDB. The core tables:
-- Objects: the table definitions
CREATE TABLE objects (
id UUID PRIMARY KEY,
name TEXT UNIQUE NOT NULL,
label TEXT,
icon TEXT,
entry_count INTEGER DEFAULT 0
);
-- Fields: the column definitions per object
CREATE TABLE fields (
id UUID PRIMARY KEY,
object_id UUID REFERENCES objects(id),
name TEXT NOT NULL,
type TEXT NOT NULL, -- text, number, date, email, etc.
options JSONB, -- for enum/tags options
required BOOLEAN DEFAULT false
);
-- Entries: the rows of data
CREATE TABLE entries (
id UUID PRIMARY KEY,
object_id UUID REFERENCES objects(id),
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);
-- Entry Fields: the actual data values
CREATE TABLE entry_fields (
entry_id UUID REFERENCES entries(id),
field_id UUID REFERENCES fields(id),
value TEXT,
PRIMARY KEY (entry_id, field_id)
);This EAV structure means you can add new fields to any object without running ALTER TABLE. The schema is dynamic by design.
PIVOT Views#
Because raw EAV data is hard to query, DenchClaw auto-generates PIVOT views that look like flat tables:
-- Auto-generated view for the events object
CREATE OR REPLACE VIEW v_events AS
SELECT
e.id,
e.created_at,
e.updated_at,
MAX(CASE WHEN f.name = 'Event Name' THEN ef.value END) AS "Event Name",
MAX(CASE WHEN f.name = 'Date' THEN ef.value END) AS "Date",
MAX(CASE WHEN f.name = 'Client' THEN ef.value END) AS "Client",
MAX(CASE WHEN f.name = 'Status' THEN ef.value END) AS "Status",
MAX(CASE WHEN f.name = 'Budget' THEN ef.value END) AS "Budget"
FROM entries e
LEFT JOIN entry_fields ef ON e.id = ef.entry_id
LEFT JOIN fields f ON ef.field_id = f.id
WHERE e.object_id = (SELECT id FROM objects WHERE name = 'events')
GROUP BY e.id, e.created_at, e.updated_at;All natural language queries and filtered views operate on these PIVOT views, not the raw EAV tables. This keeps queries fast and readable.
Modifying an Existing Object#
Add fields to an existing object by asking DenchClaw:
"Add a 'Priority' field to the Events object — an enum with options High, Medium, and Low."
Or edit the .object.yaml file directly and add the field definition. DenchClaw detects the change and updates DuckDB accordingly.
Add relations between objects:
"Add a relation field to Events linking to the 'people' object for the lead organizer."
DenchClaw adds the relation field with the correct linked object reference. Relation fields render as searchable dropdowns in the UI.
Relation Fields and Object Graphs#
The most powerful capability of the Object system is linking objects together with Relation fields:
- A
dealhas amany_to_onerelation tocompany - A
dealhas amany_to_onerelation topeople(primary contact) - A
taskhas amany_to_onerelation todeal - A
companyhas aone_to_manyrelation back todeals
This creates a proper relational data model, not just a flat contact list. When you view a company, you can see all of their associated deals, contacts, and tasks.
Cloning Objects from Templates#
For common use cases, DenchClaw can initialize a full object setup from a natural language description:
"Set up a standard B2B sales CRM with people, companies, deals, and tasks objects, including typical fields for each."
DenchClaw creates all four objects with sensible default fields and linking relations between them. You get a production-ready CRM schema in under a minute.
Deleting and Archiving Objects#
Delete an object:
"Delete the Events object and all its entries."
DenchClaw confirms before proceeding (destructive action). When confirmed, it drops the v_events view, removes all entries and fields for that object from DuckDB, and removes the directory from your workspace.
To archive rather than delete, add an archived: true field to the .object.yaml — archived objects are hidden from the sidebar but data is preserved.
See also: DenchClaw Field Types for a complete reference to all available field types, and Natural Language Queries for querying your objects.
Frequently Asked Questions#
How many objects can I create?#
No limit. DenchClaw's EAV schema scales to any number of objects and fields without database performance degradation for typical CRM data volumes. DuckDB is designed for analytical queries and handles millions of entries without issues.
Can I rename an object after creating it?#
Yes. Update the name and label fields in the .object.yaml file, or ask DenchClaw: "Rename the 'events' object to 'engagements'." The PIVOT view will be regenerated with the new name.
Can I export object data to CSV?#
Yes. Ask DenchClaw: "Export all events to a CSV file." Or run a direct DuckDB query: COPY (SELECT * FROM v_events) TO 'events.csv' (HEADER, DELIMITER ',');
Are there any pre-built object templates?#
DenchClaw ships with common templates for B2B sales (people, company, deal), project management (project, task), and real estate (property, lead). You can also describe any data model in natural language and DenchClaw creates it.
What happens to my data if I upgrade DenchClaw?#
Your data is in a DuckDB file on your local filesystem. DenchClaw upgrades never touch your data. The schema migration strategy for breaking changes is documented in the release notes, but the EAV architecture means schema changes are typically additive and backward-compatible.
Ready to try DenchClaw? Install in one command: npx denchclaw. Full setup guide →
