New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

llama-index-packs-docugami-kg-rag

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

llama-index-packs-docugami-kg-rag

This template contains a reference architecture for Retrieval Augmented Generation against a set of documents using Docugami's XML Knowledge Graph (KG-RAG).

  • 0.3.0
  • PyPI
  • Socket score

Maintainers
1

Docugami KG-RAG Pack

This LlamaPack provides an end-to-end Knowledge Graph Retrieval Augmented Generation flow using Docugami.

Process Documents in Docugami (before you use this template)

Before you use this llamapack, you must have some documents already processed in Docugami. Here's what you need to get started:

  1. Create a Docugami workspace (free trials available)
  2. Create an access token via the Developer Playground for your workspace. Detailed instructions.
  3. Add your documents to Docugami for processing. There are two ways to do this:
    • Upload via the simple Docugami web experience. Detailed instructions.
    • Upload via the Docugami API, specifically the documents endpoint. Code samples are available for python and JavaScript or you can use the docugami python library.

Once your documents are in Docugami, they are processed and organized into sets of similar documents, e.g. NDAs, Lease Agreements, and Service Agreements. Docugami is not limited to any particular types of documents, and the clusters created depend on your particular documents. You can change the docset assignments later if you wish. You can monitor file status in the simple Docugami webapp, or use a webhook to be informed when your documents are done processing.

Environment Variables

You need to set some required environment variables before using your new app based on this template. These are used to index as well as run the application, and exceptions are raised if the following required environment variables are not set:

  1. OPENAI_API_KEY: from the OpenAI platform.
  2. DOCUGAMI_API_KEY: from the Docugami Developer Playground
export OPENAI_API_KEY=...
export DOCUGAMI_API_KEY=...

Using the llamapack

Once your documents are finished processing, you can build and use the agent by adding the following code

from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
DocugamiKgRagPack = download_llama_pack(
    "DocugamiKgRagPack", "./docugami_kg_rag"
)

docset_id = ...
pack = DocugamiKgRagPack()
pack.build_agent_for_docset(docset_id)
pack.run(...)

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc