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
- 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.
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.
poetry run kg test-query
-
QnA: Ask questions about the data.
poetry run kg qna "how many nodes do we have here?"
-
Chat: Start an interactive chat session.
poetry run kg chat
-
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
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.1.tar.gz
.
File metadata
- Download URL: kg_chat-0.1.1.tar.gz
- Upload date:
- Size: 418.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49b0954ad320b58688000c300a108a862b9d6355e97ebf1f5b837c47d933b6a6 |
|
MD5 | a81141bb49d03bed6c953ac399eb4a1f |
|
BLAKE2b-256 | 64c1ccbb1755b80ddaca3570507d0246e1cd91257e2abf1ca6a511591f820f79 |
File details
Details for the file kg_chat-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: kg_chat-0.1.1-py3-none-any.whl
- Upload date:
- Size: 420.5 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 | dd240298762b75982acea557c6e412cb4f7a392b984f088e078d39e0a0884fa3 |
|
MD5 | c18b09d7e787b9712ab17e0715767d65 |
|
BLAKE2b-256 | f2337ebf13692fdc0e3317237eec5d98ff9b78f4b5ec98863c18802f6b57803e |