KG API

Query entities, traverse relationships, and ingest data into the Knowledge Graph through MCP tools and REST endpoints.


MCP Tools

The primary way to interact with the Knowledge Graph is through MCP tools, available from any connected client.

query_kg_edges

Query relationship edges in the graph. Filter by source entity, target entity, edge type, or metadata.

// Lead scoring — query all SCORED edges for a lead
{
  "source_name": "Jane Smith",
  "edge_type": "SCORED",
  "limit": 50
}

// Investor matching — query all SCORED edges for a startup
{
  "source_name": "Acme Corp",
  "edge_type": "SCORED",
  "limit": 50
}

// Any use case — query all edges between two entities
{
  "source_name": "Jane Smith",
  "target_name": "Q2 Outreach Campaign",
  "limit": 10
}

get_scoring_history

Retrieve the full scoring history for an entity across all workflow executions.

// Lead scoring — history for a contact
{
  "entity_name": "Jane Smith",
  "edge_types": ["SCORED", "APPROVED", "REJECTED"]
}

// Investor matching — history for a startup
{
  "entity_name": "Acme Corp",
  "edge_types": ["SCORED", "PROCEED_TO_IC", "HOLD"]
}

Returns timestamped scores with rationale, enabling trend analysis and calibration.

get_knowledge_rows

Fetch rows from a Knowledge List. Lists are structured datasets (CSV-like) stored in the workspace.

// Lead scoring — fetch the leads list
{
  "list_key": "leads",
  "limit": 100,
  "offset": 0
}

// Investor matching — fetch the portfolio companies list
{
  "list_key": "portfolio-companies",
  "limit": 100,
  "offset": 0
}

get_knowledge_text

Retrieve text content from a knowledge entry. Useful for documents, notes, and unstructured data.

// Lead scoring — fetch the ICP definition
{
  "key": "icp-definition"
}

// Investor matching — fetch the investment thesis
{
  "key": "investment-thesis"
}

Ingestion Endpoints

Push data into the Knowledge Graph from external systems. All endpoints accept JSON payloads.

EndpointPurpose
/ingest/historicalBatch import historical entities (companies, contacts, deals)
/ingest/knowledge-dataSync workspace Knowledge List rows to graph entities
/ingest/insightStore AI-generated insights linked to entities
/ingest/execution-knowledge-linkLink execution results to knowledge nodes with scored edges

Within AI Steps

AI steps in workflows automatically receive four KG tools. No configuration is needed — the tools are injected based on the workspace's Knowledge Graph connection.

// Lead scoring — AI step reads prior decisions before scoring
kg_search("leads qualified in the last 30 days from SaaS companies")
kg_traverse("Jane Smith", "APPROVED")
kg_nodes("lead")
kg_write({
  insight: "Leads from LinkedIn outreach convert at 2x vs inbound form",
  entity: "Q2 Outreach Campaign",
  category: "conversion_pattern"
})

// Investor matching — AI step reads thesis and prior outcomes
kg_search("startups that proceeded to IC in healthtech in 2025")
kg_traverse("Acme Corp", "PROCEED_TO_IC")
kg_nodes("startup")
kg_write({
  insight: "Regulatory approval status was the deciding factor for 3 of last 5 IC approvals",
  entity: "Investment Thesis",
  category: "decision_pattern"
})

When the Knowledge Graph is unavailable, tools return empty results instead of errors, so workflows degrade gracefully.


Next Steps