"You can easily add text to a vectorstore with the `add_texts` method. It will return a list of document IDs (in case you need to use them downstream)."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "70758e4f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['64108bd0-4d91-485c-9743-1e18debdd59e']"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"docsearch.add_texts([\"Ankush went to Princeton\"])"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "4edeb88f",
"metadata": {},
"outputs": [],
"source": [
"query = \"Where did Ankush go to college?\"\n",
"docs = docsearch.similarity_search(query)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "1cba64a2",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Document(page_content='Ankush went to Princeton', lookup_str='', metadata={}, lookup_index=0)"