MindGraphDocs

Quickstart

Go from zero to your first API call in under 5 minutes.

1. Create an account

Sign up at mindgraph.cloud/login. The free tier includes 200 credits per month with unlimited queries and API access.

2. Get an API key

Go to Dashboard → API Keys and create a new key. Copy it — you won't be able to see it again.

3. Install an SDK

npm install mindgraph

4. Make your first call

import { MindGraph } from "mindgraph"

const graph = new MindGraph({
  baseUrl: "https://api.mindgraph.cloud",
  apiKey: "mg_your_key_here",
})

// Add a node
const node = await graph.addNode({
  label: "User prefers dark mode",
  node_type: "Preference",
})
console.log("Created:", node.uid)

// Search for it
const results = await graph.search("dark mode")
console.log("Found:", results.length, "results")

// Connect to another node
await graph.addLink({
  from_uid: node.uid,
  to_uid: "some_user_uid",
  edge_type: "BelongsTo",
})

5. Complete example

A realistic workflow: create an entity, make a claim about it, build an argument with evidence, search for it, and traverse the reasoning chain.

import { MindGraph } from "mindgraph"

const graph = new MindGraph({
  baseUrl: "https://api.mindgraph.cloud",
  apiKey: "mg_your_key_here",
})

// 1. Create entities using first-class type methods (preferred)
const org = await graph.findOrCreateOrganization("Acme Corp", { description: "SaaS startup" })
console.log("Organization:", org.uid)

// findOrCreateEntity still works as a fallback for other types
const entity = await graph.findOrCreateEntity("TypeScript", { entity_type: "language" })
console.log("Entity:", entity.uid)

// 2. Build an argument with claim + evidence
const arg = await graph.argue({
  claim: {
    label: "TypeScript adoption",
    props: { content: "TypeScript improves developer productivity" },
  },
  evidence: [
    { label: "Type safety", props: { description: "Static types catch bugs at compile time" } },
    { label: "IDE support", props: { description: "Rich autocomplete and refactoring tools" } },
  ],
  warrant: {
    label: "Type system principle",
    props: { principle: "Static analysis reduces runtime errors" },
  },
  agent_id: "my-agent",
})
console.log("Claim:", arg.claim_uid)

// 3. Search for it
const results = await graph.search("TypeScript productivity")
console.log("Found:", results.length, "results")

// 4. Traverse the reasoning chain
const chain = await graph.reasoningChain(arg.claim_uid, 3)
console.log("Chain:", chain.map(s => s.label).join(" -> "))

Next steps

  • Concepts — Learn about the six cognitive layers, node types, and edge types.
  • Cognitive Endpoints — Full reference for all 18 cognitive endpoints with action enums and request/response schemas.
  • API Reference — Full reference for all 77 endpoints.
  • SDKs — Detailed guides for TypeScript and Python.