Hi!
This is an example of vector and graph search featuring:
- SurrealDBVectorStore: for similarity/relevance search
- SurrealDBGraph: a langchain graph store
- SurrealDBGraphQAChain: a Question/Answering langchain chain class capable of querying the graph using LLM models
Requirements:
- SurrealDB
- Ollama
You can run SurrealDB locally or start with a free SurrealDB cloud account.
For local, two options:
-
Install SurrealDB and run SurrealDB. Run in-memory with:
surreal start -u root -p root
-
docker run --rm --pull always -p 8000:8000 surrealdb/surrealdb:latest start
Then, using just from the root directory of this repository:
just install
just examples-graph ingest
just examples-graph chatOr without just:
# install deps
cd examples/graph
poetry update
# run ingest script
poetry run run ingest
# run chat script
poetry run run chat- demo the LLMGraphTransformer
- implement "few shot prompting": https://python.langchain.com/docs/tutorials/graph/#few-shot-prompting