以编程方式使用文档

>LambdaDB is a serverless AI database for RAG and agents. Unify full-text, multi-vector, and hybrid search on a flexible document model. Handle infinite persistent memory and massive concurrency instantly— at 1/10th the cost.

安装和设置

安装 Python SDK:

    pip install langchain-lambdadb
    
    uv add langchain-lambdadb
    

您还需要一个 LambdaDB 账户,包含: - 项目 URL - 项目 API 密钥

在以下位置获取您的凭据 lambdadb.ai.

向量存储

存在一个围绕集合的包装器 LambdaDB 允许您将其用作语义搜索、RAG 和其他 AI 应用程序的向量存储。

导入此向量存储:

from langchain_lambdadb import LambdaDBVectorStore

快速开始

from langchain_lambdadb import LambdaDBVectorStore
from langchain_openai import OpenAIEmbeddings
from lambdadb import LambdaDB


# Initialize client
client = LambdaDB(
    server_url=os.environ["LAMBDADB_SERVER_URL"],
    project_api_key=os.environ["LAMBDADB_API_KEY"]
)

# Create vector store with existing collection
vector_store = LambdaDBVectorStore(
    client=client,
    collection_name="my_collection",  # Must exist beforehand
    embedding=OpenAIEmbeddings()
)

有关 LambdaDB 包装器的更详细说明,请参阅 完整文档.