Documentation Index
Fetch the complete documentation index at: https://nvd-54.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Diffbot is a suite of ML-based products that make it easy to structure web data. Diffbot’s Natural Language Processing API allows for the extraction of entities, relationships, and semantic meaning from unstructured text data.![]()
Use case
Text data often contain rich relationships and insights used for various analytics, recommendation engines, or knowledge management applications. By couplingDiffbot's NLP API with Neo4j, a graph database, you can create powerful, dynamic graph structures based on the information extracted from text. These graph structures are fully queryable and can be integrated into various applications.
This combination allows for use cases such as:
- Building knowledge graphs (like Diffbot’s Knowledge Graph) from textual documents, websites, or social media feeds.
- Generating recommendations based on semantic relationships in the data.
- Creating advanced search features that understand the relationships between entities.
- Building analytics dashboards that allow users to explore the hidden relationships in data.
概述
LangChain provides tools to interact with Graph Databases:Construct knowledge graphs from textusing graph transformer and store integrationsQuery a graph databaseusing chains for query creation and executionInteract with a graph databaseusing agents for robust and flexible querying
设置
First, get required packages and set environment variables:Diffbot NLP API
Diffbot's NLP API is a tool for extracting entities, relationships, and semantic context from unstructured text data.
This extracted information can be used to construct a knowledge graph.
To use the API, you’ll need to obtain a free API token from Diffbot.
DiffbotGraphTransformer to extract entities and relationships.
The DiffbotGraphTransformer outputs a structured data GraphDocument, which can be used to populate a graph database.
请注意 text chunking is avoided due to Diffbot’s character limit per API request.
Loading the data into a knowledge graph
你需要一个正在运行的 Neo4j instance. One option is to create a free Neo4j database instance in their Aura cloud service. 你也可以使用以下方式在本地运行数据库: Neo4j Desktop application, or running a docker container. 你可以通过执行以下脚本运行本地 docker 容器:GraphDocuments can be loaded into a knowledge graph using the add_graph_documents method.
刷新图 Schema 信息
If the schema of database changes, you can refresh the schema information needed to generate Cypher statements查询图
我们现在可以使用 graph cypher QA chain 来查询图. It is advisable to use gpt-4 to construct Cypher queries to get the best experience.Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

