diff --git a/docs/examples_notebooks/local_search.ipynb b/docs/examples_notebooks/local_search.ipynb index bba7a7b38..e14195ee1 100644 --- a/docs/examples_notebooks/local_search.ipynb +++ b/docs/examples_notebooks/local_search.ipynb @@ -32,7 +32,12 @@ " LocalSearchMixedContext,\n", ")\n", "from graphrag.query.structured_search.local_search.search import LocalSearch\n", - "from graphrag_vectors import IndexSchema, LanceDBVectorStore" + "from graphrag_vectors import (\n", + " IndexSchema,\n", + " VectorStoreConfig,\n", + " VectorStoreType,\n", + " create_vector_store,\n", + ")" ] }, { @@ -41,7 +46,7 @@ "source": [ "## Local Search Example\n", "\n", - "Local search method generates answers by combining relevant data from the AI-extracted knowledge-graph with text chunks of the raw documents. This method is suitable for questions that require an understanding of specific entities mentioned in the documents (e.g. What are the healing properties of chamomile?)." + "Local search method generates answers by combining relevant data from the AI-extracted knowledge-graph with text chunks of the raw documents. This method is suitable for questions that require an understanding of specific entities mentioned in the documents (e.g. What are the healing properties of chamomile?).\n" ] }, { @@ -50,14 +55,14 @@ "source": [ "### Load text units and graph data tables as context for local search\n", "\n", - "- In this test we first load indexing outputs from parquet files to dataframes, then convert these dataframes into collections of data objects aligning with the knowledge model." + "- In this test we first load indexing outputs from parquet files to dataframes, then convert these dataframes into collections of data objects aligning with the knowledge model.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Load tables to dataframes" + "### Load tables to dataframes\n" ] }, { @@ -82,7 +87,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Read entities" + "#### Read entities\n" ] }, { @@ -99,10 +104,11 @@ "\n", "# load description embeddings to an in-memory lancedb vectorstore\n", "# to connect to a remote db, specify url and port values.\n", - "description_embedding_store = LanceDBVectorStore(\n", - " index_schema=IndexSchema(index_name=\"default-entity-description\")\n", + "description_embedding_store = create_vector_store(\n", + " config=VectorStoreConfig(type=VectorStoreType.LanceDB, uri=LANCEDB_URI),\n", + " index_schema=IndexSchema(index_name=\"default-entity-description\"),\n", ")\n", - "description_embedding_store.connect(db_uri=LANCEDB_URI)\n", + "description_embedding_store.connect()\n", "\n", "print(f\"Entity count: {len(entity_df)}\")\n", "entity_df.head()" @@ -112,7 +118,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Read relationships" + "#### Read relationships\n" ] }, { @@ -148,7 +154,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Read community reports" + "#### Read community reports\n" ] }, { @@ -168,7 +174,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Read text units" + "#### Read text units\n" ] }, { @@ -221,7 +227,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Create local search context builder" + "### Create local search context builder\n" ] }, { @@ -248,7 +254,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Create local search engine" + "### Create local search engine\n" ] }, { @@ -314,7 +320,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Run local search on sample queries" + "### Run local search on sample queries\n" ] }, { @@ -342,7 +348,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Inspecting the context data used to generate the response" + "#### Inspecting the context data used to generate the response\n" ] }, { @@ -396,14 +402,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Question Generation" + "### Question Generation\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "This function takes a list of user queries and generates the next candidate questions." + "This function takes a list of user queries and generates the next candidate questions.\n" ] }, { @@ -440,7 +446,7 @@ ], "metadata": { "kernelspec": { - "display_name": "graphrag", + "display_name": "graphrag-monorepo (3.12.10)", "language": "python", "name": "python3" },