llama-index-packs-docugami-kg-rag


Namellama-index-packs-docugami-kg-rag JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryThis template contains a reference architecture for Retrieval Augmented Generation against a set of documents using Docugami's XML Knowledge Graph (KG-RAG).
upload_time2024-08-22 16:50:06
maintainerNone
docs_urlNone
authorDocugami
requires_python<4.0,>=3.9
licenseNone
keywords infer rag retrieve retriever
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://app.docugami.com/) (free trials available)
1. Create an access token via the Developer Playground for your workspace. [Detailed instructions](https://help.docugami.com/home/docugami-api).
1. Add your documents to Docugami for processing. There are two ways to do this:
   - Upload via the simple Docugami web experience. [Detailed instructions](https://help.docugami.com/home/adding-documents).
   - Upload via the Docugami API, specifically the [documents](https://api-docs.docugami.com/#tag/documents/operation/upload-document) endpoint. Code samples are available for python and JavaScript or you can use the [docugami](https://pypi.org/project/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](https://help.docugami.com/home/working-with-the-doc-sets-view) later if you wish. You can monitor file status in the simple Docugami webapp, or use a [webhook](https://api-docs.docugami.com/#tag/webhooks) 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.
1. `DOCUGAMI_API_KEY`: from the [Docugami Developer Playground](https://help.docugami.com/home/docugami-api)

```shell
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

```python
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(...)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-packs-docugami-kg-rag",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "infer, rag, retrieve, retriever",
    "author": "Docugami",
    "author_email": "contact@docugami.com",
    "download_url": "https://files.pythonhosted.org/packages/bf/ca/b563c9182a315bca04adb4ec78b7a2880948b4f9dc2169e114cea20c2adc/llama_index_packs_docugami_kg_rag-0.2.0.tar.gz",
    "platform": null,
    "description": "# Docugami KG-RAG Pack\n\nThis LlamaPack provides an end-to-end Knowledge Graph Retrieval Augmented Generation flow using Docugami.\n\n## Process Documents in Docugami (before you use this template)\n\nBefore you use this llamapack, you must have some documents already processed in Docugami. Here's what you need to get started:\n\n1. Create a [Docugami workspace](https://app.docugami.com/) (free trials available)\n1. Create an access token via the Developer Playground for your workspace. [Detailed instructions](https://help.docugami.com/home/docugami-api).\n1. Add your documents to Docugami for processing. There are two ways to do this:\n   - Upload via the simple Docugami web experience. [Detailed instructions](https://help.docugami.com/home/adding-documents).\n   - Upload via the Docugami API, specifically the [documents](https://api-docs.docugami.com/#tag/documents/operation/upload-document) endpoint. Code samples are available for python and JavaScript or you can use the [docugami](https://pypi.org/project/docugami/) python library.\n\nOnce 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](https://help.docugami.com/home/working-with-the-doc-sets-view) later if you wish. You can monitor file status in the simple Docugami webapp, or use a [webhook](https://api-docs.docugami.com/#tag/webhooks) to be informed when your documents are done processing.\n\n## Environment Variables\n\nYou 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:\n\n1. `OPENAI_API_KEY`: from the OpenAI platform.\n1. `DOCUGAMI_API_KEY`: from the [Docugami Developer Playground](https://help.docugami.com/home/docugami-api)\n\n```shell\nexport OPENAI_API_KEY=...\nexport DOCUGAMI_API_KEY=...\n```\n\n## Using the llamapack\n\nOnce your documents are finished processing, you can build and use the agent by adding the following code\n\n```python\nfrom llama_index.core.llama_pack import download_llama_pack\n\n# download and install dependencies\nDocugamiKgRagPack = download_llama_pack(\n    \"DocugamiKgRagPack\", \"./docugami_kg_rag\"\n)\n\ndocset_id = ...\npack = DocugamiKgRagPack()\npack.build_agent_for_docset(docset_id)\npack.run(...)\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "This template contains a reference architecture for Retrieval Augmented Generation against a set of documents using Docugami's XML Knowledge Graph (KG-RAG).",
    "version": "0.2.0",
    "project_urls": null,
    "split_keywords": [
        "infer",
        " rag",
        " retrieve",
        " retriever"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "55d9fceac6d9ade6768d41a00e4f2747b2561c806adcf3ceede4d432f55a2db9",
                "md5": "40d30e02fb083de8a01d61f6c2d90e65",
                "sha256": "6f5e17c1c0a6b1bb6a1ff4b23c39e9310339cd4ed5e24030946ddbfc53cff8ea"
            },
            "downloads": -1,
            "filename": "llama_index_packs_docugami_kg_rag-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "40d30e02fb083de8a01d61f6c2d90e65",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 17601,
            "upload_time": "2024-08-22T16:50:05",
            "upload_time_iso_8601": "2024-08-22T16:50:05.245677Z",
            "url": "https://files.pythonhosted.org/packages/55/d9/fceac6d9ade6768d41a00e4f2747b2561c806adcf3ceede4d432f55a2db9/llama_index_packs_docugami_kg_rag-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bfcab563c9182a315bca04adb4ec78b7a2880948b4f9dc2169e114cea20c2adc",
                "md5": "260231446ede30d1773de02dc9d32992",
                "sha256": "fcf21a51c334b7a9dc5831be5511a33bef6848a01f63ecd15d35c5cacc575409"
            },
            "downloads": -1,
            "filename": "llama_index_packs_docugami_kg_rag-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "260231446ede30d1773de02dc9d32992",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 13639,
            "upload_time": "2024-08-22T16:50:06",
            "upload_time_iso_8601": "2024-08-22T16:50:06.665370Z",
            "url": "https://files.pythonhosted.org/packages/bf/ca/b563c9182a315bca04adb4ec78b7a2880948b4f9dc2169e114cea20c2adc/llama_index_packs_docugami_kg_rag-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-22 16:50:06",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-packs-docugami-kg-rag"
}
        
Elapsed time: 0.78815s