Build Knowledge Graph
Construct a knowledge graph from a parsed document by extracting entities and relationships.Endpoint
POST /api/knowledge-graph
Request Body
The ID of the parsed document to process
Specific entity types to extract (e.g.,
["person", "organization", "location"])Whether to extract relationships between entities
Response
Unique identifier for the knowledge graph job
Source document identifier
Processing status:
pending, processing, completed, failedExample
Query Knowledge Graph
Search the knowledge graph using natural language queries or structured filters.Endpoint
POST /api/knowledge-graph/query
Request Body
Natural language query or entity name to search for
Filter results by entity types
Maximum relationship depth to traverse (1-5)
Maximum number of entities to return
Response
Array of matching entities
Array of relationships between entities
Example
Get Graph Statistics
Retrieve statistics and metadata about the knowledge graph.Endpoint
GET /api/knowledge-graph/stats
Response
Total number of entities in the graph
Total number of relationships
Count of entities by type
Number of documents contributing to the graph
Example
Export Graph Data
Export the knowledge graph in various formats for visualization or analysis.Endpoint
GET /api/knowledge-graph/export
Query Parameters
Export format:
json, cypher, graphmlFilter entities by type or property
Example
Supported Entity Types
People
- Person
- Author
- Executive
Organizations
- Company
- Institution
- Department
Locations
- City
- Country
- Address
Concepts
- Technology
- Product
- Service
Temporal
- Date
- Event
- Period
Financial
- Currency
- Amount
- Transaction
Relationship Types
Common relationship types extracted by the system:works_for- Employment relationshiplocated_in- Geographic relationshippart_of- Hierarchical relationshiprelated_to- General associationmentions- Document referenceuses- Technology/tool usage
