Skip to content

Feature: Text-to-Cypher via LLM + RAG over schema #35

Description

@peter7775

Problem Statement

Users must know Cypher to query the graph via the GraphQL/REST API. For large schemas, the full schema also can't be sent as LLM context due to context window limits.

Proposed Solution

  • Use semantic schema search to select a relevant schema subgraph as RAG context.
  • Send the selected context plus the user's natural-language question to an LLM to generate a Cypher query.
  • Validate/sandbox the generated Cypher before execution (e.g. only allow read-only MATCH queries, reject CREATE/DELETE/DETACH DELETE).
  • Expose this as a new GraphQL mutation/query or REST endpoint.

Alternative Solutions

Send the LLM the entire schema without RAG selection — works only for small databases; larger ones exceed the context window and increase API costs.

Use Case

A non-technical user asks a question in natural language and gets a graph result without knowing Cypher.

Priority Level

Nice to have

Implementation Ideas

  • Security review required before merging (see .gosec.json in the repo) given the risk of generating unsafe queries from untrusted input.
  • Consider rate limiting / cost tracking for LLM API calls.

Additional Context

Depends on: "Semantic schema search", "EmbeddingProvider port". The most complex and highest-risk item in this set — recommend tackling it last.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiREST API or GraphQL relatedenhancementImprovement to existing functionalityfeatureNew feature or functionalityneeds-discussionRequires team discussion before implementation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions