Skip to main content

kg-chat

Project description

kg-chat

LLM-based chatbot that queries and visualizes KGX nodes and edges TSV files loaded into either DuckDB (default) or neo4j database backend.

NOTE:
Ensure OPENAI_API_KEY is set as an environmental variable.

Setup

For Neo4j Backend (Optional)

  1. Install Neo4j desktop from here.
  2. Create a new project and database, then start it.
  3. Install the APOC plugin in Neo4j Desktop.
  4. Update settings to match neo4j_db_settings.conf.

General Setup

For Developers

  1. Clone this repository.
  2. Create a virtual environment and install dependencies:
    cd kg-chat
    pip install poetry
    poetry install
    
  3. Replace data/nodes.tsv and data/edges.tsv with desired KGX files if needed.

For using kg-chat as a dependency

pip install kg-chat

OR

poetry add kg-chat@latest

Supported Backends

  • DuckDB [default]
  • Neo4j

Commands

  1. Import KG: Load nodes and edges into a database (default: duckdb).

    poetry run kg import --data-dir data
    
  2. Test Query: Run a test query.

    NOTE: --data-dir is a required parameter for all commands. This is the path for the directory which contains the nodes.tsv and edges.tsv file. The filenames are expected to be exactly that.

    poetry run kg test-query --data-dir data
    
  3. QnA: Ask questions about the data.

    poetry run kg qna "how many nodes do we have here?" --data-dir data
    
  4. Chat: Start an interactive chat session.

    poetry run kg chat --data-dir data
    
  5. App: Deploy a local web application.

    poetry run kg app --data-dir data
    

Visualization

Use show me in prompts for KG visualization.


Acknowledgements

This cookiecutter project was developed from the monarch-project-template template and will be kept up-to-date using cruft.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kg_chat-0.1.2rc2.tar.gz (419.0 kB view details)

Uploaded Source

Built Distribution

kg_chat-0.1.2rc2-py3-none-any.whl (420.9 kB view details)

Uploaded Python 3

File details

Details for the file kg_chat-0.1.2rc2.tar.gz.

File metadata

  • Download URL: kg_chat-0.1.2rc2.tar.gz
  • Upload date:
  • Size: 419.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for kg_chat-0.1.2rc2.tar.gz
Algorithm Hash digest
SHA256 3c860967a72478bd9d1a95a0c40c20ffb67adfa4a0fb7267bf7773145dd128e1
MD5 1648c20e2a62ab0668982ed16bf24cc5
BLAKE2b-256 9558c9c47a436f6a74cfcf360a4bc5a166ef2b70f257e433615a633f888145c3

See more details on using hashes here.

File details

Details for the file kg_chat-0.1.2rc2-py3-none-any.whl.

File metadata

  • Download URL: kg_chat-0.1.2rc2-py3-none-any.whl
  • Upload date:
  • Size: 420.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for kg_chat-0.1.2rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 2d7fcdfadd19e4fc58c2f29ac6485e77ce64bfbc0f618f9b12796fbf724aba24
MD5 8ba3b07cd2faa3c2bad3d66e65c5ee93
BLAKE2b-256 465dd6073f5f9cfa657efb81012dc77c43054eab700b25d547fbd73eb3274c11

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page