Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
OurBuilding Ambient Agents with LangGraph course is now available on LangChain Academy!
Open In ColabOpen on GitHub

NucliaDB

You can use a local NucliaDB instance or useNuclia Cloud.

When using a local instance, you need a Nuclia Understanding API key, so your texts are properly vectorized and indexed. You can get a key by creating a free account athttps://nuclia.cloud, and thencreate a NUA key.

%pip install--upgrade--quiet  langchain langchain-community nuclia

Usage with nuclia.cloud

from langchain_community.vectorstores.nucliadbimport NucliaDB

API_KEY="YOUR_API_KEY"

ndb= NucliaDB(knowledge_box="YOUR_KB_ID", local=False, api_key=API_KEY)
API Reference:NucliaDB

Usage with a local instance

Note: By defaultbackend is set tohttp://localhost:8080.

from langchain_community.vectorstores.nucliadbimport NucliaDB

ndb= NucliaDB(knowledge_box="YOUR_KB_ID", local=True, backend="http://my-local-server")
API Reference:NucliaDB

Add and delete texts to your Knowledge Box

ids= ndb.add_texts(["This is a new test","This is a second test"])
ndb.delete(ids=ids)

Search in your Knowledge Box

results= ndb.similarity_search("Who was inspired by Ada Lovelace?")
print(results[0].page_content)

Related


[8]ページ先頭

©2009-2025 Movatter.jp