From 3f1cf00d97f65094919df97d6ef0361c2a8527e8 Mon Sep 17 00:00:00 2001 From: Nada Amin Date: Fri, 12 Jul 2024 19:08:25 -0400 Subject: [PATCH] docs: Improve neo4j semantic templates (#23939) I made some changes based on the issues I stumbled on while following the README of neo4j-semantic-ollama. I made the changes to the ollama variant, and can also port the relevant ones to the layer variant once this is approved. --------- Co-authored-by: Erick Friis --- templates/neo4j-semantic-ollama/README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/templates/neo4j-semantic-ollama/README.md b/templates/neo4j-semantic-ollama/README.md index bfe52dea243..552f5552ea8 100644 --- a/templates/neo4j-semantic-ollama/README.md +++ b/templates/neo4j-semantic-ollama/README.md @@ -39,12 +39,26 @@ NEO4J_USERNAME= NEO4J_PASSWORD= ``` +Typically for a local Ollama installation: + +```shell +export OLLAMA_BASE_URL="http://127.0.0.1:11434" +``` + ## Populating with data If you want to populate the DB with an example movie dataset, you can run `python ingest.py`. The script import information about movies and their rating by users. Additionally, the script creates two [fulltext indices](https://neo4j.com/docs/cypher-manual/current/indexes-for-full-text-search/), which are used to map information from user input to the database. +As an aternative, you can use the demo neo4j recommendations database: +```shell +export NEO4J_URI="neo4j+s://demo.neo4jlabs.com" +export NEO4J_USERNAME="recommendations" +export NEO4J_PASSWORD="recommendations" +export NEO4J_DATABASE="recommendations" +``` + ## Usage To use this package, you should first have the LangChain CLI installed: @@ -65,7 +79,7 @@ If you want to add this to an existing project, you can just run: langchain app add neo4j-semantic-ollama ``` -And add the following code to your `server.py` file: +And, from within the project, add the following code to your `app/server.py` file, replacing the `add_routes(app, NotImplemented)` section: ```python from neo4j_semantic_ollama import agent_executor as neo4j_semantic_agent @@ -83,7 +97,7 @@ export LANGCHAIN_API_KEY= export LANGCHAIN_PROJECT= # if not specified, defaults to "default" ``` -If you are inside this directory, then you can spin up a LangServe instance directly by: +If you are inside the top-level project directory, then you can spin up a LangServe instance directly by: ```shell langchain serve