Vector Search Service Provider
БесплатноНе проверенA clean architecture backend API that registers and semantically searches data using vector embeddings, acting as an MCP context provider to connect AI models t
Описание
A clean architecture backend API that registers and semantically searches data using vector embeddings, acting as an MCP context provider to connect AI models to external data.
README
Backend API for data registration and semantic search, acting as an MCP (Model Context Protocol) context provider.
Tech Stack
- Node.js + TypeScript (Strict mode)
- NestJS (HTTP Framework and Dependency Injection)
- PostgreSQL + pgvector (Vector Database)
- Prisma (ORM)
- OpenAI / Gemini / Claude (Voyage AI) (Interchangeable Embedding Adapters)
- Helmet + Throttler (Security headers and Rate Limiting)
Architecture
The project follows Clean Architecture and Hexagonal Architecture:
- Domain: Framework-agnostic Entities and Interfaces (Ports).
- Application: Use Cases containing business rules.
- Infrastructure: Concrete implementations (Prisma, AI Adapters).
- Interface: HTTP Controllers (REST).
Configuration
1. Installation and Environment
Install dependencies:
npm installConfigure environment variables: Copy
.env.exampleto.envand fill in the keys.cp .env.example .envSupported Adapters (
EMBEDDING_PROVIDER):openai: RequiresOPENAI_API_KEY(Model:text-embedding-3-small) (Recommended)gemini: RequiresGOOGLE_GENAI_API_KEY(Model:gemini-embedding-001)claude: RequiresANTHROPIC_API_KEYandVOYAGE_API_KEY(Model:voyage-large-2).
Security Configuration:
MAX_CONTENT_ITEMS: Maximum number of items allowed in thedataarray (Default: 100).
2. Database with Docker
You can start the PostgreSQL database with pgvector extension using Docker Compose:
docker compose up -d
This will start the database on port 5432. Default credentials are in docker-compose.yml.
3. Database Migration
Run the Prisma migrations to create the database schema:
npx prisma migrate dev
4. Execution
To start the application in development mode:
npm run start:dev
The application will be available at http://localhost:3000.
5. Swagger Documentation
Interactive API documentation (Swagger UI) is available at:
http://localhost:3000/api
API Endpoints
1. Register Data (Upsert)
POST /data/register
Registers data for a project and content ID. Replaces existing data (idempotent).
Payload:
{
"projectId": "project-alpha",
"contentId": "doc-123",
"data": [
"MCP allows connecting AIs to external data.",
"Vector search uses embeddings for similarity."
]
}
Response (201):
{
"message": "Data registered successfully"
}
2. Search Data
POST /data/search
Semantic search on registered data.
Payload:
{
"search": "how does vector search work?",
"projectId": "project-alpha",
"limit": 3
}
Response (200):
{
"results": [
{
"projectId": "project-alpha",
"contentId": "doc-123",
"data": [
"Vector search uses embeddings for similarity."
]
}
]
}
3. List Data (Grouped)
GET /data
Lists stored data, grouped by project and content, returning item counts. Supports pagination.
Query Params:
projectId(optional): Filter by project.contentId(optional): Filter by content ID.page(default: 1): Page number.limit(default: 10): Items per page.
Response (200):
{
"results": [
{
"projectId": "project-alpha",
"contents": [
{
"contentId": "doc-123",
"items": 2
}
]
}
],
"page": 1,
"limit": 10
}
4. Remove Data
DELETE /data
Removes data filtering by project or content ID. At least one filter is required.
Query Params:
projectId: Project ID.contentId: Content ID.
Response (200):
{
"message": "Data removed successfully"
}
Security Features
- Input Validation: Strict DTO validation with
class-validator(whitelist enabled). - Rate Limiting: Global rate limiting (100 requests/minute) using
@nestjs/throttler. - HTTP Headers: Secure HTTP headers via
helmet. - CORS: Enabled with default settings.
- SQL Injection Protection: Uses Prisma's parameterized queries and raw SQL template literals for vector operations.
- Payload Limits: Configurable limit for input array size (
MAX_CONTENT_ITEMS).
Tests
E2E Tests
npm run test:e2e
Unit Tests
npm run test
Folder Structure
src/
├── application/ # Business Rules (Use Cases)
├── domain/ # Entities and Interfaces
├── infrastructure/ # Implementations (DB, Adapters)
├── interface/ # Controllers and DTOs
└── main.ts # Entrypoint
Установка Vector Search Service Provider
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/thiagoaramizo/vetorial-search-serviceFAQ
Vector Search Service Provider MCP бесплатный?
Да, Vector Search Service Provider MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Vector Search Service Provider?
Нет, Vector Search Service Provider работает без API-ключей и переменных окружения.
Vector Search Service Provider — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить Vector Search Service Provider в Claude Desktop, Claude Code или Cursor?
Открой Vector Search Service Provider на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzCompare Vector Search Service Provider with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
