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:
EnsureOPENAI_API_KEY
is set as an environmental variable.
Setup
For Neo4j Backend (Optional)
- Install Neo4j desktop from here.
- Create a new project and database, then start it.
- Install the APOC plugin in Neo4j Desktop.
- Update settings to match
neo4j_db_settings.conf
.
General Setup
For Developers
- Clone this repository.
- Create a virtual environment and install dependencies:
cd kg-chat pip install poetry poetry install
- Replace
data/nodes.tsv
anddata/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
-
Import KG: Load nodes and edges into a database (default: duckdb).
poetry run kg import
-
Test Query: Run a test query. NOTE:
--data-dir
is a required parameter for all commands.poetry run kg test-query --data-dir data
-
QnA: Ask questions about the data.
poetry run kg qna "how many nodes do we have here?" --data-dir data
-
Chat: Start an interactive chat session.
poetry run kg chat --data-dir data
-
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file kg_chat-0.1.2rc1.tar.gz
.
File metadata
- Download URL: kg_chat-0.1.2rc1.tar.gz
- Upload date:
- Size: 418.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d236c7491ae638b3ba92ef2ebcbabbb9940bf747a43d466de8f9bfd996a66ae |
|
MD5 | ae733c1b2547b1317cbd1f6b5d4b297d |
|
BLAKE2b-256 | 47b8acc49bc9c530739d97dcfb3c3e48e16325f58b07fe818e5ea7243c612019 |
File details
Details for the file kg_chat-0.1.2rc1-py3-none-any.whl
.
File metadata
- Download URL: kg_chat-0.1.2rc1-py3-none-any.whl
- Upload date:
- Size: 420.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 228115c8e53419290cf50ac218d8c19f38d7752849a0bd15873e894ab1252a52 |
|
MD5 | c936171cc3aeaf849c098bc6fc03e651 |
|
BLAKE2b-256 | 4d4806f0007d0b1f23537e8a8a87f8e28fbb4d442cc3520bbc086f4f7864df33 |