← All case studies
LLM & AgentsFinanceOdyssey Analytics · 2023

Commodities Knowledge Graph Q&A

Natural-language queries over a commodities knowledge graph so traders skip analyst tickets.

20 yrsof pricing, queried conversationally

Context

Traders needed answers from 20 years of commodity pricing and relationships, and usually waited on analysts to write the queries.

Challenge

Let traders ask questions directly, safely, without writing Cypher.

My role

Built the natural-language query layer.

Architecture

How the system fits together

Commodities Knowledge Graph Q&A architecture diagramTrader questionGraph schemaprompt contextText-to-CypherLLMCypher guardread-onlyNeo4jcommodities graphPricing history20 yearsAnswer composerLLM summaryAnswer + table
User / outputData storeModel / AIServiceExternal sourceTelemetry / async

Simplified for public sharing; client-specific details are omitted.

Approach

Key engineering decisions

  1. 01

    Text-to-Cypher

    An LLM translates questions into Cypher using the graph schema as context.

  2. 02

    Read-only guard

    Generated queries are checked as read-only and schema-valid before they run.

  3. 03

    Answer composition

    Results are summarised in plain language alongside the underlying table.