docs(examples): document what the examples need in order to run - #596
Merged
williedoran-neo4j merged 2 commits intoAug 13, 2026
Merged
Conversation
This was referenced Aug 11, 2026
williedoran-neo4j
force-pushed
the
willie/examples-env-and-docs
branch
3 times, most recently
from
August 12, 2026 07:21
f674cd5 to
8ad0580
Compare
examples/README.md is a pure link index: no mention of API keys, extras, Docker, or the fact that 17 examples talk to a remote demo database. What setup knowledge exists is spread across the root README's Tests section and three per-store READMEs. Adds examples/SETUP.md covering credentials, the services, which providers are free or have a local equivalent, and the traps that cost the most time - running from the repo root, the three examples needing PYTHONPATH=examples/data, and the examples that cannot work as written against a read-only demo database. Adds examples/.env.example as a credential template, and gitignores .env variants while keeping the template tracked. Declares python-dotenv and requests in the examples extra. Fourteen examples call load_dotenv() and tools_retriever_example.py calls a web API with requests, but neither was declared, so both resolved only transitively. The three Ollama examples now take the model as an argument rather than shipping a placeholder to edit, since which model you have depends on what you pulled. Fixes the Weaviate and Pinecone READMEs, which gave `python -m` a slash path. Every count in SETUP.md was checked against the code rather than estimated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
williedoran-neo4j
force-pushed
the
willie/examples-env-and-docs
branch
from
August 12, 2026 12:02
8ad0580 to
54b1cfe
Compare
williedoran-neo4j
marked this pull request as ready for review
August 12, 2026 12:20
AmirLayegh
approved these changes
Aug 12, 2026
AmirLayegh
left a comment
Contributor
There was a problem hiding this comment.
LGTM!
Left a few comments that might be worth addressing before merging.
AmirLayegh
reviewed
Aug 12, 2026
AmirLayegh
reviewed
Aug 12, 2026
Review feedback on neo4j#596. The two LangChain/LlamaIndex splitter examples are empty files, and SETUP.md documented that the README linked to them. Removing the links is the better half of that trade: nothing points at an empty file now, so the note has nothing left to warn about. The Azure note said only what the example does not do - read the environment. It now says what you actually have to do: its endpoint, key and API version are placeholders in the file, so it has to be edited before it runs, and that edit must not be committed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
williedoran-neo4j
added a commit
to williedoran-neo4j/neo4j-graphrag-python
that referenced
this pull request
Aug 13, 2026
All three workflows skipped `uv sync` whenever the venv cache key hit exactly. That trusts the cache to be complete, and it is not always: a cache saved from an interrupted install is restored on every later run with the same key, and the install that would repair it is precisely what gets skipped. Seen on neo4j#596, which changes uv.lock and so minted a fresh key: four e2e jobs failed with `ImportError: cannot import name 'WeaviateNeo4jRetriever'` and the same for Pinecone and Qdrant. The restored .venv was missing the vector-store extras, the test step installed only the 82 default packages, and re-running reproduced it exactly - the same cache was restored each time. Deleting the cache entry fixed it. The failure mode is nasty out of proportion to its cause: it presents as a flaky test in code that did not change, it survives re-runs, and it persists until the cache expires or somebody deletes it by hand. Any PR touching uv.lock is first to hit a new key, so it lands on whoever is least likely to suspect CI. uv sync takes a few seconds when the environment is already correct, which is cheap next to that. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
williedoran-neo4j
added a commit
to williedoran-neo4j/neo4j-graphrag-python
that referenced
this pull request
Aug 13, 2026
All three workflows skipped `uv sync` whenever the venv cache key hit exactly. That trusts the cache to be complete, and it is not always: a cache saved from an interrupted install is restored on every later run with the same key, and the install that would repair it is precisely what gets skipped. Seen on neo4j#596, which changes uv.lock and so minted a fresh key: four e2e jobs failed with `ImportError: cannot import name 'WeaviateNeo4jRetriever'` and the same for Pinecone and Qdrant. The restored .venv was missing the vector-store extras, the test step installed only the 82 default packages, and re-running reproduced it exactly - the same cache was restored each time. Deleting the cache entry fixed it. The failure mode is nasty out of proportion to its cause: it presents as a flaky test in code that did not change, it survives re-runs, and it persists until the cache expires or somebody deletes it by hand. Any PR touching uv.lock is first to hit a new key, so it lands on whoever is least likely to suspect CI. uv sync takes a few seconds when the environment is already correct, which is cheap next to that. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #595, now that the services are easy to start.
examples/README.mdis a pure link index: no mention of API keys, extras, Docker, or the fact that 17 examples talk to a remote demo database. What setup knowledge exists is spread across the root README's Tests section and three per-store READMEs.Documentation
examples/SETUP.md— what you need in order to run the examples: credentials, the services, which providers are free or have a local equivalent, and the traps that cost the most time. Running from the repo root; the three examples that needPYTHONPATH=examples/data; the two that write to a read-only demo database and so fail withForbiddenas written.examples/.env.example— a credential template, with.envvariants gitignored and the template itself kept tracked.Every count in SETUP.md was checked against the code rather than estimated — "17 examples use the demo database", "14 call
load_dotenv()", "three need PYTHONPATH", the two empty splitter files.Not documentation — three Ollama examples change behaviour
Flagging this explicitly, because it is code in an otherwise-docs PR.
They could not be run as shipped.
ollama_llm.pyandollama_embeddings.pycarried a literalmodel_name="<model_name>"placeholder that had to be edited before the example would do anything. Documenting "first edit this file" would have been documenting a defect, so the model became a command-line argument instead:ollama pull llama3.2 python examples/customize/llms/ollama_llm.py llama3.2 # or omit it for the defaultWhich model you have is a property of your machine, not of the example, which is why it is an argument rather than a new hardcoded constant. Defaults are
llama3.2for the LLMs andnomic-embed-textfor the embedder, so all three now run with no arguments after a singleollama pull.One is a real default change worth calling out:
ollama_tool_calls.pywas not a placeholder — it hardcodedmistral:latest. It now defaults tollama3.2, so that oneollama pullcovers all three examples rather than two models being needed. Both support tool calling; the docstring now says to check the model's Ollama page before substituting one that may not.That file's run instructions also pointed at
examples/tool_calls/ollama_tool_calls.py, a path that does not exist. Corrected.Packaging
python-dotenvandrequestsare now declared in theexamplesextra. Fourteen examples callload_dotenv()andtools_retriever_example.pycalls a web API withrequests, but neither was declared, so both resolved only transitively — working by accident.Also
The Weaviate and Pinecone READMEs gave
python -ma slash path, which cannot work;-mtakes a dotted module path. Fixed rather than documented.Type of Change
Complexity
Complexity: Low
How Has This Been Tested?
All three Ollama examples confirmed to parse their arguments and print help. Every command quoted in SETUP.md run as written, and every numeric claim in it re-derived from the code. Green on ruff, mypy --strict and the unit suite.
Checklist
🤖 Generated with Claude Code