慣性聚合 関心のあるブログ、ニュース、テクノロジーを効率的に追跡
原文を読む 慣性聚合で開く

おすすめ購読元

博客园 - 司徒正美
V
V2EX
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
月光博客
月光博客
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python)
AIネイティブデータベースベクトルデータベース - ユーザドキュメント
Luis M · 2026-05-24 · via DEV Community

SynapCoresベクトルデータベース - ユーザー文書

文書日付: 2025年9月1日
バージョン: 1.0 (公開)
状態: 本番準備完了


総括

SynapCoresは、高度なインデックス、類似性検索、AIによる埋め込み生成を備えたクラウドネイティブベクトルデータベース機能を提供します。このドキュメントでは、SynapCoresを意味論的検索、推薦、AIによる機能のためのアプリケーションに統合する方法について説明します。

目次

  1. 概要
  2. 始め方
  3. 埋め込み生成
  4. 距離メトリクス
  5. インデックス戦略
  6. CRUD操作
  7. SQL統合
  8. REST API
  9. ベストプラクティス
  10. 一般的な使用例

概要

SynapCoresは従来のSQLデータベース機能とネイティブベクトル操作を組み合わせ、あなたに以下のことを可能にします:

  • 高次元埋め込みの保存と検索
  • 意味的類似性検索の実行
  • 関連データとベクトルデータを組み合わせたハイブリッドクエリの実行
  • データベース内で直接埋め込みを生成
  • 100ミリ秒未満のクエリ遅延で百万単位のベクトルにスケール

主要機能

ベクトル演算

  • 複数の距離メトリクス(コサイン、ユークリッド、ドット積、マンハッタン)
  • HNSWを使用した高速近似検索のための高度なインデックス
  • 正確および近似最近隣検索
  • バッチ操作による高い処理能力

SQL統合:

  • ネイティブベクトルデータ型
  • SQLクエリで呼び出せるAI関数
  • ベクトルデータと関係データを1つのクエリで結合
  • 標準SQL構文とベクトル拡張

エンタープライズ機能

  • ACIDトランザクション
  • 自動データ永続化
  • マルチテナント分離
  • 高い可用性

ゲットスタート

1. アカウントを作成

サインアップしてhttps://synapcores.comAPI認証情報を取得するため。

2. APIトークンを取得する

アカウントを作成した後、ダッシュボードからAPIトークンを生成します:

# Your API token will look like this
export SYNAPCORES_TOKEN="sc_live_abc123xyz..."

フルスクリーンモードに入る フルスクリーンモードを終了する

3. データベースに接続する

ソケット接続(SQLインターフェース):

# Connection via SynapCores native protocol
synapcores://username:password@your-instance.synapcores.com:5433/your_database

フルスクリーンモードを開始 フルスクリーンモードを終了

REST API:

# Base URL
https://api.synapcores.com/api/v1

フルスクリーンモードを開始 フルスクリーンモードを終了

接続方法:

  • ネイティブソケットプロトコル: SQLクエリと高性能操作のために
  • REST API: 言語非依存のHTTPベースアクセス

4. 最初のベクトル空間を作成

SQLを使用して:

SELECT create_vector_space('products', 384, 'cosine');

フルスクリーンモードに入る フルスクリーンモードから退出する

REST APIを使用して:

curl -X POST https://api.synapcores.com/api/v1/vectors/collections \
  -H "Authorization: Bearer $SYNAPCORES_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "products",
    "dimensions": 384,
    "distance_metric": "cosine",
    "index_type": "hnsw"
  }'

フルスクリーンモードに入る フルスクリーンモードから退出する


埋め込み生成

対応モデル

SynapCoresは、複数のモデルオプションで組み込みの埋め込み生成を提供します:

モデル 次元 最適な用途 速度
MiniLM 384 汎用テキスト、高速処理 ⚡⚡⚡高速
BERT Base 768 高品質な意味理解 ⚡⚡ 中程度
BERT Large 1024 最大埋め込み品質 ⚡ より遅い

利用方法

SQLで埋め込みを生成:

-- Use default model (MiniLM)
SELECT EMBED('wireless headphones');

-- Specify model explicitly
SELECT EMBED('wireless headphones', 'minilm');
SELECT EMBED('wireless headphones', 'bert-base');
SELECT EMBED('wireless headphones', 'bert-large');

フルスクリーンモードを入力 フルスクリーンモードを退出

データ挿入中:

INSERT INTO products (name, description, embedding)
VALUES (
    'Bluetooth Headphones',
    'Premium wireless audio device',
    EMBED('Bluetooth Headphones Premium wireless audio device')
);

フルスクリーンモードを開始 フルスクリーンモードを終了

バッチ処理:

-- Generate embeddings for existing data
UPDATE products
SET embedding = EMBED(name || ' ' || description)
WHERE embedding IS NULL;

フルスクリーンモードを開始 フルスクリーンモードを終了


距離メトリクス

適切なメトリクスの選択

1. コサイン類似度(テキストに推奨)

最適な:テキストエンコーディング、意味検索、文書類似度

範囲:[-1, 1]で、1は最も類似

使用時:文書、製品、またはテキストベースのコンテンツを比較する際

SELECT COSINE_SIMILARITY(vector1, vector2) as similarity
FROM comparisons;

フルスクリーンモードを開始 フルスクリーンモードを終了

:類似の製品説明を見つける

2. ユークリッド距離(L2)

最適な場合:空間データ、画像埋め込み

範囲:[0, ∞] で、0は同一

使用する場合:空間座標や画像特徴を比較する時

SELECT EUCLIDEAN_DISTANCE(vector1, vector2) as distance
FROM comparisons;

フルスクリーンモードを入力 フルスクリーンモードを退出

: 類似画像を探す

3. 内積

最適な用途: 推薦システム

範囲: (-∞, ∞)

次のように使用: 正規化されたベクトルで関連スコアを計算する場合

SELECT INNER_PRODUCT(vector1, vector2) as score
FROM comparisons;

フルスクリーンモードを開始 フルスクリーンモードを終了

: ユーザー-アイテム推薦

4. マンハッタン距離(L1)

最適な場合: 疎な高次元データ

範囲: [0, ∞]

使用する場合: 疎な特徴ベクトルを扱う際

SELECT MANHATTAN_DISTANCE(vector1, vector2) as distance
FROM comparisons;

フルスクリーンモードを開始 フルスクリーンモードを終了


インデックス戦略

平面インデックス(正確な検索)

特徴

  • 100%の再現率を保証(正確な結果)
  • 全てのベクトルを検索(総当たり)
  • 小さなデータセットに最適

使用する場面

  • < 10,000ベクトル以下
  • 正確な結果が必要な場合
  • 検証とベンチマーク

パフォーマンス:小さなデータセットの場合1-10ms

-- Create with flat index (default)
SELECT create_vector_space('small_collection', 384, 'cosine');

フルスクリーンモードに入る フルスクリーンモードから退出する

HNSW インデックス(高速近似検索)

特徴

  • グラフベースの近似近傍検索
  • フラットインデックスより10-100倍高速
  • 精度と速度の調整可能

使用する場面

  • 10K以上のベクトル
  • 本番環境での応用
  • 100ミリ秒以下のレイテンシが必要な場合

性能:百万単位のベクトルでも5-50ミリ秒

-- Create with HNSW index
SELECT create_vector_space('large_collection', 384, 'cosine', 'hnsw');

全画面表示モードに入る フルスクリーンモードを終了

インデックス選択ガイド

ベクトル数 推奨インデックス 予想レイテンシ
< 10K フラット 1-10ms
10K - 100K HNSW 5-20ms
100K - 1M HNSW 10-50ms
1M+ HNSW 20-100ms

CRUD 操作

1. テンソル空間の作成

ベクトルのコレクションを初期化します:

SQL:

SELECT create_vector_space(
    'products',     -- Space name
    384,            -- Dimensions
    'cosine'        -- Distance metric
);

フルスクリーンモードを開始 フルスクリーンモードを終了

REST API:

curl -X POST https://api.synapcores.com/api/v1/vectors/collections \
  -H "Authorization: Bearer $SYNAPCORES_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "products",
    "dimensions": 384,
    "distance_metric": "cosine",
    "index_type": "hnsw"
  }'

フルスクリーンモードを開始 フルスクリーンモードを終了

レスポンス:

{
  "status": "success",
  "data": {
    "name": "products",
    "dimensions": 384,
    "distance_metric": "cosine",
    "index_type": "hnsw",
    "created_at": "2025-09-01T10:00:00Z"
  }
}

フルスクリーンモードを開始 フルスクリーンモードを終了


2. ビクトルを挿入

自動生成IDを使用した単一挿入

SQL:

INSERT INTO vector_spaces.products (values, metadata)
VALUES (
    EMBED('Wireless Bluetooth Headphones'),
    '{"product_id": "12345", "category": "electronics"}'::JSON
);

フルスクリーンモードを開始 フルスクリーンモードを終了

REST API:

curl -X POST https://api.synapcores.com/api/v1/vectors/collections/products/vectors \
  -H "Authorization: Bearer $SYNAPCORES_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "vectors": [{
      "values": [0.1, 0.2, 0.3, ...],
      "metadata": {
        "product_id": "12345",
        "category": "electronics"
      }
    }]
  }'

フルスクリーンモードを開始 フルスクリーンモードを終了

カスタムIDで挿入

SQL:

INSERT INTO vector_spaces.products (id, values, metadata)
VALUES (
    'prod_12345',
    EMBED('Wireless Bluetooth Headphones'),
    '{"category": "electronics"}'::JSON
);

フルスクリーンモードを開始 フルスクリーンモードを終了

バッチインサート(大量データに推奨)

SQL

-- Insert multiple vectors efficiently
INSERT INTO vector_spaces.products (values, metadata)
SELECT
    EMBED(description),
    JSON_BUILD_OBJECT('product_id', product_id, 'category', category)
FROM products
WHERE embedding IS NULL
LIMIT 1000;

フルスクリーンモードを開始

REST API

curl -X POST https://api.synapcores.com/api/v1/vectors/collections/products/vectors \
  -H "Authorization: Bearer $SYNAPCORES_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "vectors": [
      {"values": [0.1, ...], "metadata": {"product_id": "1"}},
      {"values": [0.2, ...], "metadata": {"product_id": "2"}},
      ...
    ]
  }'

:__JHSNS_SEG_038f59cf_245__バッチインサートは個別インサートより10~100倍高速です


検索ベクトル

意味検索

SQL:

SELECT
    v.id,
    v.metadata->>'product_id' as product_id,
    v.metadata->>'category' as category,
    COSINE_SIMILARITY(v.values, EMBED('wireless headphones')) as similarity
FROM vector_spaces.products v
WHERE COSINE_SIMILARITY(v.values, EMBED('wireless headphones')) > 0.7
ORDER BY similarity DESC
LIMIT 10;

フルスクリーンモードを開く フルスクリーンモードを終了

REST API:

curl -X POST https://api.synapcores.com/api/v1/vectors/collections/products/search \
  -H "Authorization: Bearer $SYNAPCORES_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query_text": "wireless headphones",
    "k": 10,
    "threshold": 0.7,
    "include_metadata": true
  }'

フルスクリーンモードを開く フルスクリーンモードを終了

レスポンス

{
  "status": "success",
  "data": [
    {
      "id": "prod_12345",
      "score": 0.95,
      "metadata": {
        "product_id": "12345",
        "category": "electronics"
      }
    },
    {
      "id": "prod_67890",
      "score": 0.87,
      "metadata": {
        "product_id": "67890",
        "category": "electronics"
      }
    }
  ],
  "total_results": 2,
  "query_time_ms": 12
}

フルスクリーンモードを開始 フルスクリーンモードを終了

ハイブリッド検索(ベクトル+フィルター)

意味論的検索と従来のSQLフィルターを組み合わせます

SELECT
    p.product_id,
    p.name,
    p.price,
    COSINE_SIMILARITY(p.embedding, EMBED('noise cancelling headphones')) as similarity
FROM products p
WHERE
    p.category = 'electronics'
    AND p.price BETWEEN 50 AND 200
    AND p.in_stock = true
    AND COSINE_SIMILARITY(p.embedding, EMBED('noise cancelling headphones')) > 0.7
ORDER BY similarity DESC, p.price ASC
LIMIT 20;

フルスクリーンモードを開始 フルスクリーンモードを終了

メタデータフィルターで検索(REST API)

curl -X POST https://api.synapcores.com/api/v1/vectors/collections/products/search \
  -H "Authorization: Bearer $SYNAPCORES_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query_text": "wireless headphones",
    "k": 20,
    "threshold": 0.7,
    "filter": {
      "category": "electronics",
      "in_stock": true
    }
  }'

フルスクリーンモードを開始 フルスクリーンモードを終了


4. ベクトルの更新

SQL

UPDATE vector_spaces.products
SET
    values = EMBED('Updated product description'),
    metadata = JSON_BUILD_OBJECT(
        'product_id', '12345',
        'category', 'audio',
        'updated_at', CURRENT_TIMESTAMP
    )
WHERE id = 'prod_12345';

フルスクリーンモードを開始 フルスクリーンモードを終了

REST API

curl -X PUT https://api.synapcores.com/api/v1/vectors/collections/products/vectors/prod_12345 \
  -H "Authorization: Bearer $SYNAPCORES_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "values": [0.1, 0.2, ...],
    "metadata": {
      "category": "audio",
      "updated_at": "2025-09-01T10:00:00Z"
    }
  }'

フルスクリーンモードを開始 フルスクリーンモードを終了


5. ベクトルの削除

SQL

-- Delete by ID
DELETE FROM vector_spaces.products
WHERE id = 'prod_12345';

-- Delete by criteria
DELETE FROM vector_spaces.products
WHERE metadata->>'category' = 'discontinued';

フルスクリーンモードを開始 フルスクリーンモードを終了

REST API:

# Delete single vector
curl -X DELETE https://api.synapcores.com/api/v1/vectors/collections/products/vectors/prod_12345 \
  -H "Authorization: Bearer $SYNAPCORES_TOKEN"

# Batch delete
curl -X POST https://api.synapcores.com/api/v1/vectors/collections/products/delete_batch \
  -H "Authorization: Bearer $SYNAPCORES_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"ids": ["prod_12345", "prod_67890"]}'

フルスクリーンモードに入る フルスクリーンモードを終了


6. IDでベクトルを取得

SQL:

SELECT id, values, metadata
FROM vector_spaces.products
WHERE id = 'prod_12345';

フルスクリーンモードに入る フルスクリーンモードを終了

REST API

curl -X GET https://api.synapcores.com/api/v1/vectors/collections/products/vectors/prod_12345 \
  -H "Authorization: Bearer $SYNAPCORES_TOKEN"

フルスクリーンモードを開始 フルスクリーンモードを終了


SQL統合

テンソルデータ型

ネイティブなテンソル列を持つテーブルを作成:

CREATE TABLE products (
    id INTEGER PRIMARY KEY,
    name TEXT NOT NULL,
    description TEXT,
    price DECIMAL(10,2),
    category TEXT,
    embedding VECTOR(384)  -- 384-dimensional vector
);

フルスクリーンモードを開始 フルスクリーンモードを終了

AI関数

EMBED() - エンコーディングの生成

-- Default model (MiniLM, 384 dimensions)
SELECT EMBED('wireless headphones');

-- Specify model
SELECT EMBED('wireless headphones', 'minilm');    -- 384d
SELECT EMBED('wireless headphones', 'bert-base'); -- 768d
SELECT EMBED('wireless headphones', 'bert-large'); -- 1024d

-- Use in INSERT
INSERT INTO products (name, description, embedding)
VALUES (
    'Bluetooth Headphones',
    'Premium wireless audio device',
    EMBED('Bluetooth Headphones Premium wireless audio device')
);

フルスクリーンモードを開始 フルスクリーンモードを終了

ベクトル類似度関数

COSINE_SIMILARITY():

SELECT
    product_id,
    name,
    COSINE_SIMILARITY(embedding, EMBED('wireless bluetooth headphones')) as similarity_score
FROM products
WHERE COSINE_SIMILARITY(embedding, EMBED('wireless bluetooth headphones')) > 0.7
ORDER BY similarity_score DESC
LIMIT 10;

フルスクリーンモードを開始 フルスクリーンモードを終了

EUCLIDEAN_DISTANCE():

SELECT
    id,
    EUCLIDEAN_DISTANCE(embedding, :query_vector) as distance
FROM image_embeddings
ORDER BY distance ASC
LIMIT 5;

フルスクリーンモードを開始 フルスクリーンモードを終了

内積:

SELECT
    user_id,
    item_id,
    INNER_PRODUCT(user_embedding, item_embedding) as relevance_score
FROM recommendations
WHERE relevance_score > 0.5
ORDER BY relevance_score DESC;

フルスクリーンモードを開始 フルスクリーンモードを終了

高度なSQLパターン

ジョインによる意味検索

-- Find customers who purchased similar products
SELECT
    c.customer_id,
    c.customer_name,
    p.product_name,
    o.order_date,
    COSINE_SIMILARITY(p.embedding, EMBED('premium headphones')) as relevance
FROM customers c
JOIN orders o ON c.customer_id = o.customer_id
JOIN order_items oi ON o.order_id = oi.order_id
JOIN products p ON oi.product_id = p.product_id
WHERE
    o.order_date > CURRENT_DATE - INTERVAL '90 days'
    AND COSINE_SIMILARITY(p.embedding, EMBED('premium headphones')) > 0.75
ORDER BY relevance DESC, o.order_date DESC
LIMIT 50;

Enter fullscreen mode Exit fullscreen mode

ベクターによる集計

-- Average similarity by category
SELECT
    category,
    COUNT(*) as product_count,
    AVG(COSINE_SIMILARITY(embedding, EMBED('premium quality'))) as avg_relevance
FROM products
GROUP BY category
HAVING avg_relevance > 0.6
ORDER BY avg_relevance DESC;

Enter fullscreen mode Exit fullscreen mode

ベクター付きサブクエリ

-- Find products similar to top sellers
WITH top_products AS (
    SELECT product_id, embedding
    FROM products p
    JOIN order_items oi ON p.product_id = oi.product_id
    GROUP BY p.product_id, p.embedding
    ORDER BY SUM(oi.quantity) DESC
    LIMIT 10
)
SELECT DISTINCT
    p.product_id,
    p.name,
    MAX(COSINE_SIMILARITY(p.embedding, tp.embedding)) as max_similarity
FROM products p
CROSS JOIN top_products tp
WHERE p.product_id NOT IN (SELECT product_id FROM top_products)
GROUP BY p.product_id, p.name
HAVING MAX(COSINE_SIMILARITY(p.embedding, tp.embedding)) > 0.8
ORDER BY max_similarity DESC
LIMIT 20;

フルスクリーンモードを開始します フルスクリーンモードを終了します


REST API

ベースURL

https://api.synapcores.com/api/v1

フルスクリーンモードを開始します フルスクリーンモードを終了します

認証

すべてのリクエストにはBearerトークン認証が必要です:

Authorization: Bearer <your_api_token>

フルスクリーンモードを開始します フルスクリーンモードを終了

エンドポイント

メソッド エンドポイント 目的
GET /vectors/collections すべてのコレクションを一覧表示
POST /vectors/collections コレクションを作成
GET /vectors/collections/:name コレクションの情報を取得
DELETE /vectors/collections/:name コレクションを削除
POST /vectors/collections/:name/vectors ベクトルを挿入
GET /vectors/collections/:name/vectors/:id IDでベクトルを取得
PUT /vectors/collections/:name/vectors/:id ベクトルを更新
DELETE /vectors/collections/:name/vectors/:id ベクトルを削除
POST /vectors/collections/:name/search ベクトルを検索
POST /vectors/collections/:name/search/batch バッチ検索

完全なワークフロー例

# 1. Create collection
curl -X POST https://api.synapcores.com/api/v1/vectors/collections \
  -H "Authorization: Bearer $SYNAPCORES_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "documents",
    "dimensions": 384,
    "distance_metric": "cosine",
    "index_type": "hnsw"
  }'

# 2. Insert documents
curl -X POST https://api.synapcores.com/api/v1/vectors/collections/documents/vectors \
  -H "Authorization: Bearer $SYNAPCORES_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "vectors": [{
      "id": "doc_001",
      "values": [0.1, 0.2, ...],
      "metadata": {"title": "Getting Started", "type": "guide"}
    }]
  }'

# 3. Search documents
curl -X POST https://api.synapcores.com/api/v1/vectors/collections/documents/search \
  -H "Authorization: Bearer $SYNAPCORES_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query_text": "how to get started",
    "k": 10,
    "threshold": 0.7
  }'

フルスクリーンモードを開始 フルスクリーンモードを終了

レートリミット

操作 制限 備考
挿入あたりのベクター数 1,000 大きなデータセットの場合はバッチ操作を使用
バッチ検索あたりのクエリ数 100 大きいバッチを複数のリクエストに分割
分毎のAPIリクエスト数 1,000 上限を上げるにはサポートに連絡

ベストプラクティス

1. 埋め込み次元の選択

次元 モデル 使用例 トレードオフ
384 MiniLM 汎用性が高くコスト効率が良い 最適なバランス
768 BERT Base より高い品質の意味理解 2倍のストレージコスト
1024 BERT Large 重要なアプリケーションに最高の品質 3倍のストレージコスト

推薦: 大多数の使用例で384次元(MiniLM)から始めます

2. バッチ操作

常にを使用してください

  • 大量のデータインポート
  • 定期的な再インデックス化
  • データ移行

パフォーマンスの向上:

  • 個別の操作より10-100倍高速
  • APIコールオーバーヘッドの削減
  • より高いスループット

最適なバッチサイズ:リクエストあたり100-1000のベクトル

3. クエリ最適化

フィルタを効果的に使用

-- Good: Filter before vector search
SELECT *
FROM products
WHERE
    category = 'electronics'  -- Traditional filter first
    AND price < 200
    AND COSINE_SIMILARITY(embedding, EMBED('headphones')) > 0.7

全画面表示モードに入る 全画面表示モードを出る

頻繁なクエリのキャッシュアプリケーションで人気のある検索エンコーディングをキャッシュ

  • 同一のクエリに対してエンコーディングを再利用
  • エンコーディングの生成コストを削減
  • 4. エラー処理

リトライロジックを実装

フルスクリーンモードに切り替える

import time
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry

session = requests.Session()
retry = Retry(
    total=3,
    backoff_factor=0.3,
    status_forcelist=[429, 500, 502, 503, 504]
)
adapter = HTTPAdapter(max_retries=retry)
session.mount('https://', adapter)

フルスクリーンモードを終了する

レートリミットの処理:

  • レスポンスヘッダーでレートリミット情報を確認
  • 指数的バックオフを実装
  • 高負荷時にはリクエストをキューに追加

5. 監視と可視性

アプリケーションで主要メトリクスを追跡:

  • クエリ遅延(p50, p95, p99)
  • 検索の精度/関連性
  • 埋め込み生成時間
  • APIエラー率

重要なイベントを記録:

  • 埋め込み生成に失敗
  • 遅いクエリ (> 100ms)
  • レートリミットヒット

一般的な使用例

Eコマースセマンティック検索の使用例1

-- Create product table with embeddings
CREATE TABLE products (
    product_id SERIAL PRIMARY KEY,
    name TEXT,
    description TEXT,
    category TEXT,
    price DECIMAL(10,2),
    embedding VECTOR(384)
);

-- Index products
INSERT INTO products (name, description, category, price, embedding)
SELECT
    name,
    description,
    category,
    price,
    EMBED(name || ' ' || description)
FROM product_catalog;

-- Search by semantic meaning
SELECT
    product_id,
    name,
    price,
    COSINE_SIMILARITY(embedding, EMBED('wireless headphones')) as relevance
FROM products
WHERE relevance > 0.7
ORDER BY relevance DESC
LIMIT 20;

Enter fullscreen mode Exit fullscreen mode

使用例2:コンテンツ推薦

-- Find similar articles based on user reading history
WITH user_interests AS (
    SELECT AVG(a.embedding) as avg_embedding
    FROM user_reading_history urh
    JOIN articles a ON urh.article_id = a.article_id
    WHERE urh.user_id = :user_id
)
SELECT
    a.article_id,
    a.title,
    COSINE_SIMILARITY(a.embedding, ui.avg_embedding) as relevance
FROM articles a
CROSS JOIN user_interests ui
WHERE a.article_id NOT IN (
    SELECT article_id FROM user_reading_history WHERE user_id = :user_id
)
AND relevance > 0.6
ORDER BY relevance DESC
LIMIT 10;

Enter fullscreen mode Exit fullscreen mode

使用例3:重複検出

-- Find near-duplicate documents
SELECT
    d1.document_id as doc1_id,
    d2.document_id as doc2_id,
    COSINE_SIMILARITY(d1.embedding, d2.embedding) as similarity
FROM documents d1
JOIN documents d2 ON d1.document_id < d2.document_id
WHERE COSINE_SIMILARITY(d1.embedding, d2.embedding) > 0.95
ORDER BY similarity DESC;

Enter fullscreen mode Exit fullscreen mode

顧客サポートルーティングの使用例

-- Find similar resolved tickets
SELECT
    t.ticket_id,
    t.subject,
    t.resolution,
    COSINE_SIMILARITY(t.embedding, EMBED(:new_ticket_text)) as similarity
FROM support_tickets t
WHERE
    t.status = 'resolved'
    AND similarity > 0.8
ORDER BY similarity DESC
LIMIT 5;

フルスクリーンモードを開始 フルスクリーンモードを終了


トラブルシューティング

クエリのパフォーマンスが遅い

症状:クエリが> 100ミリ秒

解決策

  1. HNSW インデックスが使用されていることを確認(クエリプランを確認)
  2. 要求される結果の数を減らす(k値を下げる)
  3. メタデータフィルタを使用して検索空間を絞り込む
  4. 低次元の埋め込みを使用することを検討(384ではなく768を使用)

高APIエラー率

症状:頻繁に429(レートリミット)または5xxエラーが発生

解決策:

  1. 指数的バックオフ再試行ロジックを実装
  2. 個別のリクエストの代わりにバッチ操作を使用
  3. サポートに連絡してレートリミットを増やす
  4. よく使用されるエンコーディングをキャッシュ

予期せぬ検索結果

症状:意味論的検索での不関連な結果

解決策:

  1. 類似度閾値を上げる(0.7ではなく0.8を試してみる)
  2. 入力テキストが正しく埋め込まれているか確認してください
  3. 正しい埋め込みモデルが使用されているか確認してください
  4. メタデータフィルタを正確性についてレビューしてください

エンブレディング生成の失敗

症状: EMBED() 関数のエラーまたはタイムアウト

ソリューション:

  1. テキストの長さが512トークン未満か確認
  2. 特殊文字やエンコーディングの問題がないか確認
  3. 指数的バックオフで再試行
  4. エラーが続く場合はサポートに連絡

クライアントライブラリ

Python

import requests

class SynapCoresClient:
    def __init__(self, api_token):
        self.base_url = "https://api.synapcores.com/api/v1"
        self.headers = {
            "Authorization": f"Bearer {api_token}",
            "Content-Type": "application/json"
        }

    def search(self, collection, query_text, k=10, threshold=0.7):
        response = requests.post(
            f"{self.base_url}/vectors/collections/{collection}/search",
            headers=self.headers,
            json={
                "query_text": query_text,
                "k": k,
                "threshold": threshold
            }
        )
        return response.json()

# Usage
client = SynapCoresClient("your_api_token")
results = client.search("products", "wireless headphones", k=10)

フルスクリーンモードに切り替え フルスクリーンモードを終了

JavaScript/TypeScript

class SynapCoresClient {
    constructor(apiToken) {
        this.baseUrl = 'https://api.synapcores.com/api/v1';
        this.headers = {
            'Authorization': `Bearer ${apiToken}`,
            'Content-Type': 'application/json'
        };
    }

    async search(collection, queryText, k = 10, threshold = 0.7) {
        const response = await fetch(
            `${this.baseUrl}/vectors/collections/${collection}/search`,
            {
                method: 'POST',
                headers: this.headers,
                body: JSON.stringify({
                    query_text: queryText,
                    k,
                    threshold
                })
            }
        );
        return await response.json();
    }
}

// Usage
const client = new SynapCoresClient('your_api_token');
const results = await client.search('products', 'wireless headphones', 10);

フルスクリーンモードに入る フルスクリーンモードから退出する


パフォーマンスの期待値

クエリ遅延

データセットサイズ インデックスタイプ 典型的な遅延
< 10Kベクトル フラット 1-5ms
10K-100Kベクトル HNSW 5-20ms
100K-1Mベクトル HNSW 10-50ms
1M+ベクトル HNSW 20-100ms

SynapCoresサーバーから測定されたレイテンシ。総クライアント応答時間にネットワークレイテンシを追加してください.

スループット

オペレーション 期待される処理能力
単一挿入 ~1,000 オペレーション/秒
バッチ挿入(100ベクトル) ~10,000 ベクトル/秒
検索クエリ ~5,000 クエリ/秒

拡張性の限界

リソース 制限 注記
空間あたりのベクトル 10M+ テスト済みおよび生産用
最大サイズ 4096 高次元 = 検索が遅延
バッチサイズ 1,000ベクトル APIリクエストあたり
APIレート制限 1,000リクエスト/分 サポートにお問い合わせください

サポートとリソース

ドキュメント

コミュニティ

サポート

チュートリアル

  • 始め方: 15分で最初のセマンティック検索を構築
  • 本番環境デプロイ: 本番環境へのスケールアップのベストプラクティス
  • 高度なパターン: ハイブリッド検索、RAG、および多様なアプリケーション

価格

現在の価格詳細については、https://synapcores.com/pricingを訪問してください.

無料プラン:

  • 100Kベクター
  • 1M APIリクエスト/月
  • コミュニティサポート

プロプラン:

  • 10Mベクトル
  • 無制限APIリクエスト
  • メールサポート
  • 99.9%SLA

エンタープライズレベル

  • 無制限ベクトル
  • 専用サポート
  • カスタムSLA
  • オンプレミスデプロイメントオプション

限界

現在の限界

  1. 次元の変更: 作成後にはベクトル空間の次元を変更できません
  2. メトリックの変更: 空間作成後には距離メトリックを変更できません
  3. 最大次元: 最大4096次元
  4. バッチサイズ: 1回のリクエストあたり最大1000ベクトル

計画されている機能

  • 量子化によるストレージコスト削減
  • GPUアクセラレッド検索
  • ドキュメントごとの複数ベクトルサポート
  • 高度なフィルタ検索最適化
  • リアルタイムインデックス更新

結論

SynapCoresは、以下の機能を備えたクラウドネイティブなベクトルデータベースを提供します:

セマンティック検索 - 意味で似たコンテンツを検索、キーワードではなく
SQL統合 - ベクトルクエリとリレーショナルクエリを組み合わせる
使いやすい - シンプルなAPIとSQL関数
高性能 - スケールアップしても100ms未満のクエリ
完全管理型 - インフラストラクチャのメンテナンス不要

今日からAI搭載アプリケーションを構築しましょうhttps://synapcores.com


ドキュメントバージョン: 1.0 (公開)
最終更新日: 2025年9月1日
技術サポートは:support@synapcores.com


著作権(Copyright) © 2025 SynapCores. 全部の権利を保有しています。性能の特徴は作業パターンやネットワークの状態によって異なる場合があります.


初めて公開はsynapcores.com — SynapCoresは無料の、単一バイナリのAIネイティブデータベース(ベクトル+グラフ+SQL+LLM)です。