Garden Knowledge Graph
The long-term data model for veggie.farm should not be a pile of separate tables.
A gardener rarely asks a table-shaped question. They ask connected questions: what can grow in this light, in this soil, after this crop, before frost, with these pests, in this climate?
The graph is the integration layer for those questions. Plants, soils, pests, diseases, beneficial insects, climate zones, techniques, and sources are nodes. Facts and recommendations are typed edges.
Current graph
The graph is now generated from the normalized knowledge base plus the hand-authored garden model. It includes the imported plant catalog, source references, image references, soil objects, climate-zone objects, pest and disease relationships, deficiencies, calendar rules, and companion edges.
Example intelligence query
The graph can already answer a multi-hop question:
Show vegetables that tolerate partial shade, germinate below 50F soil temperature, improve nitrogen, and are good predecessors to tomatoes in USDA Zone 6b.
The result is not a blog answer. It is a traceable graph result. Each match comes from plant attributes and edges such as tolerates_light, germinates_below_50f, improves_soil_property, good_predecessor_for, and suitable_for_zone.
Typed relationships
The graph stores relationship meaning directly. That is what lets the application distinguish between a crop family, a pest host relationship, a beneficial insect relationship, a climate suitability note, and a weak companion-planting claim.
Pea neighborhood
A graph also makes crop pages easier to enrich. A pea page can ask for its nearby relationships rather than manually maintaining separate lists of family, season, nitrogen role, rotation value, pests, and techniques.
Source registry
The graph needs source discipline before it needs more pages. Every external dataset should have licensing, update cadence, geographic coverage, API availability, download format, citation URL, and a cache strategy.
Implementation notes
The graph is generated by:
npm run build:kb
The generated file is src/data/knowledge-graph.json. The normalized source datasets live under src/data/knowledge-base/, and the source registry is src/data/sources.json.
Future imports should become knowledge-base builders first and graph builders second. Rare Seeds product facts, USDA hardiness zones, NOAA normals, SSURGO soil data, pest host lists, and extension disease guides should all create or update normalized records with source IDs, timestamps, confidence, and review status before they become graph nodes and edges.
Field notes
The graph should be useful before it is huge. A small, auditable graph that answers real garden questions is better than a large table collection that cannot explain where its recommendations came from.