Skip to main content
Open on GitHub

Neo4j

What is Neo4j?

  • Neo4j is an open-source database management system that specializes in graph database technology.
  • Neo4j allows you to represent and store data in nodes and edges, making it ideal for handling connected data and relationships.
  • Neo4j provides a Cypher Query Language, making it easy to interact with and query your graph data.
  • With Neo4j, you can achieve high-performance graph traversals and queries, suitable for production-level systems.

Get started with Neo4j by visiting their website.

安装与设置

  • 使用 pip install neo4j langchain-neo4j 安装 Python SDK

VectorStore

Neo4j 向量索引被用作向量存储,无论是用于语义搜索还是示例选择。

from langchain_neo4j import Neo4jVector
API 参考:Neo4jVector

查看一个 使用示例

GraphCypherQAChain

围绕 Neo4j 图形数据库有一个封装器,允许您根据用户输入生成 Cypher 语句,并使用它们从数据库中检索相关信息。

from langchain_neo4j import GraphCypherQAChain, Neo4jGraph

查看一个 使用示例

从文本构建知识图谱

文本数据通常包含丰富的关系和见解,这些信息对于各种分析、推荐引擎或知识管理应用程序非常有用。 Diffbot的NLP API能够从非结构化文本数据中提取实体、关系和语义含义。 通过将Diffbot的NLP API与图数据库Neo4j结合使用,您可以基于从文本中提取的信息创建强大且动态的图结构。 这些图结构完全可查询,并可以集成到各种应用程序中。

from langchain_neo4j import Neo4jGraph
from langchain_experimental.graph_transformers.diffbot import DiffbotGraphTransformer

查看一个 使用示例

存储

查看一个 使用示例

from langchain_neo4j import Neo4jChatMessageHistory