Back to Genai Toolbox

falkordb-cypher

docs/en/integrations/falkordb/tools/falkordb-cypher.md

1.10.02.4 KB
Original Source

About

A falkordb-cypher tool executes a pre-defined Cypher statement against the graph configured on a FalkorDB source. The specified Cypher statement is executed as a parameterized statement, and specified parameters will be used according to their name: e.g. $id.

Note: This tool uses parameterized queries to prevent injections. Query parameters can be used as substitutes for arbitrary expressions. Parameters cannot be used as substitutes for identifiers, labels, relationship types, or other parts of the query.

Compatible Sources

{{< compatible-sources >}}

Example

yaml
kind: tool
name: search_movies_by_actor
type: falkordb-cypher
source: my-falkordb-movies-instance
statement: |
  MATCH (m:Movie)<-[:ACTED_IN]-(p:Person)
  WHERE p.name = $name AND m.year > $year
  RETURN m.title, m.year
  LIMIT 10
description: |
  Use this tool to get a list of movies for a specific actor and a given minimum release year.
  Takes a full actor name, e.g. "Tom Hanks" and a year e.g 1993 and returns a list of movie titles and release years.
parameters:
  - name: name
    type: string
    description: Full name of the actor.
  - name: year
    type: integer
    description: Minimum release year.

Reference

fieldtyperequireddescription
typestringtrueMust be "falkordb-cypher".
sourcestringtrueName of the source the Cypher statement should execute on.
descriptionstringtrueDescription of the tool that is passed to the LLM.
statementstringtrueCypher statement to execute.
parametersparametersfalseList of parameters that will be used with the Cypher statement.