Skip to main content

Quickstart Guide

This guide will help you get started with the Graphora client library, showing you how to perform common operations with code examples.

Installation

First, install the library using pip:

Authentication

Graphora APIs are protected by Clerk. Every request must include a Clerk-issued bearer token (JWT) in the Authorization header.
The client stores the token and automatically applies the correct Authorization: Bearer <token> header. The legacy GRAPHORA_API_KEY variable is deprecated and will be removed in a future release.

Basic Workflow

The typical workflow for using Graphora involves:
  1. Defining an ontology
  2. Uploading documents for processing
  3. Monitoring the transformation process
  4. Merging the extracted data
  5. Querying the resulting graph
Let’s walk through each step with code examples.

1. Define and Upload an Ontology

An ontology defines the structure of your knowledge graph, including entity types and their relationships.

2. Upload Documents for Processing

Once you have an ontology, you can upload documents to be processed according to that ontology.

3. Monitor the Transformation Process

Transforming documents is an asynchronous process. You can check the status or wait for completion.

4. Get the Transformed Graph

After transformation, you can retrieve the resulting graph.

5. Merge the Extracted Data

You can merge the extracted data into your knowledge graph.

6. Check for Conflicts

During the merge process, there might be conflicts that need resolution.

7. Get the Merged Graph

Finally, you can retrieve the merged graph.

Complete Example

Here’s a complete example that ties all these steps together:

Next Steps

Now that you’re familiar with the basic workflow, you can: