Skip to content

Commit

Permalink
Merge pull request #642 from vespa-engine/jobergum/update-notebook-wi…
Browse files Browse the repository at this point in the history
…th-illustrations

update with illustrations
  • Loading branch information
kkraune authored Dec 8, 2023
2 parents cb96caf + fd54e42 commit aef314c
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"- [Yahoo Mail turns to Vespa to do RAG at scale](https://blog.vespa.ai/yahoo-mail-turns-to-vespa-to-do-rag-at-scale/)\n",
"- [Hands-On RAG guide for personal data with Vespa and LLamaIndex](https://blog.vespa.ai/scaling-personal-ai-assistants-with-streaming-mode/)\n",
"\n",
"This notebook is also available in blog form: [Turbocharge RAG with LangChain and Vespa Streaming Mode for Sharded Data](https://blog.vespa.ai/turbocharge-rag-with-langchain-and-vespa-streaming-mode/)\n",
"\n",
"### TLDR; Vespa streaming mode for partitioned data\n",
"\n",
"Vespa's streaming search solution enables you to integrate a user ID (or any sharding key) into the Vespa document ID. \n",
Expand Down Expand Up @@ -53,6 +55,9 @@
"- Employ Vespa's built-in embedder functionality (using an open-source embedding model) for embedding the text chunks per page, resulting in a multi-vector representation.\n",
"- Develop a custom [Retriever](https://python.langchain.com/docs/modules/data_connection/retrievers/) to enable seamless retrieval for any unstructured text query.\n",
"\n",
"\n",
"![Overview](https://blog.vespa.ai/assets/2023-12-08-turbocharge-rag-with-langchain-and-vespa-streaming-mode/turbocharge-RAG-vespa-streaming.png)\n",
"\n",
"Let's get started! First, install dependencies: "
]
},
Expand Down Expand Up @@ -657,6 +662,17 @@
"app.feed_iterable(schema=\"pdf\", iter=vespa_feed(\"jo-bergum\"), namespace=\"personal\", callback=callback)"
]
},
{
"cell_type": "markdown",
"id": "431dc2f9",
"metadata": {},
"source": [
"Notice the `schema` and `namespace` arguments. PyVespa transforms the input operations to Vespa [document v1](https://docs.vespa.ai/en/document-v1-api-guide.html)\n",
"requests. \n",
"\n",
"![Document id](https://blog.vespa.ai/assets/2023-12-08-turbocharge-rag-with-langchain-and-vespa-streaming-mode/docid.png)"
]
},
{
"cell_type": "markdown",
"id": "20b007ec",
Expand Down Expand Up @@ -742,6 +758,14 @@
"print(json.dumps(response.hits[0], indent=2))"
]
},
{
"cell_type": "markdown",
"id": "4d3ca1da",
"metadata": {},
"source": [
"Notice the `matchfeatures` that returns the configured match-features from the rank-profile, including all the chunk similarities. "
]
},
{
"cell_type": "markdown",
"id": "57f323df",
Expand Down

0 comments on commit aef314c

Please sign in to comment.