Ingest PDF

Ingest a PDF into Graphlit

Let's start with a simple, but common use case: Chat with a PDF.

Graphlit uses the power of Large Language Models (LLMs) to extract useful knowledge from PDFs, and ask questions about the content.

We can use this interesting paper on Knowledge Graphs and LLMs, which we've placed on cloud storage as an example.

https://graphlitplatform.blob.core.windows.net/samples/Unifying%20Large%20Language%20Models%20and%20Knowledge%20Graphs%20A%20Roadmap-2306.08302.pdf

Or if you have a URL to a cloud-hosted PDF, feel free to use that one.

The ingestUri mutation is used for ingesting individual cloud-hosted files, like PDFs, MP3s or Word documents, or for HTML web pages. The ingestText mutation is used for ingesting for raw HTML, Markdown or plain text.

Assuming you're logged into the Graphlit Developer Portal, you can use the embedded API explorer to test this out. For more information, see the Projects page.

Once you have your PDF ingested into Graphlit, you can explore the knowledge inside.

Mutation:

mutation IngestUri($uri: URL!) {
  ingestUri(uri: $uri) {
    id
    name
    state
    type
    fileType
    uri
  }
}

Variables:

{
  "uri": "https://graphlitplatform.blob.core.windows.net/samples/Unifying%20Large%20Language%20Models%20and%20Knowledge%20Graphs%20A%20Roadmap-2306.08302.pdf"
}

Response:

{
  "type": "FILE",
  "fileType": "DOCUMENT",
  "uri": "https://graphlitplatform.blob.core.windows.net/samples/Unifying%20Large%20Language%20Models%20and%20Knowledge%20Graphs%20A%20Roadmap-2306.08302.pdf",
  "id": "c4af9350-30bf-49a9-aa4a-ba15e4f811ef",
  "name": "Unifying Large Language Models and Knowledge Graphs A Roadmap-2306.08302.pdf",
  "state": "CREATED"
}

Last updated