FalkorDB LangChain JS/TS Integration
The @falkordb/langchain-ts package enables developers to use FalkorDB’s ultra-fast graph database alongside their LangChain applications. What this means in practice is that your application can now take natural language questions, automatically generate the corresponding Cypher queries, pull the relevant context from your graph database, and return responses in plain language. The entire translation layer gets handled for you. The package fits into existing LangChain workflows, so if you are already using that framework for other AI capabilities, this becomes another tool in your stack. FalkorDB’s low latency characteristics combine with LangChain’s language model integration to provide quick responses.About FalkorDB
An ultra-fast, multi-tenant graph database powering Generative AI, Agent Memory, Cloud Security, and Fraud Detection. FalkorDB is the first queryable Property Graph Database to leverage sparse matrices for representing the adjacency matrix in graphs and linear algebra for querying.Installation
npm2yarn
npm2yarn
Quick start
1. Start FalkorDB
The easiest way to run FalkorDB is with Docker:2. Basic usage
API Reference
FalkorDBGraph
initialize(config: FalkorDBGraphConfig): Promise<FalkorDBGraph>
Creates and initializes a new FalkorDB connection.
Config Options:
host(string, optional): Database host. Default:"localhost"port(number, optional): Database port. Default:6379graph(string, optional): Graph name to useurl(string, optional): Alternative connection URL formatenhancedSchema(boolean, optional): Enable enhanced schema details. Default:false
query(query: string): Promise<any>
Executes a Cypher query on the graph.
refreshSchema(): Promise<void>
Updates the graph schema information.
getSchema(): string
Returns the current graph schema as a formatted string.
getStructuredSchema(): StructuredSchema
Returns the structured schema object containing node properties, relationship properties, and relationships.
close(): Promise<void>
Closes the database connection.
Advanced usage
Custom Cypher queries
Multiple queries
Working with schema
Requirements
- Node.js >= 18
- FalkorDB server running (Redis-compatible)
- LangChain >= 0.1.0
Examples
For more examples, see the @falkordb/langchain-ts repository on GitHub.License
MITSupport
- GitHub Issues
- Website: https://www.falkordb.com/
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.