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

  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.

Supported Backends

  • DuckDB [default]
  • Neo4j

Commands

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

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

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

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

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

    poetry run kg app
    

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.0.1.tar.gz (418.7 kB view hashes)

Uploaded Source

Built Distribution

kg_chat-0.0.1-py3-none-any.whl (420.7 kB view hashes)

Uploaded Python 3

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