Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/neo4j-labs/create-context-graph/llms.txt

Use this file to discover all available pages before exploring further.

Create Context Graph ships with 22 built-in domains, but you are not limited to them. You can describe any domain in plain English and let the LLM generate a complete ontology, or write the YAML yourself.

What gets generated

When you provide a domain description, the LLM generates a full ontology including:
  • Entity types — domain-specific node labels with properties, colors, and icons
  • Relationships — typed edges between entity types
  • Agent tools — Cypher-backed tools scoped to your domain
  • Document templates — prompts for generating realistic domain documents
  • System prompt — a tailored agent persona for your domain
  • Visualization config — node colors, sizes, and a default Cypher query
  • Demo scenarios — example chat prompts to explore the generated data
All of this feeds directly into the generated FastAPI backend, Next.js frontend, and Neo4j schema — no additional configuration required.

Option 1: CLI flags

Pass --custom-domain with a plain-English description and your Anthropic API key:
uvx create-context-graph my-app \
  --custom-domain "veterinary clinic management with patients, owners, appointments, and treatments" \
  --anthropic-api-key $ANTHROPIC_API_KEY \
  --framework pydanticai \
  --demo-data
The --custom-domain flag triggers LLM ontology generation and bypasses the domain selection step. All other flags (--framework, --demo-data, --connector, etc.) work as usual.
--custom-domain requires --anthropic-api-key or ANTHROPIC_API_KEY set in your environment. The LLM makes up to 3 generation attempts and validates the output against the DomainOntology schema before proceeding.

Option 2: Interactive wizard

Run the CLI without flags and choose the custom domain option at the domain selection step:
uvx create-context-graph my-app
1

Select 'Custom (describe your domain)'

At the domain selection step, scroll past the built-in domains and choose “Custom (describe your domain)”.
2

Enter your description

Type a natural-language description of your domain, for example:
veterinary clinic management with patients, owners, appointments, and treatments
3

Review and accept or refine

The wizard displays an ontology summary showing the generated entity types, relationships, and agent tools. You can accept it or refine your description and regenerate.
The wizard prompts for an Anthropic API key if ANTHROPIC_API_KEY is not already set in your environment.

Option 3: Manual YAML

Write a domain YAML file from scratch. The YAML must follow the domain ontology schema. Once written, save it into the src/create_context_graph/domains/ directory in the source tree (for contributors), or place it in ~/.create-context-graph/custom-domains/ for personal reuse. A minimal example:
inherits: _base

domain:
  id: veterinary
  name: Veterinary Clinic
  description: Veterinary clinic management system
  tagline: "AI-powered veterinary care coordination"
  emoji: "🐾"

entity_types:
  - label: Patient
    pole_type: PERSON
    subtype: Animal
    color: "#4CAF50"
    icon: pet
    properties:
      - name: name
        type: string
        required: true
      - name: species
        type: string
        required: true
        enum: ["dog", "cat", "bird", "reptile", "other"]

relationships:
  - type: OWNS
    source: Person
    target: Patient

agent_tools:
  - name: find_patient
    description: Find a patient by name
    cypher: "MATCH (p:Patient) WHERE p.name CONTAINS $name RETURN p"
    parameters:
      - name: name
        type: string

system_prompt: |
  You are a veterinary clinic assistant with access to patient and appointment records.

visualization:
  node_colors:
    Patient: "#4CAF50"
  default_cypher: "MATCH (n) RETURN n LIMIT 50"
inherits: _base automatically merges the shared POLE+O entity types (Person, Organization, Location, Event, Object) into your domain. See src/create_context_graph/domains/ in the source repository for complete examples.

Saving and reusing custom domains

LLM-generated ontologies are saved automatically to ~/.create-context-graph/custom-domains/. You can inspect them:
# List saved custom domains
ls ~/.create-context-graph/custom-domains/
Generated domains are also copied into the scaffolded project at data/ontology.yaml, so each project is self-contained and does not depend on the saved file. To scaffold from a saved custom domain again, use --custom-domain with the same description (the CLI will regenerate the ontology), or run the interactive wizard and select the custom domain option.

Tips for writing good descriptions

Be specific about entities

“Healthcare with patients, doctors, diagnoses, medications, and appointments” produces better results than “healthcare.”

Mention key relationships

“Students enroll in courses taught by professors” helps the LLM define the correct graph edges.

Include domain actions

“Track shipments, manage inventory, handle returns” gives the LLM material for generating agent tools.

Keep it focused

1–3 sentences works best. Long paragraphs dilute the signal and can produce unfocused ontologies.

Build docs developers (and LLMs) love