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.

1

Check prerequisites

You need the following before running the CLI:
  • Python 3.11+ — the CLI is a Python package. uv is recommended for running it without a permanent install.
  • Node.js 18+ — required for the generated Next.js frontend.
  • Neo4j 5+ — see step 3 for your options (cloud, Docker, or local).
  • An LLM API key — most frameworks use Anthropic. Get one at console.anthropic.com.
If you choose the OpenAI Agents SDK framework, you need OPENAI_API_KEY. For Google ADK (Gemini), you need GOOGLE_API_KEY.
2

Run the CLI

No installation needed. Run directly with uvx (Python) or npx (Node.js):
uvx create-context-graph
The interactive wizard guides you through selecting a domain, agent framework, and Neo4j connection. If you prefer to skip it, pass all required flags directly:
uvx create-context-graph my-app \
  --domain healthcare \
  --framework pydanticai \
  --demo-data
Omit the project name and the CLI auto-generates one from your domain and framework (e.g., healthcare-pydanticai-app).
Other non-interactive examples:
# Custom domain from a plain-English description
uvx create-context-graph my-app \
  --custom-domain "veterinary clinic management" \
  --framework pydanticai \
  --anthropic-api-key $ANTHROPIC_API_KEY \
  --demo-data

# Import real data from SaaS services instead of demo data
uvx create-context-graph my-app \
  --domain personal-knowledge \
  --framework pydanticai \
  --connector github \
  --connector slack

# Scaffold, reset the database, and ingest data in one step
uvx create-context-graph my-app \
  --domain financial-services \
  --framework langgraph \
  --demo \
  --neo4j-uri neo4j://localhost:7687
When the CLI finishes, you’ll see a summary of what was generated and the exact commands to run next.
3

Set up Neo4j

The generated app connects to any Neo4j 5+ instance. Choose the option that fits your workflow:
The easiest option. Neo4j Aura provides a free cloud-hosted instance with no local setup required.
  1. Go to console.neo4j.io and create a free instance.
  2. Download the .env credentials file from the Aura console.
  3. Either pass it at scaffold time:
uvx create-context-graph my-app \
  --domain healthcare \
  --framework pydanticai \
  --neo4j-aura-env path/to/Neo4j-credentials.env \
  --demo-data
Or copy the credentials into your project’s .env file manually after scaffolding.
No make neo4j-start or make docker-up needed — Aura is already running in the cloud.
4

Configure the environment

The generated project includes a .env.example with all required variables. Copy it and fill in your credentials:
cd my-app
cp .env.example .env
Then open .env and set your values:
# Neo4j connection
NEO4J_URI=neo4j://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=password

# LLM API key (use the key for your chosen framework)
ANTHROPIC_API_KEY=sk-ant-...
# OPENAI_API_KEY=sk-...       # Required for openai-agents
# GOOGLE_API_KEY=AIza...      # Required for google-adk
If you passed --neo4j-aura-env during scaffolding, your .env already has the Aura connection details filled in.
5

Install dependencies and seed data

Install the backend and frontend dependencies, then load the domain data into Neo4j:
cd my-app
make install   # Installs backend (uv) + frontend (npm) dependencies
make seed      # Seeds entities, relationships, documents, and decision traces
make install is equivalent to running:
# Backend
cd backend && uv venv && uv pip install -e .

# Frontend
cd frontend && npm install
make seed loads all fixture data: entities and relationships, professional documents, and multi-step decision traces.
If you used --demo (instead of --demo-data) during scaffolding, data was already ingested into Neo4j at generation time. You can still run make seed to re-seed.
6

Start the app

Start the backend and frontend with a single command:
make start
This starts:
  • Backend (FastAPI) on port 8000
  • Frontend (Next.js) on port 3000
Or start them separately in two terminals:
# Terminal 1 — backend
cd backend && make dev

# Terminal 2 — frontend
cd frontend && npm run dev
7

Explore your app

Once both services are running, open these URLs:

Chat interface

http://localhost:3000 — Chat with your AI agent and explore the knowledge graph. Try asking about entities in your domain, or double-click a node in the graph to expand its neighbors.

Backend API docs

http://localhost:8000/docs — FastAPI auto-generated interactive API documentation. Useful for testing endpoints directly.

Neo4j Browser

http://localhost:7474 — Query the graph directly with Cypher. Try MATCH (n) RETURN n LIMIT 25 to see the seeded data.

Health check

http://localhost:8000/health — Confirms the backend and Neo4j connection are healthy.
Things to try in the chat interface:
  • Ask a domain-specific question: “Show me all patients with a diabetes diagnosis” or “What are the highest-risk accounts?”
  • Watch the tool call timeline on the right as the agent executes Cypher queries in real time
  • Click any node in the graph to see its properties, then click Ask about [entity] to query the agent directly
  • Open the Documents panel to browse the seeded professional documents
  • Open the Decision Traces panel to see the pre-generated multi-step reasoning examples

Next steps

Neo4j setup options

Detailed guide to Aura, Docker, and neo4j-local setup

Custom domains

Generate a full ontology from a plain-English description

SaaS connectors

Import real data from GitHub, Slack, Jira, Notion, and more

CLI reference

Every flag and option, with defaults and examples

Build docs developers (and LLMs) love