Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

📚 Knowledge Graph Chatbot

An interactive chatbot that lets you ingest documents & URLs, build a knowledge graph in Neo4j, and chat with your knowledge using LLMs (Cohere / Gemini). It combines structured graph queries and vector-based semantic search to deliver accurate, source-grounded answers.


🚀 Features

  • Data Ingestion: Upload PDFs, DOCX, TXT, CSV, XLSX or scrape web pages.
  • Knowledge Graph Extraction: Uses LLMs to identify entities, relationships, and concepts.
  • Vector Search: Embedding-based retrieval for contextual answers.
  • Hybrid QA: Combines Cypher graph queries + vector semantic search.
  • Source Attribution: Answers reference original documents/URLs.
  • Strict Mode: No hallucinations — answers only from your ingested data.
  • Interactive UI: Built with Gradio for an easy-to-use interface.

🛠️ Tech Stack


⚡ How It Works

  1. Connect to Neo4j (AuraDB or self-hosted)
  2. Choose LLM Provider (Cohere or Gemini) + enter API key
  3. Upload files or enter URLs
  4. Process & Build Knowledge Graph → creates entities, relationships, and vector index
  5. Ask Questions → chatbot retrieves structured + unstructured knowledge to answer

📦 Installation (for local / Kaggle use)

pip install gradio langchain neo4j python-dotenv requests beautifulsoup4
pip install langchain-community langchain-experimental
pip install langchain-google-genai cohere
pip install json-repair
pip install unstructured[all-docs]

▶️ Run Locally

python app.py

The Gradio interface will launch at http://0.0.0.0:7860 (or shareable link if share=True).


🌐 Hugging Face Space

👉 Try it directly on Hugging Face Spaces


🔑 Requirements

  • Neo4j database (Neo4j Aura recommended)
  • API Key for Cohere or Google Gemini
  • Documents or URLs to process

📖 Example Queries

  • Entity-based: “What organizations are mentioned in the documents?”
  • Relationship: “How are [Entity A] and [Entity B] related?”
  • Content: “Summarize the main concepts about cybersecurity in these files.”

👤 Author

Developed by samuelolubukun


About

A knowledge graph-powered chatbot pipeline that ingests unstructured data, transforms it into a graph using langchain and stored in a graph database using Neo4j , and enables intelligent retrieval and interaction through an LLM agent.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages