LanceDB Node
LanceDB Node.js ベクター検索
LanceDB と Ollama の埋め込みモデルを使用したベクトル検索の Node.js 実装。
概要
このプロジェクトでは、次の方法を説明します。
LanceDBデータベースに接続する
Ollamaを使用してカスタム埋め込み関数を作成する
保存されたドキュメントに対してベクトル類似性検索を実行する
検索結果を処理して表示する
Related MCP server: MCP Tooling Lab
前提条件
Node.js (v14以降)
Ollama は
nomic-embed-textモデルを使用してローカルで実行されています読み取り/書き込み権限を持つLanceDBの保存場所
インストール
リポジトリをクローンする
依存関係をインストールします:
pnpm install依存関係
@lancedb/lancedb: Node.js 用の LanceDB クライアントapache-arrow: 列指向データの処理用node-fetch: OllamaへのAPI呼び出しを行うため
使用法
ベクトル検索テスト スクリプトを実行します。
pnpm test-vector-searchまたは直接実行します:
node test-vector-search.js構成
スクリプトは以下に接続します:
設定されたパスのLanceDB
Ollama API (
http://localhost:11434/api/embeddings
MCP構成
Claude Desktop を MCP サービスとして統合するには、MCP 構成 JSON に以下を追加します。
{
"mcpServers": {
"lanceDB": {
"command": "node",
"args": [
"/path/to/lancedb-node/dist/index.js",
"--db-path",
"/path/to/your/lancedb/storage"
]
}
}
}パスを実際のインストール パスに置き換えます。
/path/to/lancedb-node/dist/index.js- コンパイルされた index.js ファイルへのパス/path/to/your/lancedb/storage- LanceDB ストレージディレクトリへのパス
カスタム埋め込み機能
このプロジェクトには、次の機能を備えたカスタムOllamaEmbeddingFunctionが含まれています。
Ollama APIにテキストを送信します
768次元の埋め込みを受け取る
LanceDB で使用できるようにフォーマットします
ベクトル検索の例
この例では、「ai-rag」テーブルで「成功基準の定義方法」を検索し、類似度スコアとともに結果を表示します。
ライセンス
貢献
貢献を歓迎します!お気軽にプルリクエストを送信してください。
This server cannot be deployed
Maintenance
Related MCP Connectors
Ingest, manage, and retrieve documents for RAG-powered AI applications
Semantic nearest-neighbour search over your datasets, plus indices and projections.
Memory system for AI agents with semantic search. Store and recall memories with ease.
Hosted persistent memory with semantic search, importance and TTL for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables semantic search and retrieval of information from technical documentation PDFs using RAG-powered natural language queries with Ollama embeddings and LLMs.6-
- FlicenseBqualityDmaintenanceA Node.js-based MCP server that enables AI agents to generate embeddings, index documents, and perform semantic vector searches using OpenAI and Chroma. It facilitates the creation of retrieval-augmented generation (RAG) pipelines for internal knowledge assistants and document-based workflows.3-
- AlicenseNot gradedqualityCmaintenanceLocal offline semantic search over documents (txt, md, pdf, docx, pptx, csv). Indexes folders into a LanceDB vector database with multilingual embeddings and supports hybrid vector + keyword search via Reciprocal Rank Fusion. No API keys, no cloud, no Docker required.29AGPL 3.0
- FlicenseNot gradedqualityDmaintenanceEnables semantic search over your Cursor IDE chat history by vectorizing prompts and storing them in LanceDB. Provides a Dockerized API to perform vector similarity searches against your chat history.4-