You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
https://blog.langchain.dev/langchain-templates/[Langchain Templates^] are a set of preconfigured chains and components that can be used to build GenAI workflows and applications.
234
-
You can test them interactively on the LangChain Playground and run them with https://github.com/langchain-ai/langserve[LangServe^] to run as REST APIs, they also integrate with [LangSmith] for monitoring and observability.
235
-
236
-
By creating an application from templates, their source code is added to your application and you can modify them to fit your needs.
237
-
238
-
==== List of Templates
239
-
240
-
This https://python.langchain.com/docs/templates/neo4j-cypher[Cypher template] allows you to interact with a Neo4j graph database in natural language, using an OpenAI LLM.
241
-
242
-
It transforms a natural language question into a Cypher query (used to fetch data from Neo4j databases), executes the query, and provides a natural language response based on the query results.
243
-
244
-
The https://python.langchain.com/docs/templates/neo4j-cypher-ft[Cypher-FT Template^] additionally utilizes a full-text index for efficient mapping of text values to database entries, thereby enhancing the generation of accurate Cypher statements.
245
-
246
-
The https://python.langchain.com/docs/templates/neo4j-cypher-memory[Cypher Memory Template^] also features a conversational memory module that stores the dialogue history in the Neo4j graph database. The conversation memory is uniquely maintained for each user session, ensuring personalized interactions.
247
-
248
-
The https://python.langchain.com/docs/templates/neo4j-generation[Neo4j generation Template^] pairs LLM-based knowledge graph extraction using OpenAI functions, with Neo4j AuraDB, a fully managed cloud graph database.
249
-
250
-
This https://python.langchain.com/docs/templates/neo4j-vector-memory[Neo4j Vector Memory Template^] allows you to integrate an LLM with a vector-based retrieval system using Neo4j as the vector store. Additionally, it uses the graph capabilities of the Neo4j database to store and retrieve the dialogue history of a specific user's session. Having the dialogue history stored as a graph allows for seamless conversational flows but also gives you the ability to analyze user behavior and text chunk retrieval through graph analytics.
251
-
252
-
The https://python.langchain.com/docs/templates/neo4j-parent[Parent-Child Retriever Template^] allows you to balance precise embeddings and context retention by splitting documents into smaller chunks and retrieving their original or larger text information.
253
-
254
-
Using a Neo4j vector index, the package queries child nodes using vector similarity search and retrieves the corresponding parent's text.
255
-
256
-
The https://python.langchain.com/docs/templates/neo4j-semantic-layer[Neo4j Semantic Layer Template^] is designed to implement an agent capable of interacting with a graph database like Neo4j through a semantic layer using OpenAI function calling. The semantic layer equips the agent with a suite of robust tools, allowing it to interact with the graph databas based on the user's intent.
257
-
258
230
=== Semantic Layer
259
231
260
232
A semantic layer on top of a (graph) database doesn't rely on automatic query generation but offers a number of APIs and tools to give the LLM access to the database and it's structures.
@@ -282,14 +254,14 @@ You can index embeddings for and link questions and answers back to the retrieve
282
254
283
255
Creating a Knowledge Graph from unstructured data like PDF documents used to be a complex and time-consuming task that required training and using dedicated, large NLP models.
284
256
285
-
The https://python.langchain.com/docs/use_cases/graph/constructing[Graph Transformers^] are tools that allows you to extract structured data from unstructured documents and transform it into a Knowledge Graph.
257
+
The https://python.langchain.com/v0.1/docs/use_cases/graph/constructing[Graph Transformers^] are tools that allows you to extract structured data from unstructured documents and transform it into a Knowledge Graph.
286
258
287
259
NOTE: You can see a practical application, code and demo for extracting knowledge graphs from PDFs, YouTube transcripts, wikipedia articles and more with the xref:llm-graph-builder.adoc[LLM Graph Builder].
* https://neo4j.com/developer-blog/knowledge-graph-based-chatbot-with-gpt-3-and-neo4j/[Knowledge Graph-based Chatbot with GPT-3 and Neo4j^]
295
267
* https://blog.langchain.dev/constructing-knowledge-graphs-from-text-using-openai-functions/[Constructing Knowledge Graphs from Text using OpenAI Functions^]
This https://github.com/neo4j-examples/langchain-starter-kit/blob/main/app/vector_chain.py[starter-kit] demonstrates how to run a FastAPI server using LangChain to answer queries on data stored in a Neo4j instance. The single endpoint can be used to retrieve answers using either a https://python.langchain.com/v0.1/docs/integrations/vectorstores/neo4jvector/[Vector index chain], https://python.langchain.com/v0.1/docs/integrations/graphs/neo4j_cypher/[GraphCypherQA Chain], or a composite answer of both. The https://github.com/neo4j-examples/langchain-starter-kit/tree/langserve[langserve] branch contains an example of the same service, using https://python.langchain.com/v0.1/docs/langserve/[LangServe]
280
+
This https://github.com/neo4j-examples/langchain-starter-kit/blob/main/app/vector_chain.py[starter-kit] demonstrates how to run a FastAPI server using LangChain to answer queries on data stored in a Neo4j instance. The single endpoint can be used to retrieve answers using either a https://python.langchain.com/docs/integrations/vectorstores/neo4jvector/[Vector index chain], https://python.langchain.com/docs/integrations/graphs/neo4j_cypher/[GraphCypherQA Chain], or a composite answer of both. The https://github.com/neo4j-examples/langchain-starter-kit/tree/langserve[langserve] branch contains an example of the same service, using https://python.langchain.com/v0.1/docs/langserve/[LangServe]
309
281
310
282
See this https://neo4j.com/developer-blog/langchain-neo4j-starter-kit/[Developer Blog Article] for additional details and instructions on working with the Starter Kit.
311
283
@@ -314,10 +286,13 @@ See this https://neo4j.com/developer-blog/langchain-neo4j-starter-kit/[Developer
0 commit comments