Skip to main content
Glama

LanceDB Node

by vurtnec

LanceDB Node.js 벡터 검색

LanceDB와 Ollama의 임베딩 모델을 사용한 벡터 검색을 위한 Node.js 구현입니다.

개요

이 프로젝트에서는 다음 방법을 보여줍니다.

  • LanceDB 데이터베이스에 연결
  • Ollama를 사용하여 사용자 정의 임베딩 함수 만들기
  • 저장된 문서에 대한 벡터 유사성 검색 수행
  • 검색 결과 처리 및 표시

필수 조건

  • Node.js(v14 이상)
  • Ollama는 nomic-embed-text 모델을 사용하여 로컬로 실행 중입니다.
  • 읽기/쓰기 권한이 있는 LanceDB 저장 위치

설치

  1. 저장소를 복제합니다
  2. 종속성 설치:

지엑스피1

종속성

  • @lancedb/lancedb : Node.js용 LanceDB 클라이언트
  • apache-arrow : 열 형식 데이터 처리용
  • node-fetch : Ollama에 API 호출을 하기 위해

용법

벡터 검색 테스트 스크립트를 실행합니다.

pnpm test-vector-search

또는 직접 실행:

node test-vector-search.js

구성

스크립트는 다음에 연결됩니다.

  • 구성된 경로의 LanceDB
  • http://localhost:11434/api/embeddings 에서 Ollama API를 확인하세요.

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" 테이블에서 "성공 기준을 정의하는 방법"을 검색하여 유사도 점수와 함께 결과를 표시합니다.

특허

MIT 라이센스

기여하다

기여를 환영합니다! 풀 리퀘스트를 제출해 주세요.

-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

LanceDB와 Ollama의 임베딩 모델을 사용한 벡터 검색을 위한 Node.js 구현입니다.

  1. 개요
    1. 필수 조건
      1. 설치
        1. 종속성
          1. 용법
            1. 구성
              1. MCP 구성
                1. 사용자 정의 임베딩 함수
                  1. 벡터 검색 예제
                    1. 특허
                      1. 기여하다

                        Related MCP Servers

                        • -
                          security
                          A
                          license
                          -
                          quality
                          Provides RAG capabilities for semantic document search using Qdrant vector database and Ollama/OpenAI embeddings, allowing users to add, search, list, and delete documentation with metadata support.
                          Last updated -
                          5
                          4
                          TypeScript
                          Apache 2.0
                        • A
                          security
                          A
                          license
                          A
                          quality
                          A server that provides data retrieval capabilities powered by Chroma embedding database, enabling AI models to create collections over generated data and user inputs, and retrieve that data using vector search, full text search, and metadata filtering.
                          Last updated -
                          12
                          188
                          Python
                          Apache 2.0
                        • -
                          security
                          A
                          license
                          -
                          quality
                          A Model Context Protocol server that enables semantic search capabilities by providing tools to manage Qdrant vector database collections, process and embed documents using various embedding services, and perform semantic searches across vector embeddings.
                          Last updated -
                          89
                          TypeScript
                          MIT License
                        • -
                          security
                          A
                          license
                          -
                          quality
                          Enables semantic search across multiple Qdrant vector database collections, supporting multi-query capability and providing semantically relevant document retrieval with configurable result counts.
                          Last updated -
                          46
                          TypeScript
                          MIT License

                        View all related MCP servers

                        MCP directory API

                        We provide all the information about MCP servers via our MCP API.

                        curl -X GET 'https://glama.ai/api/mcp/v1/servers/vurtnec/mcp-LanceDB-node'

                        If you have feedback or need assistance with the MCP directory API, please join our Discord server