Skip to content

Repository files navigation

Kaggle Knowledge Graph

Tests Code Coverage Hugging Face Examples License


This repository contains code for building a knowledge graph from the Meta Kaggle dataset and loading it into IssunDB, which provides CLI and MCP interfaces for querying the data.

Quickstart

Data

The pipeline needs the Meta Kaggle tabular dataset, and it can (optionally) include the Meta Kaggle Code dataset.

1. Download Meta Kaggle Dataset

curl -L -o /path/to/meta-kaggle.zip \
  https://www.kaggle.com/api/v1/datasets/download/kaggle/meta-kaggle

2. Extract Meta Kaggle Dataset

unzip /path/to/meta-kaggle.zip -d /path/to/meta-kaggle

3. Download and Extract Meta Kaggle Code (Optional)

curl -L -o /path/to/meta-kaggle-code.zip \
  https://www.kaggle.com/api/v1/datasets/download/kaggle/meta-kaggle-code
  
unzip /path/to/meta-kaggle-code.zip -d /path/to/meta-kaggle-code

4. Configure Environment Variables

export META_KAGGLE_DIR="/path/to/meta-kaggle"

# This is optional. Set only if Meta Kaggle Code was downloaded
export META_KAGGLE_CODE_DIR="/path/to/meta-kaggle-code"

Note

Remember to replace the correct paths in the commands above.

Build and Launch

Build the Kaggle knowledge graph and launch the CLI or MCP server:

  • make graph-kc builds the knowledge graph from the Meta Kaggle dataset (parses imports and API calls if META_KAGGLE_CODE_DIR is set).
  • make comp-cli opens the competition knowledge graph in the IssunDB CLI.
  • make comp-mcp runs the IssunDB MCP server for the competition knowledge graph.
  • make graph-kernel builds the knowledge graph from the Meta Kaggle dataset (parses imports and API calls if META_KAGGLE_CODE_DIR is set).
  • make kernel-cli opens the kernel knowledge graph in the IssunDB CLI.
  • make kernel-mcp runs the IssunDB MCP server for the kernel knowledge graph.
  • make help shows all available Makefile targets.

Publish the Graph as a Hugging Face Dataset

The published dataset is available on Hugging Face at habedi/kaggle-knowledge-graph.

  • make hf-package HF_SNAPSHOT=YYYY-MM-DD packages the competition graph as a Hugging Face dataset in databases/hf-dataset, with the Parquet files under data/, a dataset card, and other metadata.
  • make hf-upload HF_REPO_ID=<user>/<dataset> HF_VERSION=<version> uploads that directory to the Hugging Face Hub and tags it with the release version (log in first with hf auth login).

MCP Server Configuration

To connect AI agents to the IssunDB MCP server, use the configuration template at examples/mcp_config.json:

{
    "mcpServers": {
        "kaggle-comp-kg": {
            "command": "/path/to/kaggle-knowledge-graph/bin/issundb-mcp",
            "args": [
                "--db-path",
                "/path/to/kaggle-knowledge-graph/databases/comp-kg",
                "--map-size-gb",
                "8"
            ]
        }
    }
}

Knowledge Graph Schema

Relational Schema

Contributing

See CONTRIBUTING.md for details on how to make a contribution.

License

This project is licensed under the MIT License except for the knowledge graph data (built by the code in this repository), which is subject to the CC BY-NC-SA 4.0 license.

About

A knowledge graph built from Kaggle data

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Sponsor this project

Used by

Contributors

Languages