This project aims to promote the culture of Li Bai, a renowned Tang Dynasty poet, by building a knowledge graph and training an AI agent. It targets enthusiasts of Chinese poetry and culture, offering an interactive, generative dialogue experience to explore Li Bai's works and life.
How It Works
The project constructs a knowledge graph centered around Li Bai and classical Chinese poetry using NLP and information extraction techniques. This graph serves as a knowledge base for training a large language model (LLM) based AI agent. The agent then powers a generative dialogue application, enhanced with Retrieval-Augmented Generation (RAG), to provide users with an engaging and informative experience, including question answering, poetry appreciation, and even voice/image generation.
Quick Start & Requirements
- Installation: Clone the repository, create a Python 3.10+ environment (e.g., using Conda), install dependencies via
pip install -r requirements.txt
.
- Prerequisites:
- Third-party LLM API keys (e.g., Zhipu AI, Moonshot, Baichuan) for model interaction.
- Neo4j database (Docker installation recommended).
- Data import into Neo4j using provided Cypher queries (sample data available).
- Configuration of API keys and Neo4j connection details in
.env
and config-local.yaml
.
- Setup: Requires configuration of API keys and database setup, estimated time depends on user familiarity with these components.
- Resources: Access to Bilibili video for detailed guidance is provided.
Highlighted Details
- Utilizes a knowledge graph for structured representation of Li Bai's cultural information.
- Integrates LLMs with RAG for enhanced conversational AI capabilities.
- Supports various interaction modes: standard chat, relationship-based queries, attribute queries, and generative voice/image output.
- Includes a "Fei Hua Ling" (a Chinese word-guessing game) feature.
- Offers visualization tools for exploring the knowledge graph structure.
Maintenance & Community
- The project is maintained by BinNong.
- A Bilibili video provides detailed introduction and guidance.
- Coffee/donation link is provided for support.
Licensing & Compatibility
- The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.
Limitations & Caveats
- The project does not provide complete Li Bai data due to third-party copyright concerns, only sample data for Neo4j import.
- Two services ("白话文搜古文" and "古文搜古文") are not open-sourced and require independent development based on provided interface rules.
- Currently, only Zhipu AI is supported for text-to-image generation.