mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-09 19:35:20 +03:00
2.8 KiB
2.8 KiB
In [ ]:
#!pip install langchain nucliaIn [ ]:
from langchain.vectorstores.nucliadb import NucliaDB
API_KEY = "YOUR_API_KEY"
ndb = NucliaDB(knowledge_box="YOUR_KB_ID", local=False, api_key=API_KEY)In [ ]:
from langchain.vectorstores.nucliadb import NucliaDB
ndb = NucliaDB(knowledge_box="YOUR_KB_ID", local=True, backend="http://my-local-server")In [ ]:
ids = ndb.add_texts(["This is a new test", "This is a second test"])In [ ]:
ndb.delete(ids=ids)In [ ]:
results = ndb.similarity_search("Who was inspired by Ada Lovelace?")
print(res.page_content)