This guide explains how to use Vedaya’s Knowledge Graph API to extract entities and relationships from your documents, visualize the knowledge graph, and perform advanced graph operations.
After ingesting documents, you can start entity detection:
Copy
import requestsimport jsonurl = "https://vedaya-backend.fly.dev/api/knowledge-graph/detect-entities"payload = json.dumps({ "document_ids": ["f12345678"], # Optional: specific documents only "force_rebuild": False # Set to True to rebuild from scratch})headers = { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json'}response = requests.post(url, headers=headers, data=payload)print(response.json())
This will start an asynchronous process to detect entities and relationships in your documents. The process runs in the background, and you can check its status: