Quickstart
Local development (graphdb dev)
Section titled “Local development (graphdb dev)”Start the full graph engine stack locally — no cloud credentials required.
# 1. Initialize a new projectnpx @graphdb-labs/cli init my-rag-projectcd my-rag-project
# 2. Start the local stacknpx @graphdb-labs/cli dev# → http://localhost:8787 is now running# → D1 local SQLite + Durable Object emulation + KV local store# → X-Internal-Sig check bypassed (ENVIRONMENT=development)# → Default tenant: dev-tenantCreate your first graph
Section titled “Create your first graph”# Create a projectcurl -X POST http://localhost:8787/v1/projects \ -H "Content-Type: application/json" \ -H "X-Tenant-Id: dev-tenant" \ -d '{ "name": "My RAG Project", "slug": "my-rag-project" }'
# Create a graphcurl -X POST http://localhost:8787/v1/projects/{projectId}/graphs \ -H "Content-Type: application/json" \ -H "X-Tenant-Id: dev-tenant" \ -d '{ "name": "main", "environment": "production" }'Define a schema
Section titled “Define a schema”# Define a Document node typecurl -X POST http://localhost:8787/v1/graphs/{graphId}/schema/node-types \ -H "Content-Type: application/json" \ -H "X-Tenant-Id: dev-tenant" \ -d '{ "typeName": "Document", "fieldDefs": [ { "name": "title", "type": "string", "required": true }, { "name": "source", "type": "string" } ] }'
# Define a Chunk node typecurl -X POST http://localhost:8787/v1/graphs/{graphId}/schema/node-types \ -H "Content-Type: application/json" \ -H "X-Tenant-Id: dev-tenant" \ -d '{ "typeName": "Chunk", "fieldDefs": [ { "name": "text", "type": "string", "required": true }, { "name": "vector_id", "type": "string" } ] }'
# Define a HAS_CHUNK edge typecurl -X POST http://localhost:8787/v1/graphs/{graphId}/schema/edge-types \ -H "Content-Type: application/json" \ -H "X-Tenant-Id: dev-tenant" \ -d '{ "typeName": "HAS_CHUNK", "fromType": "Document", "toType": "Chunk" }'Create nodes and edges
Section titled “Create nodes and edges”# Create a Document nodecurl -X POST http://localhost:8787/v1/graphs/{graphId}/nodes \ -H "Content-Type: application/json" \ -H "X-Tenant-Id: dev-tenant" \ -d '{ "id": "doc_1", "type": "Document", "properties": { "title": "Refund Policy", "source": "handbook" } }'
# Create Chunk nodescurl -X POST http://localhost:8787/v1/graphs/{graphId}/nodes \ -H "Content-Type: application/json" \ -H "X-Tenant-Id: dev-tenant" \ -d '{ "id": "chunk_1", "type": "Chunk", "properties": { "text": "Refunds are processed within 7 days..." } }'
# Link themcurl -X POST http://localhost:8787/v1/graphs/{graphId}/edges \ -H "Content-Type: application/json" \ -H "X-Tenant-Id: dev-tenant" \ -d '{ "fromNode": "doc_1", "toNode": "chunk_1", "type": "HAS_CHUNK" }'Traverse the graph
Section titled “Traverse the graph”curl -X POST http://localhost:8787/v1/graphs/{graphId}/traverse \ -H "Content-Type: application/json" \ -H "X-Tenant-Id: dev-tenant" \ -d '{ "startNodeId": "doc_1", "maxDepth": 2, "edgeTypes": ["HAS_CHUNK"] }'Deploy to production
Section titled “Deploy to production”Deploy through GitHub Actions on the product repos (core, edge-gateway, …).
Do not run local wrangler deploy. See Deployment.
# Optional: push local schema against a linked cloud project (when CLI supports it)npx @graphdb-labs/cli link --project <project-id>npx @graphdb-labs/cli push