Skip to main content

Graph Commands

The graph command group manages knowledge graph entities: nodes, links (edges), templates, workflows, and packages.

chaoscypher graph --help

Nodes

Nodes are the fundamental units of knowledge in Chaos Cypher. Each node belongs to a template, has a label, and carries a set of typed properties.

List Nodes

chaoscypher graph node list [OPTIONS]
OptionShortDefaultDescription
--template-tFilter by template ID
--format-ftableOutput format (table, json, yaml)
--page-p1Page number
--limit-l50Items per page
--database-ddefaultDatabase name

Examples:

# List all nodes (table view)
chaoscypher graph node list

# Filter by template
chaoscypher graph node list --template Person

# JSON output for scripting
chaoscypher graph node list --format json

# Paginate through results
chaoscypher graph node list --page 2 --limit 100

Sample output:

Nodes
┌──────────────────┬───────────────┬──────────┬────────────┬────────────┐
│ ID │ Label │ Template │ Properties │ Created │
├──────────────────┼───────────────┼──────────┼────────────┼────────────┤
│ nd_a1b2c3d4e5f6 │ John Doe │ Person │ 3 │ 2026-01-15 │
│ nd_f6e5d4c3b2a1 │ Acme Corp │ Company │ 5 │ 2026-01-16 │
│ nd_1234abcd5678 │ Project Alpha │ Project │ 2 │ 2026-02-01 │
└──────────────────┴───────────────┴──────────┴────────────┴────────────┘

Page 1/1 • Total: 3 node(s)

Create a Node

chaoscypher graph node create [OPTIONS]
OptionShortRequiredDefaultDescription
--template-tYesTemplate ID to use for the node
--label-lYesLabel/name of the node
--property-pNoProperty in key=value format (repeatable)
--json-props-jNoProperties as a JSON string
--database-dNodefaultDatabase name
--interactive-iNoUse interactive wizard

Examples:

# Create with required flags
chaoscypher graph node create -t Person -l "John Doe"

# Create with properties
chaoscypher graph node create -t Person -l "Jane Smith" \
-p role=CEO -p department=Executive

# Create with JSON properties
chaoscypher graph node create -t Event -l "Quarterly Meeting" \
-j '{"date": "2026-01-15", "location": "Room 401"}'

# Combine -p and -j (values are merged)
chaoscypher graph node create -t Person -l "Bob" \
-p role=Engineer -j '{"team": "Platform"}'

# Interactive wizard (prompts for template, label, and each property)
chaoscypher graph node create --interactive

Sample output:

Creating node...
✓ Node created successfully!
ID: nd_a1b2c3d4e5f6
Template: Person
Label: Jane Smith
Properties:
• role: CEO
• department: Executive

Get Node Details

chaoscypher graph node get NODE_ID [OPTIONS]
OptionShortDefaultDescription
--format-ftableOutput format (table, json, yaml)
--include-links-lfalseInclude connected links
--database-ddefaultDatabase name

Examples:

# View node details
chaoscypher graph node get nd_a1b2c3d4e5f6

# Include connected links
chaoscypher graph node get nd_a1b2c3d4e5f6 --include-links

# Export as JSON
chaoscypher graph node get nd_a1b2c3d4e5f6 --format json

Sample output:

Node: nd_a1b2c3d4e5f6
┌────────────┬───────────────────────────────┐
│ Field │ Value │
├────────────┼───────────────────────────────┤
│ ID │ nd_a1b2c3d4e5f6 │
│ Label │ John Doe │
│ Template │ Person │
│ Created │ 2026-01-15 10:30:00 │
│ Updated │ 2026-02-01 14:22:00 │
│ Properties │ role: Engineer │
│ │ department: Platform │
│ │ email: john@example.com │
│ Position │ x=120, y=340 │
│ Embedding │ [1024 dimensions] │
└────────────┴───────────────────────────────┘

Connected Links
┌───────────────┬──────────────┬───────────────┬──────────────┐
│ ID │ Direction │ Related Node │ Relationship │
├───────────────┼──────────────┼───────────────┼──────────────┤
│ eg_abc123def4 │ → (outgoing) │ nd_f6e5d4c3b2 │ works_at │
│ eg_789xyz012a │ ← (incoming) │ nd_1234abcd56 │ manages │
└───────────────┴──────────────┴───────────────┴──────────────┘

Update a Node

chaoscypher graph node update NODE_ID [OPTIONS]
OptionShortDescription
--label-lNew label for the node
--set-sSet a property (key=value, repeatable)
--unset-uRemove a property by key (repeatable)
--database-dDatabase name (default: default)

Examples:

# Change the label
chaoscypher graph node update nd_a1b2c3d4e5f6 --label "Jonathan Doe"

# Set properties
chaoscypher graph node update nd_a1b2c3d4e5f6 \
-s role=CTO -s department=Engineering

# Remove a property
chaoscypher graph node update nd_a1b2c3d4e5f6 -u obsolete_field

# Combine operations
chaoscypher graph node update nd_a1b2c3d4e5f6 \
--label "Jon Doe" -s title=VP -u old_title

Delete a Node

chaoscypher graph node delete NODE_ID [OPTIONS]
OptionShortDefaultDescription
--force-ffalseSkip confirmation prompt
--cascade-cfalseAlso delete connected links
--database-ddefaultDatabase name

Examples:

# Delete with confirmation prompt
chaoscypher graph node delete nd_a1b2c3d4e5f6

# Skip confirmation
chaoscypher graph node delete nd_a1b2c3d4e5f6 --force

# Delete node and all connected links
chaoscypher graph node delete nd_a1b2c3d4e5f6 --cascade

# Force delete with cascade
chaoscypher graph node delete nd_a1b2c3d4e5f6 -f -c
warning

Without --cascade, connected links become orphaned (they reference a node that no longer exists). Use --cascade to clean up all related links.


Links are directed relationships between nodes. Each link connects a source node to a target node and carries a relationship type.

chaoscypher graph link list [OPTIONS]
OptionShortDefaultDescription
--source-sFilter by source node ID
--format-ftableOutput format (table, json, yaml)
--page-p1Page number
--limit-l50Items per page
--database-ddefaultDatabase name

Examples:

# List all links
chaoscypher graph link list

# Filter by source node
chaoscypher graph link list --source nd_a1b2c3d4e5f6

# JSON output
chaoscypher graph link list --format json

# Paginate
chaoscypher graph link list --page 2 --limit 25

Sample output:

Links
┌───────────────┬───────────────┬───┬───────────────┬────────────┬──────────┐
│ ID │ Source │ → │ Target │ Label │ Template │
├───────────────┼───────────────┼───┼───────────────┼────────────┼──────────┤
│ eg_abc123de… │ nd_a1b2c3d… │ → │ nd_f6e5d4c… │ works_at │ WorksAt │
│ eg_789xyz01… │ nd_1234abc… │ → │ nd_a1b2c3d… │ manages │ Manages │
│ eg_def456gh… │ nd_a1b2c3d… │ → │ nd_9876fed… │ knows │ (none) │
└───────────────┴───────────────┴───┴───────────────┴────────────┴──────────┘

Page 1/1 • Total: 3 link(s)
chaoscypher graph link create SOURCE_NODE TARGET_NODE [OPTIONS]
ArgumentDescription
SOURCE_NODEStarting node ID
TARGET_NODEEnding node ID
OptionShortRequiredDefaultDescription
--type-tYesRelationship type/template (e.g., works_for, owns)
--label-lNoOptional display label (defaults to the type value)
--bidirectional-bNofalseCreate link in both directions
--database-dNodefaultDatabase name

Examples:

# Create a directed link
chaoscypher graph link create nd_person1 nd_company1 --type "works_for"

# Create with a custom label
chaoscypher graph link create nd_node1 nd_node2 \
-t "influences" -l "strongly influences"

# Create bidirectional links (creates two edges)
chaoscypher graph link create nd_node1 nd_node2 \
-t "related_to" --bidirectional

Sample output:

Creating link: nd_person1 → nd_company1
Type: works_for
✓ Link created successfully!
ID: eg_abc123def456
chaoscypher graph link get LINK_ID [OPTIONS]
OptionShortDefaultDescription
--format-ftableOutput format (table, json, yaml)
--database-ddefaultDatabase name

Examples:

chaoscypher graph link get eg_abc123def456
chaoscypher graph link get eg_abc123def456 --format json

Sample output:

╭──────── Link ────────╮
│ works_for │
│ ID: eg_abc123def456 │
╰──────────────────────╯
Source Node nd_a1b2c3d4e5f6
Target Node nd_f6e5d4c3b2a1
Relationship Type works_for
Template WorksAt
Weight 1.0
Created 2026-01-15 10:30:00

Properties:
start_date: 2025-06-01
role: Senior Engineer
chaoscypher graph link update LINK_ID [OPTIONS]
OptionShortDescription
--label-lNew label for the link
--set-sSet a property (key=value, repeatable)
--unset-uRemove a property by key (repeatable)
--database-dDatabase name (default: default)

Examples:

# Change the label
chaoscypher graph link update eg_abc123def456 --label "Works For"

# Set a property
chaoscypher graph link update eg_abc123def456 -s context="Updated context"

# Remove a property
chaoscypher graph link update eg_abc123def456 -u obsolete_field
chaoscypher graph link delete [LINK_ID] [OPTIONS]

Links can be deleted by ID or by specifying the source and target node pair.

ArgumentRequiredDescription
LINK_IDNoLink ID to delete (alternative to --source/--target)
OptionShortDefaultDescription
--source-sSource node ID (used with --target)
--target-tTarget node ID (used with --source)
--typeLink type to filter by (used with --source/--target)
--force-ffalseSkip confirmation prompt
--database-ddefaultDatabase name

Examples:

# Delete by link ID
chaoscypher graph link delete eg_abc123def456

# Delete by source/target pair (deletes all links between them)
chaoscypher graph link delete --source nd_person1 --target nd_company1

# Delete a specific type between two nodes
chaoscypher graph link delete -s nd_node1 -t nd_node2 --type "works_for"

# Force delete without confirmation
chaoscypher graph link delete eg_abc123def456 --force
note

When using --source and --target, all matching links between those nodes are deleted. Add --type to narrow the selection.


Templates

Templates define the schema for nodes and edges -- the property names, types, and constraints that instances must follow.

List Templates

chaoscypher graph template list [OPTIONS]
OptionShortDefaultDescription
--format-ftableOutput format (table, json, yaml)
--verbose-vfalseShow properties and descriptions
--type-tFilter by template type (node or edge)
--database-ddefaultDatabase name

Examples:

# List all templates
chaoscypher graph template list

# Show detailed view with properties
chaoscypher graph template list --verbose

# Filter to node templates only
chaoscypher graph template list --type node

# JSON output
chaoscypher graph template list --format json

Sample output:

Templates
┌──────────────────┬──────────────┬──────┐
│ ID │ Name │ Type │
├──────────────────┼──────────────┼──────┤
│ tmpl_a1b2c3d4e5 │ Person │ node │
│ tmpl_f6e5d4c3b2 │ Company │ node │
│ tmpl_1234abcd56 │ Project │ node │
│ tmpl_9876fedc54 │ WorksAt │ edge │
│ tmpl_abcd1234ef │ Manages │ edge │
└──────────────────┴──────────────┴──────┘

Total: 5 template(s)

Verbose output (--verbose):

Templates
┌──────────────────┬─────────┬──────┬─────────────────────────────┬──────────────────┐
│ ID │ Name │ Type │ Properties │ Description │
├──────────────────┼─────────┼──────┼─────────────────────────────┼──────────────────┤
│ tmpl_a1b2c3d4e5 │ Person │ node │ name:string, role:string, │ A person entity │
│ │ │ │ email:email (+2 more) │ │
│ tmpl_f6e5d4c3b2 │ Company │ node │ name:string, industry:str… │ A company or or… │
└──────────────────┴─────────┴──────┴─────────────────────────────┴──────────────────┘

Total: 2 template(s)

Create a Template

chaoscypher graph template create [OPTIONS]
OptionShortRequiredDefaultDescription
--name-nYes*Template name
--type-tNonodeTemplate type (node or edge)
--descriptionNoTemplate description
--property-pNoProperty definition in name:type[:required] format (repeatable)
--database-dNodefaultDatabase name
--interactive-iNoUse interactive wizard

*Required unless using --interactive.

Property format: name:type[:required]

Examples:

# Create a node template with properties
chaoscypher graph template create -n Person \
-p name:string:required \
-p age:integer \
-p email:email:required

# Create an edge template
chaoscypher graph template create -n WorksAt -t edge \
-p start_date:date \
-p role:string

# Create with description
chaoscypher graph template create -n Project \
--description "A project or initiative" \
-p name:string:required \
-p status:string \
-p deadline:date

# Interactive wizard (prompts for everything)
chaoscypher graph template create --interactive

Sample output:

Creating template: Person
✓ Template created successfully!
ID: tmpl_a1b2c3d4e5
Name: Person
Type: node
Properties:
• name: STRING (required)
• age: INTEGER
• email: EMAIL (required)

Property Type Reference

Templates use typed properties. The following types are available:

TypeDescriptionExample Values
STRINGShort text (single line)"John Doe", "Active"
TEXTLong text (multi-line)"A detailed description..."
INTEGERWhole number42, -7, 0
FLOATDecimal number3.14, -0.5
BOOLEANTrue/falsetrue, false
DATECalendar date"2026-01-15"
DATETIMEDate and time"2026-01-15T10:30:00"
URLWeb address"https://example.com"
EMAILEmail address"user@example.com"
JSONStructured JSON data'{"key": "value"}'

Types are case-insensitive in the CLI (e.g., string, String, STRING all work).

Get Template Details

chaoscypher graph template get TEMPLATE_ID [OPTIONS]
OptionShortDefaultDescription
--format-ftableOutput format (table, json, yaml)
--database-ddefaultDatabase name

Examples:

chaoscypher graph template get Person
chaoscypher graph template get tmpl_a1b2c3d4e5 --format json

Sample output:

╭─────────── Template ───────────╮
│ Person node │
│ ID: tmpl_a1b2c3d4e5 │
╰────────────────────────────────╯
Description A person entity
Type node
Created 2026-01-15 10:30:00
Updated 2026-02-01 14:22:00

Properties:
Name Type Required Display Name
name STRING yes Name
role STRING no Role
email EMAIL yes Email
age INTEGER no Age
bio TEXT no Bio

Update a Template

chaoscypher graph template update TEMPLATE_ID [OPTIONS]
OptionShortDescription
--name-nNew template name
--descriptionNew description
--add-property-aAdd a property (name:type[:required], repeatable)
--remove-property-rRemove a property by name (repeatable)
--database-dDatabase name (default: default)

Examples:

# Rename a template
chaoscypher graph template update Person --name "Individual"

# Update description
chaoscypher graph template update Person --description "A person entity"

# Add new properties
chaoscypher graph template update Person \
-a phone:string -a address:text

# Remove a property
chaoscypher graph template update Person -r obsolete_field

# Combine operations
chaoscypher graph template update Person \
--name "Person v2" -a linkedin:url -r old_field

Delete a Template

chaoscypher graph template delete TEMPLATE_ID [OPTIONS]
OptionShortDefaultDescription
--force-ffalseSkip confirmation
--database-ddefaultDatabase name

Examples:

chaoscypher graph template delete Person
chaoscypher graph template delete tmpl_a1b2c3d4e5 --force
warning

Deleting a template does not delete nodes created from it, but those nodes will no longer have a valid template reference.


Workflows

View workflow definitions from the CLI. Workflow creation and execution is available via the web UI or API.

List Workflows

chaoscypher graph workflow list [OPTIONS]
OptionShortDefaultDescription
--format-ftableOutput format (table, json, yaml)
--verbose-vfalseShow step counts and descriptions
--category-cFilter by category
--active/--inactiveFilter by active status
--database-ddefaultDatabase name

Examples:

# List all workflows
chaoscypher graph workflow list

# Verbose view with step counts
chaoscypher graph workflow list --verbose

# Filter by category
chaoscypher graph workflow list --category research

# Show only active workflows
chaoscypher graph workflow list --active

Get Workflow Details

chaoscypher graph workflow get WORKFLOW_ID [OPTIONS]
OptionShortDefaultDescription
--format-ftableOutput format (table, json, yaml)
--database-ddefaultDatabase name

You can pass either the workflow ID or its name.

Examples:

chaoscypher graph workflow get entity-extraction
chaoscypher graph workflow get wf_abc123 --format json

Packages

Export and import knowledge graph packages in CCX (Chaos Cypher eXchange) format. Packages are portable ZIP archives containing templates, nodes, edges, and workflows in JSON-LD format.

Export

chaoscypher graph package export [OPTIONS]
OptionShortDefaultDescription
--output-oAuto-generatedOutput .ccx file path
--templates/--no-templates--templatesInclude templates
--knowledge/--no-knowledge--knowledgeInclude knowledge nodes and edges
--workflows/--no-workflows--workflowsInclude workflows
--database-ddefaultDatabase name

Examples:

# Export everything (auto-generated filename)
chaoscypher graph package export

# Export to a specific file
chaoscypher graph package export --output my-backup.ccx

# Export only templates and knowledge (no workflows)
chaoscypher graph package export --no-workflows

# Export from a specific database
chaoscypher graph package export -d my-project -o project.ccx

Sample output:

Exporting to: my-backup.ccx
Export Summary
┌──────────────────┬──────────────┐
│ Item │ Value │
├──────────────────┼──────────────┤
│ Output file │ my-backup.ccx│
│ File size │ 124.5 KB │
│ Database │ default │
│ Nodes in DB │ 47 │
│ Edges in DB │ 83 │
│ Templates in DB │ 12 │
└──────────────────┴──────────────┘

✓ Export complete: my-backup.ccx

Load (Import)

chaoscypher graph package load PACKAGE [OPTIONS]
ArgumentDescription
PACKAGEPath to the .ccx file to import (must exist)
OptionShortDefaultDescription
--merge/--replace--mergeMerge with existing data (skip duplicates) or replace
--templates/--no-templates--templatesImport templates
--knowledge/--no-knowledge--knowledgeImport knowledge nodes and edges
--workflows/--no-workflows--workflowsImport workflows
--database-ddefaultDatabase name

Examples:

# Import a package (merge mode — skip existing templates)
chaoscypher graph package load my-knowledge.ccx

# Replace mode (overwrite existing data)
chaoscypher graph package load backup.ccx --replace

# Import only knowledge, skip templates
chaoscypher graph package load export.ccx --no-templates

# Import into a specific database
chaoscypher graph package load data.ccx -d my-project

Sample output:

Importing: my-knowledge.ccx
Mode: Merge (skip existing templates)
Import Results
┌─────────────────────────┬───────┐
│ Category │ Count │
├─────────────────────────┼───────┤
│ Templates imported │ 8 │
│ Templates skipped │ 2 │
│ Nodes imported │ 47 │
│ Edges imported │ 83 │
│ Workflows imported │ 2 │
│ Workflow edges imported │ 6 │
└─────────────────────────┴───────┘
✓ Checksums verified
✓ Imported 164 items

Global Options

All graph subcommands support the --database (-d) option to target a specific database. The default database is default.

# All commands work with any database
chaoscypher graph node list -d my-project
chaoscypher graph template list -d research-db
chaoscypher graph package export -d production -o prod-backup.ccx

Most commands also support --format (-f) for machine-readable output:

FormatDescription
tableHuman-readable Rich tables (default)
jsonJSON output for scripting and piping
yamlYAML output (requires PyYAML)