This file provides guidance to coding agents collaborating on this repository.
This project builds graph databases from the Meta Kaggle dataset and loads them into IssunDB, an embedded graph database. The pipeline stages source files with DuckDB, parses code imports with Polars, parses Python API calls with Tree-sitter, and bulk-loads nodes and edges through the IssunDB CLI. The project priorities include correct graph construction, reproducible builds, scoped subset testing, and idiomatic Python.
- Use English for code, comments, documentation, and tests.
- Stage with DuckDB, parse code imports with Polars, parse Python API calls with Tree-sitter, and load through the IssunDB command line interface. Do not mix these roles.
- Bulk-load nodes and edges with command line tools instead of Cypher queries.
- Keep the large local source data out of the repository.
- Ensure staging is deterministic by using a fixed seed rule and fixed source data.
- Validate staged edges against staged nodes before trusting a graph.
- Run
make formatandmake testbefore declaring a change done.
- Good practices include adding competition-scope tunables to staging scripts and resolving edge endpoints by the auto-indexed
Idproperty. - Bad practices include bulk-loading relationships with Cypher queries and hardcoding absolute data paths.
- Use Oxford commas in lists.
- Avoid em dashes by using semicolons or restructuring sentences.
- Avoid colorful adjectives and adverbs.
- Balance the use of noun phrases for checklist items and imperative verbs.
- Apply title case to headings in Markdown files.
- Use correct and complete sentences.
- Avoid made-up words, abbreviations, and colons in the middle of sentences.
- Meta Kaggle dataset metadata is at
~/downloads/KW/meta-kaggle/(override withMETA_KAGGLE_DIR). - Meta Kaggle Code is sharded under
~/Downloads/KW/meta-kaggle-code/(override withMETA_KAGGLE_CODE_DIR).
scripts/inspect_metadata.pydumps schema and row counts.scripts/stage_kernel_subset.pystages top-voted kernels.scripts/stage_competition_subset.pystages competition metadata.scripts/parse_imports.pyparses code imports.scripts/parse_api_calls.pyparses Python API calls intoApiCallnodes andCALLSedges.scripts/load_competition_kg.pyloads the Kaggle knowledge graph.scripts/import_to_issundb.pyloads the kernel graph.scripts/issundb_load.pyholds the loader logic shared by both load scripts.databases/includes staged files and graph databases.bin/issundb-cliincludes the database command line tool binary.bin/issundb-mcpincludes the MCP server binary.examples/includes Cypher query templates and MCP client configuration templates.
make graph-kcbuilds the Kaggle knowledge graph.make comp-cliopens the Kaggle knowledge graph in the IssunDB CLI.make comp-mcpruns the IssunDB MCP server for the Kaggle knowledge graph.make kg-stage-allstages the kernel graph.make kg-loadloads the staged kernel graph, adds constraints and indexes, and validates the load.make graph-kernelbuilds the kernel knowledge graph end to end.make kernel-cliopens the kernel knowledge graph in the IssunDB CLI.make kernel-mcpruns the IssunDB MCP server for the kernel knowledge graph.make helplists all targets.
- Node files are
Id-first. TheIdcolumn is auto-indexed. Edge files contain source and destinationIdkeys. - Unresolved edge endpoints are dropped. Malformed rows cause errors.
- Bulk loading must use
:import-edgesinstead of CypherUNWIND ... CREATEqueries. - Node property lookups use auto-indexed full-text indexes. Raw markup language bodies must be searched with
CONTAINSscans. - Cypher query lines take string literals verbatim.
The workflow includes stage identification before coding, schema checks in databases/metadata_inventory.md, scoped pipeline changes with tunable make
variables, dry run staging on subsets, code formatting, and repository documentation updates when behavior changes.
- The database loader validates that every node file imports, no edge row is malformed, and constraints hold.
- DuckDB validates staged node and edge counts to confirm that no staged edge points to a missing node.
- Use red-green test-driven development (TDD) to write tests before implementing new features.
- Python helpers must pass
pytestchecks.
- Seed rule, schema, or build target changes require updates to
AGENTS.mdandREADME.md.