Knowledge Graph
API endpoints for entity detection and knowledge graph management
Knowledge Graph API
The Knowledge Graph API allows you to extract entities and relationships from your documents, visualize the knowledge graph, and perform advanced graph operations.
Get Knowledge Graph Stats
Get statistics about the knowledge graph.
Response
Returns statistics about the knowledge graph, including entity and relationship counts.
Detect Entities
Detect entities and relationships from document chunks.
Request Body
Parameter | Type | Description | Default |
---|---|---|---|
document_ids | array | Array of document IDs to process (optional) | null |
force_rebuild | boolean | Whether to force rebuilding the knowledge graph | false |
Response
Returns a status object with information about the entity detection process.
Get Entity Detection Status
Get the current status of entity detection.
Response
Returns the current status of the entity detection process.
Get Entities
Get list of detected entities.
Query Parameters
Parameter | Type | Description | Default |
---|---|---|---|
limit | integer | Maximum number of entities to return | 100 |
entity_type | string | Filter by entity type | null |
min_mentions | integer | Minimum number of mentions required | 2 |
Response
Returns a list of entities matching the filter criteria.
Get Entity Details
Get a specific entity by ID.
Path Parameters
Parameter | Type | Description |
---|---|---|
entity_id | string | ID of the entity to retrieve |
Response
Returns detailed information about the specified entity.
Merge Entities
Merge multiple entities into one entity.
Request Body
Parameter | Type | Description |
---|---|---|
source_entities | array | Array of entity IDs to merge |
target_entity | string | ID of the entity to merge into |
Response
Returns a status object with information about the merge operation.
Get Relationships
Get list of detected relationships.
Query Parameters
Parameter | Type | Description | Default |
---|---|---|---|
limit | integer | Maximum number of relationships to return | 100 |
relationship_type | string | Filter by relationship type | null |
Response
Returns a list of relationships matching the filter criteria.
Get Graph Data
Get data for visualization of the knowledge graph.
Request Body
Parameter | Type | Description | Default |
---|---|---|---|
node_label | string | Label of the starting node | Required |
max_depth | integer | Maximum depth of the graph traversal | 3 |
max_nodes | integer | Maximum number of nodes to return | 1000 |
embeddingRank | integer | Rank of embeddings to use | 128 |
useGPU | boolean | Whether to use GPU for embedding generation | false |
Response
Returns graph data suitable for visualization.
Get Graph Data (GET method)
GET version of the graph data endpoint for visualization of the knowledge graph.
Query Parameters
Parameter | Type | Description | Default |
---|---|---|---|
node_label | string | Label of the starting node | Required |
max_depth | integer | Maximum depth of the graph traversal | 3 |
max_nodes | integer | Maximum number of nodes to return | 1000 |
embeddingRank | integer | Rank of embeddings to use | 128 |
useGPU | boolean | Whether to use GPU for embedding generation | false |
Response
Returns graph data suitable for visualization.
Get Hypergraph
Get hypergraph data for visualization.
Query Parameters
Parameter | Type | Description | Default |
---|---|---|---|
limit_entities | integer | Maximum number of entities to include | 100 |
limit_hyperedges | integer | Maximum number of hyperedges to include | 20 |
embedding_rank | integer | Rank of embeddings to use | 128 |
Response
Returns hypergraph data suitable for visualization.
Get Concept Clusters
Get concept clusters for visualization.
Query Parameters
Parameter | Type | Description | Default |
---|---|---|---|
embedding_rank | integer | Rank of embeddings to use | 128 |
Response
Returns concept cluster data suitable for visualization.
Generate Embeddings
Start the process of generating embeddings.
Query Parameters
Parameter | Type | Description | Default |
---|---|---|---|
embedding_rank | integer | Rank of embeddings to generate | 128 |
use_gpu | boolean | Whether to use GPU for embedding generation | false |
Response
Returns a status object with information about the embedding generation process.
Get Embedding Status
Get the current status of embedding generation.
Response
Returns the current status of the embedding generation process.
Connect to Neo4j
Connect to Neo4j database for knowledge graph storage.
Request Body
Parameter | Type | Description | Default |
---|---|---|---|
uri | string | URI of the Neo4j database | ”bolt://localhost:7687” |
username | string | Username for Neo4j authentication | ”neo4j” |
password | string | Password for Neo4j authentication | ”password” |
database | string | Name of the Neo4j database (optional) | null |
Response
Returns a status object with information about the Neo4j connection.