Skip to content

A project that builds a Movie Knowledge Graph using Neo4j and GROQ API. It models movie data such as title, actors, director, and genres, enabling powerful graph-based queries and insights.

License

Notifications You must be signed in to change notification settings

SAKTHIVINASH2/Movie-Knowledge-Graph-using-Neo4j-and-GROQ-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Movie Knowledge Graph using Neo4j and GROQ API

Introduction

This project showcases how to construct a knowledge graph for a movie dataset using Neo4j and GROQ API. The dataset includes attributes such as movieId, title, release year, actors, director, genres, and IMDb rating. By combining the power of graph databases and GROQ queries, the project allows for advanced semantic queries, providing valuable insights into the movie domain.


Features

  • Creation of a movie knowledge graph with interconnected nodes (movies, actors, genres, directors).
  • Querying the knowledge graph using Neo4j's Cypher language.
  • Integration with GROQ API for data augmentation and enhanced querying.
  • Semantic relationships and insights into movie data trends.

Technologies Used

  • Neo4j: Graph database for storing and querying movie data.
  • GROQ API: For additional data enrichment and querying capabilities.
  • LangChain: Framework for intelligent chain-based querying with LLM integration.
  • Python: For data preprocessing, API integration, and orchestration.

Dataset

The dataset includes the following fields:

  • movieId: Unique identifier for each movie.
  • title: Name of the movie.
  • released: Year of release.
  • actors: List of main actors.
  • director: Name of the director.
  • genres: Categories the movie belongs to.
  • imdbRating: IMDb rating of the movie.

Setup and Installation

Prerequisites

  1. Neo4j AuraDB: Set up a free instance on Neo4j AuraDB.
  2. GROQ API Key: Obtain an API key from the GROQ platform.
  3. Python 3.8+: Install Python on your system.

Installation Steps

  1. Clone the repository:
    git clone https://github.com/SAKTHIVINASH2/Movie-Knowledge-Graph-using-Neo4j-and-GROQ-API.git
    cd Movie-Knowledge-Graph-using-Neo4j-and-GROQ-API
  2. Install dependencies:
    pip install -r requirements.txt
  3. Add your API keys:
  • Update the config.py file with your Neo4j connection details and GROQ API key.
  1. Load the dataset into Neo4j:
  • Use Cypher queries or provided scripts to populate the database with movie data.

How to Run

  1. Start your Neo4j database instance.
  2. Run the Python script:
python main.py
  1. Query the knowledge graph using:
  • The Neo4j Browser.
  • Predefined GROQ-powered functions in the script.

Example Query

To find the director of the movie GoldenEye:

response = chain.invoke({"query": "Who was the director of the movie GoldenEye"})
print(response)

Project Structure

├── data/
│   └── link.txt          # Link to movie dataset
|   └── README.md         # dataset documentation
├── result/
|   └── neo4j_query_table_data_2024-11-22.csv  # sample result CSV file
|   └── visualisation (1).png  # sample png
├── src/
│   └── main.py              # Main script to run the project
|                           # Neo4j graph initialization and utilities
│                           # GROQ API integration functions
├── requirements.txt        # Required Python libraries
├── README.md               # Project documentation

Result


Future Enhancements

  • Add recommendation system capabilities using graph traversal.
  • Visualize the graph for better exploration of relationships.
  • Expand the dataset to include additional attributes like box office data or reviews.

License

This project is licensed under the MIT License.


Contact

For any queries or suggestions, feel free to reach out at sakthivinashb@example.com.

About

A project that builds a Movie Knowledge Graph using Neo4j and GROQ API. It models movie data such as title, actors, director, and genres, enabling powerful graph-based queries and insights.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published