能力标签
🔌
MCP工具

SochDB

基于 Rust · 让 AI 助手直接操作你的系统与工具
英文名:sochdb
⭐ 34 Stars 🍴 5 Forks 💻 Rust 📄 AGPL-3.0 🏷 AI 8.0分
8.0AI 综合评分
mcpai-agentsdatabaseembeddingsrust
✦ AI Skill Hub 推荐

SochDB 是 AI Skill Hub 本期精选MCP工具之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。

📚 深度解析

SochDB 是一款基于 MCP(Model Context Protocol)标准协议的 AI 工具扩展。MCP 协议由 Anthropic 开发并开源,旨在建立 AI 模型与外部工具之间的标准化通信接口,目前已被 Claude Desktop、Claude Code、Cursor 等主流 AI 工具采纳。

通过安装 SochDB,你的 AI 助手将获得额外的工具调用能力,可以用自然语言直接操控该工具的功能,无需学习复杂的命令行语法。MCP 工具的核心价值在于"一次配置,永久增强"——配置完成后,每次与 AI 对话时都可以无缝调用这些工具。

在技术实现上,MCP 工具通过标准的 JSON-RPC 协议与 AI 客户端通信,工具的功能以"工具列表"的形式暴露给 AI 模型,AI 可以按需调用。SochDB 提供了结构化的工具调用接口,使 AI 模型能够精确地理解和使用每个功能点,显著降低 AI 在工具使用上的错误率。

与传统的 API 集成相比,MCP 工具的优势在于无需编写代码——用户只需在配置文件中添加几行 JSON,即可让 AI 获得全新能力。AI Skill Hub 将 SochDB 评为 AI 评分 8.0 分,属于同类工具中的优质选择。

📋 工具概览

SochDB 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

GitHub Stars
⭐ 34
开发语言
Rust
支持平台
Windows / macOS / Linux
维护状态
轻量级项目,按需更新
开源协议
AGPL-3.0
AI 综合评分
8.0 分
工具类型
MCP工具
Forks
5

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

SochDB 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

📌 核心特色
  • 通过标准 MCP 协议与 Claude、Cursor 等主流 AI 客户端深度集成
  • 提供结构化工具调用接口,显著降低 AI 集成复杂度
  • 支持 Claude Desktop 和 Claude Code 无缝接入,开箱即用
  • 可与其他 MCP 工具组合叠加,构建完整 AI 工作站
  • 轻量无侵入设计,不影响现有系统架构
🎯 主要使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/sochdb/sochdb

# 方式二:手动配置 claude_desktop_config.json
{
  "mcpServers": {
    "sochdb": {
      "command": "npx",
      "args": ["-y", "sochdb"]
    }
  }
}

# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
📋 安装步骤说明
  1. 确认已安装 Node.js(v18 或以上版本)
  2. 打开 Claude Desktop 或 Claude Code 的 MCP 配置文件
  3. 按「交给 Agent 安装 → Claude Desktop」标签中的 JSON 配置填入 mcpServers 字段
  4. 保存配置文件并重启 Claude 客户端
  5. 重启后,在对话中即可使用本工具
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 安装后在 Claude 对话中直接使用
# 示例:
用户: 请帮我用 SochDB 执行以下任务...
Claude: [自动调用 SochDB MCP 工具处理请求]

# 查看可用工具列表
# 在 Claude 中输入:"列出所有可用的 MCP 工具"
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
// claude_desktop_config.json 配置示例
{
  "mcpServers": {
    "sochdb": {
      "command": "npx",
      "args": ["-y", "sochdb"],
      "env": {
        // "API_KEY": "your-api-key-here"
      }
    }
  }
}

// 保存后重启 Claude Desktop 生效
📑 README 深度解析 真实文档 完整度 87/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

简介

SochDB icon

Crate Overview

CrateDescriptionKey Components
sochdb-coreCore types and TOON formatSochValue, SochSchema, SochTable, codec
sochdb-kernelDatabase kernelWAL, MVCC, transactions, catalog
sochdb-storageStorage engineLSCS columnar, mmap, block checksums
sochdb-indexIndex structuresB-Tree, HNSW vector index
sochdb-queryQuery executionCost optimizer, context builder, SOCH-QL
sochdb-clientClient SDKSochConnection, PathQuery, BatchWriter
sochdb-plugin-loggingLogging pluginStructured logging, tracing

---

Key Features

🗃️ Real SQL — SQL-92-compatible engine with JOINs, aggregates (GROUP BY/SUM/AVG/HAVING), and MySQL/PostgreSQL/SQLite dialect normalization 🧠 Context Query Builder — Assemble system + user + history + retrieval under a token budget 🔍 Hybrid Search — HNSW vectors + BM25 keywords with reciprocal rank fusion 🕸️ Graph + Time-Travel — Property graph with bi-temporal, point-in-time recall ⚡ Embedded-First — single ~2.5 MB native library, no runtime dependencies, SQLite-style simplicity 🔒 Full ACID — MVCC + WAL + Serializable Snapshot Isolation 📊 Columnar Storage — Read only the columns you need

---

Feature Flags

FeatureCrateDescription
simdsochdb-clientSIMD optimizations for column access
embeddedsochdb-clientUse kernel directly (no IPC)
fullsochdb-kernelAll kernel features

---

Install dependencies

pip install chromadb lancedb python-dotenv requests numpy pip install -e sochdb-python-sdk/

Run real embedding benchmark (requires Azure OpenAI credentials in .env)

SOCHDB_LIB_PATH=target/release python3 benchmarks/real_embedding_benchmark.py

Prerequisites

  • Rust 2024 edition (1.75+)
  • Clang/LLVM (for SIMD optimizations)

Installation

Choose your preferred SDK:

```bash

🐳 Docker Deployment

SochDB includes a production-ready Docker setup with gRPC server:

```bash

Pull and run from Docker Hub

docker pull sochdb/sochdb:latest docker run -d -p 50051:50051 sochdb/sochdb:latest

Or use docker-compose

cd docker docker compose up -d ```

Docker Hub: sochdb/sochdb

Features: - ✅ Production-ready image (159MB) - ✅ High availability setup with Traefik - ✅ Prometheus + Grafana monitoring - ✅ gRPC-Web support via Envoy - ✅ Comprehensive test suite included

Performance (tested on Apple M-series): - Single-threaded: ~2K ops/sec - Concurrent (10 threads): ~10.5K ops/sec - Latency p99: <2.2ms

See docker/README.md for full documentation. | Node.js/TypeScript | sochdb-nodejs-sdk | npm install @sochdb/sochdb | | Go | sochdb-go | go get github.com/sochdb/sochdb-go@latest | | Rust | This repository | cargo add sochdb |

Build conversation graph

graph.add_node("msg_1", {"role": "user", "content": "What's the weather?"}) graph.add_node("msg_2", {"role": "assistant", "content": "Let me check..."}) graph.add_node("msg_3", {"role": "tool", "content": "Sunny, 72°F"}) graph.add_node("msg_4", {"role": "assistant", "content": "It's sunny and 72°F"})

Build context with token budgeting

context = ( ContextQuery(collection) .add_vector_query(query_embedding, weight=0.7) .add_keyword_query("machine learning optimization", weight=0.3) .with_token_budget(4000) # Fit within model context window .with_min_relevance(0.5) # Filter low-quality results .with_deduplication(DeduplicationStrategy.EXACT) .execute() )

Build the index

index.build()

📊 Context Query Builder

Build LLM context with automatic token budget management.

use sochdb_query::{ContextSection, ContextSelectQuery};
use sochdb::ContextQueryBuilder;

let context = ContextQueryBuilder::new()
    .for_session("session_123")
    .with_budget(4096)  // Token budget
    
    // System prompt (highest priority)
    .literal("SYSTEM", -1, "You are a helpful assistant")
    
    // User profile from database
    .section("USER", 0)
        .get("user.profile.{name, email, preferences}")
        .done()
    
    // Recent conversation history
    .section("HISTORY", 1)
        .last(10, "messages")
        .where_eq("session_id", session_id)
        .done()
    
    // Relevant documents via vector search
    .section("DOCS", 2)
        .search("knowledge_base", "query_embedding", 5)
        .min_score(0.7)
        .done()
    
    .truncation(TruncationStrategy::PriorityDrop)
    .format(ContextFormat::Soch)
    .execute()?;

println!("Tokens used: {}/{}", context.token_count, 4096);
println!("Context:\n{}", context.context);

---

Build SochDB release library

cargo build --release

🔧 Building from Source

Build

```bash

Build all crates

cargo build --release

📦 Quick Start

Examples

Hello World

Python

from sochdb import Database

db = Database.open("./my_db")
db.put(b"users/alice", b"Alice Smith")
print(db.get(b"users/alice").decode())  # "Alice Smith"
db.close()

Node.js / TypeScript

import { SochDatabase } from '@sochdb/sochdb';

const db = new SochDatabase('./my_db');
await db.put('users/alice', 'Alice Smith');
console.log(await db.get('users/alice'));  // "Alice Smith"
await db.close();

Go

package main

import (
    "fmt"
    sochdb "github.com/sochdb/sochdb-go"
)

func main() {
    db, _ := sochdb.Open("./my_db")
    defer db.Close()
    
    db.Put([]byte("users/alice"), []byte("Alice Smith"))
    value, _ := db.Get([]byte("users/alice"))
    fmt.Println(string(value))  // "Alice Smith"
}

Rust

use sochdb::Database;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let db = Database::open("./my_db")?;
    
    db.put(b"users/alice", b"Alice Smith")?;
    if let Some(value) = db.get(b"users/alice")? {
        println!("{}", String::from_utf8_lossy(&value));  // "Alice Smith"
    }
    Ok(())
}

Vector Search Example

Python

```python from sochdb import VectorIndex import numpy as np

Configuration

use sochdb_index::{HNSWIndex, HNSWConfig, DistanceMetric};

// Create index with custom parameters
let config = HNSWConfig {
    m: 16,                          // Max connections per layer
    m_max: 32,                      // Max connections at layer 0
    ef_construction: 200,           // Build-time search width
    ef_search: 50,                  // Query-time search width
    metric: DistanceMetric::Cosine, // Or Euclidean, DotProduct
    ..Default::default()
};

let index = HNSWIndex::with_config(config);

Option 1: Context manager (auto-flush)

with index.batch_accumulator(estimated_size=50_000) as acc: acc.add(ids, vectors) # Zero FFI, pure numpy memcpy

Option 2: Explicit control

acc = index.batch_accumulator(50_000) acc.add(chunk1_ids, chunk1_vecs) acc.add(chunk2_ids, chunk2_vecs) inserted = acc.flush() # Single bulk FFI call → full Rayon parallelism

Option 3: Cross-process persistence

acc.save("/tmp/vectors") # Persist to disk acc2 = index.batch_accumulator() acc2.load("/tmp/vectors") # Load in another process acc2.flush() # Build HNSW ```

Optional Ordered Index

SochDB's ordered index can be disabled for write-optimized workloads:

use sochdb::ConnectionConfig;

// Default: ordered index enabled (O(log N) prefix scans)
let config = ConnectionConfig::default();

// Write-optimized: disable ordered index (~20% faster writes)
let mut config = ConnectionConfig::default();
config.enable_ordered_index = false;
// Note: scan_prefix becomes O(N) instead of O(log N + K)
ModeWrite SpeedPrefix ScanUse Case
Ordered index **on**BaselineO(log N + K)Read-heavy, prefix queries
Ordered index **off**~20% fasterO(N)Write-heavy, point lookups

---

🛠 Configuration Reference

DatabaseConfig

pub struct DatabaseConfig {
    /// Enable group commit for better throughput
    pub group_commit: bool,           // default: true
    
    /// WAL sync mode
    pub sync_mode: SyncMode,          // default: Normal
    
    /// Maximum WAL size before checkpoint
    pub max_wal_size: u64,            // default: 64MB
    
    /// Memtable size before flush
    pub memtable_size: usize,         // default: 4MB
    
    /// Block cache size
    pub block_cache_size: usize,      // default: 64MB
    
    /// Compression algorithm
    pub compression: Compression,      // default: LZ4
}

HNSWConfig

pub struct HNSWConfig {
    /// Max connections per node per layer
    pub m: usize,                     // default: 16
    
    /// Max connections at layer 0
    pub m_max: usize,                 // default: 32
    
    /// Construction-time search width
    pub ef_construction: usize,       // default: 200
    
    /// Query-time search width (adjustable)
    pub ef_search: usize,             // default: 50
    
    /// Distance metric
    pub metric: DistanceMetric,       // default: Cosine
    
    /// Level multiplier (mL = 1/ln(M))
    pub ml: f32,                      // default: calculated
}

---

SDK Repositories

Language SDKs are maintained in separate packages and repos with their own release cycles:

LanguageRepositoryInstallation
**Rust**This repositorycargo add sochdb
**Python**[sochdb-python-sdk](https://github.com/sochdb/sochdb-python-sdk)pip install sochdb
**Node.js/TypeScript**[sochdb-nodejs-sdk](https://github.com/sochdb/sochdb-nodejs-sdk)npm install @sochdb/sochdb
**Go**[sochdb-go](https://github.com/sochdb/sochdb-go)go get github.com/sochdb/sochdb-go@latest

SDK Feature Matrix

FeaturePythonNode.jsGoRust
Basic KV
Transactions
SQL Operations
Vector Search
Path API
Prefix Scanning
Query Builder
Note: While SDKs are maintained in separate repositories, they share the same core functionality and API design. Refer to individual SDK repositories for language-specific documentation and examples.

---

High-Throughput Ingestion (Python SDK)

The Python SDK's BatchAccumulator provides 4–5× faster inserts by deferring HNSW graph construction:

```python from sochdb import VectorIndex import numpy as np

index = VectorIndex(dimension=1536, max_connections=16, ef_construction=200)

🌳 Path API

SochDB's unique path-based API provides O(|path|) resolution via the Trie-Columnar Hybrid (TCH) structure.

📚 API Reference

🔌 Plugin System

SochDB uses a plugin architecture for extensibility without dependency bloat.

Extension Types

ExtensionPurposeExample
StorageExtensionAlternative backendsRocksDB, LSCS
IndexExtensionCustom indexesLearned index, full-text
ObservabilityExtensionMetrics/tracingPrometheus, DataDog
CompressionExtensionCompression algosLZ4, Zstd

Implementing a Plugin

use sochdb_kernel::{Extension, ExtensionInfo, ObservabilityExtension};

struct PrometheusMetrics { /* ... */ }

impl Extension for PrometheusMetrics {
    fn info(&self) -> ExtensionInfo {
        ExtensionInfo {
            name: "prometheus-metrics".into(),
            version: "1.0.0".into(),
            description: "Prometheus metrics export".into(),
            author: "Your Name".into(),
            capabilities: vec![ExtensionCapability::Observability],
        }
    }
    
    fn as_any(&self) -> &dyn std::any::Any { self }
    fn as_any_mut(&mut self) -> &mut dyn std::any::Any { self }
}

impl ObservabilityExtension for PrometheusMetrics {
    fn counter_inc(&self, name: &str, value: u64, labels: &[(&str, &str)]) {
        // Push to Prometheus
    }
    
    fn gauge_set(&self, name: &str, value: f64, labels: &[(&str, &str)]) {
        // Set gauge value
    }
    
    fn histogram_observe(&self, name: &str, value: f64, labels: &[(&str, &str)]) {
        // Record histogram
    }
    
    // ... tracing methods
}

// Register the plugin
db.plugins().register_observability(Box::new(PrometheusMetrics::new()))?;

---

Comparison

Token Comparison

┌─────────────────────────────────────────────────────────────────┐
│                      JSON (156 tokens)                          │
├─────────────────────────────────────────────────────────────────┤
│ [                                                               │
│   {"id": 1, "name": "Alice", "email": "alice@example.com"},    │
│   {"id": 2, "name": "Bob", "email": "bob@example.com"},        │
│   {"id": 3, "name": "Charlie", "email": "charlie@example.com"} │
│ ]                                                               │
└─────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────┐
│                      TOON (52 tokens) — 67% reduction!          │
├─────────────────────────────────────────────────────────────────┤
│ users[3]{id,name,email}:                                        │
│ 1,Alice,alice@example.com                                       │
│ 2,Bob,bob@example.com                                           │
│ 3,Charlie,charlie@example.com                                   │
└─────────────────────────────────────────────────────────────────┘

VectorDBBench: 50K-Vector Comparison (SochDB vs ChromaDB vs LanceDB)

We benchmarked SochDB against ChromaDB and LanceDB using VectorDBBench — the industry-standard open-source benchmark from Zilliz. All databases ran on the same hardware in embedded mode. SochDB and ChromaDB use HNSW indexes; LanceDB uses IVF_PQ.

<p align="center"> <img src="docs/assets/benchmark_comparison.svg" alt="SochDB vs ChromaDB vs LanceDB benchmark comparison" width="800" /> </p>

#### Test Setup - Dataset: COHERE/OpenAI 50,000 vectors × 768–1536 dimensions - Queries: VectorDBBench standard query set (k=100) - Distance Metric: Cosine similarity - Ground Truth: VectorDBBench precomputed ground truth (brute-force) - Processes: Insert, optimize, and search in separate subprocesses (VectorDBBench default)

Configuration

ParameterSochDBChromaDBLanceDB
Index TypeHNSWHNSWIVF_PQ
M1616
ef_construction200200
ef_search500500
Version0.5.3 (SDK)0.4.220.19.0

Results

MetricSochDBChromaDBLanceDB (IVF_PQ)
**Recall@100**0.98990.99660.6574 *
**Avg Latency****3.3 ms** ✅15.4 ms5.6 ms
**P95 Latency****4.2 ms** ✅18.4 ms5.9 ms
**P99 Latency****5.9 ms** ✅22.3 ms12.2 ms
**Insert (50K vecs)****0.1 s** ✅76.9 s0.4 s
**Total Load****13.7 s** ✅76.9 s21.0 s
\* LanceDB recall is lower due to IVF_PQ (lossy compression) vs HNSW (graph-based exact search).

Key Findings

  • 🏎️ SochDB search is 4.7× faster than ChromaDB (3.3 ms vs 15.4 ms average)
  • 🏎️ SochDB search is 1.7× faster than LanceDB (3.3 ms vs 5.6 ms average)
  • SochDB total load is 5.6× faster than ChromaDB (13.7 s vs 76.9 s)
  • SochDB total load is 1.5× faster than LanceDB (13.7 s vs 21.0 s)
  • 🎯 SochDB recall (98.99%) is within 1% of ChromaDB while being 4.7× faster
  • ⚠️ LanceDB recall (65.74%) is significantly lower due to IVF_PQ lossy compression vs HNSW

How SochDB Achieves Fast Inserts: BatchAccumulator

SochDB's Python SDK includes a BatchAccumulator API that separates data accumulation from HNSW graph construction:

┌────────────────────────────────────────────────────────────────────┐
│                    BatchAccumulator Pipeline                       │
├───────────────────────┬──────────────────────────────────────────┤
│  Phase 1: Accumulate  │  Phase 2: Flush                          │
│  ──────────────────── │  ─────────────────                        │
│  • add(ids, vecs)     │  • Single insert_batch() FFI call        │
│  • Pure numpy memcpy  │  • Full Rayon parallel HNSW build        │
│  • Zero FFI calls     │  • Wave-parallel (32-node waves)         │
│  • ~0.05 s for 50K    │  • Adaptive ef (capped at 48)            │
│                       │  • ~13.7 s for 50K vectors               │
└───────────────────────┴──────────────────────────────────────────┘

```python from sochdb import VectorIndex

index = VectorIndex(dimension=1536, max_connections=16, ef_construction=200)

MemoryAgentBench: Head-to-Head RAG Comparison

Version: 2.0.0 | Benchmark Date: February 2026 | LLM: Azure OpenAI gpt-4.1-mini | Framework: MemoryAgentBench (UCSD)

We evaluated SochDB head-to-head against 7 RAG competitors using MemoryAgentBench — an academic benchmark from UCSD that tests how well memory systems help LLMs retrieve facts from multi-turn conversations over long contexts (up to 197K+ tokens).

<p align="center"> <img src="docs/assets/head_to_head_benchmark.svg" alt="SochDB vs RAG competitors head-to-head benchmark" width="800" /> </p>

Head-to-Head Results (gpt-4.1-mini, Ruler QA1 197K, 20 queries)

RankSystemEM %F1 %CorrectBuild (s)Query (s)QueriesType
🥇**SochDB V2****60.0****61.7****12/20**1.9**2.1**✅ 20/20Multi-Perspective RRF
🥈SochDB + HyDE30.042.66/203.337.0✅ 20/20Embedded HNSW
🥉GraphRAG25.040.65/2016.211.9✅ 20/20Knowledge Graph + NER
3SochDB + Rerank25.040.25/203.227.9✅ 20/20Embedded HNSW
5SochDB + Advanced25.037.85/203.314.0✅ 20/20Embedded HNSW
6SochDB Hybrid20.023.44/20**0.01**0.8✅ 20/20Embedded HNSW
7Self-RAG15.018.63/2012.90.9✅ 20/20Adaptive Retrieval
8BM2510.031.42/200.0627.4✅ 20/20Lexical Search
9Embedding RAG5.018.91/200.337.8✅ 20/20FAISS + Embedding
10Mem05.018.51/2051.71.0✅ 20/20Memory-as-a-Service
RAPTOR0/20Tree Summarization
All systems completed 20/20 queries except RAPTOR. SochDB V2 solved 4 queries that NO other system could: Q2 (Denmark, Iceland and Norway), Q7 (Catholic), Q11 (King Charles III), Q12 (Epte). Self-RAG results impacted by Azure content filter rejecting self-reflection prompts (~50% of queries blocked).

Key Findings — Head-to-Head

  • 🏆 SochDB V2 dominates at 60% EM — 2× the previous best (30%), 2.4× better than GraphRAG (25%)
  • 🏆 V2 solves 4 previously-impossible queries via Multi-Perspective RRF (3 embedding angles) + Few-Shot Precision Extraction
  • 🏆 SochDB is the only embedded system — zero external dependencies (no LangChain, spaCy, FAISS, or network services)
  • 🏆 V2 query time is 18× faster than HyDE v1 (2.1s vs 37.0s) and 6× faster than GraphRAG (11.9s)
  • 📊 GraphRAG is limited by ContextualCompressionRetriever — reduces context to ~848 tokens (vs SochDB's ~80K)
  • SochDB Hybrid is 40× faster than any competitor (0.8s query) while still competitive at 20% EM
  • 🧩 BM25 has surprisingly high substring match (70%) but low exact match (10%) — retrieves relevant docs but can't extract precise answers
  • 📉 Embedding RAG and Mem0 tied at 5% EM — basic vector similarity alone is insufficient for long-context QA

#### Test Setup - Dataset: Ruler QA1 197K (197,000-token context, 100 QA pairs, key-value retrieval) - Embeddings: Azure OpenAI text-embedding-3-small (1536D) - LLM: gpt-4.1-mini (all systems use the same LLM for fair comparison) - Competitors tested: GraphRAG, Self-RAG, BM25, Embedding RAG (FAISS), Mem0, RAPTOR - Task: Accurate Retrieval — memorize long conversations, then answer factual queries - Queries: 20 per system (max_test_queries_ablation=20) - Metrics: Exact match, F1, substring match, ROUGE-L (standard MemoryAgentBench metrics)

SochDB Configuration Comparison

ConfigurationEM %F1 %Sub-EM %ROUGE-LBuild (s)Query (s)Best For
**SochDB + HyDE****30.0****42.6**45.0**44.0**3.2937.0🎯 Max Accuracy
**SochDB + Rerank**25.040.2**50.0**42.93.2427.9🏆 **Recommended**
**SochDB + Advanced**25.037.835.037.53.2514.0⚠️ Don't stack
**SochDB (gpt-4.1)**20.030.320.029.5**0.01****6.6**⚡ Max Speed
**Mem0**5.018.530.017.951.71.0

📘 Developer Configuration Guide

TL;DR: Use Rerank for most use cases. Use HyDE when exact match is critical. Use baseline for real-time. Never stack all features together — it's slower and less accurate.
Your PriorityRecommended ConfigWhy
**Best overall balance**SochDB + RerankHighest substring match (50%), strong F1 (40.2%), 27% faster than HyDE
**Maximum exact accuracy**SochDB + HyDEBest EM (30%) and F1 (42.6%) — HyDE bridges question↔document vocabulary gap
**Lowest latency / real-time**SochDB baseline0.01s build, 6.6s query — no extra LLM calls during retrieval
**Fuzzy/partial matching**SochDB + Rerank50% substring match — cross-encoder reranker surfaces relevant context even on partial matches

Key decision factors:

  1. Retrieval strategy matters more than model size. Upgrading from gpt-4.1-mini → gpt-4.1 (full) gave identical 20% EM. But adding HyDE to gpt-4.1-mini boosted EM to 30% (+50% improvement). Invest in retrieval, not bigger LLMs.
  1. Don't stack features. The Advanced config (HyDE + Hybrid + Rerank combined) scored worse than HyDE or Rerank alone (25% EM, 35% Sub-EM). Each feature adds its own noise — pick the one that matches your use case.
  1. Rerank is the best all-rounder. It's 27% faster than HyDE (27.9s vs 37.0s query time), has the highest substring match (50%), near-equivalent F1 (40.2% vs 42.6%), and only 5pp behind HyDE on exact match.

Understanding Substring Match (Sub-EM)

What it measures: Does the gold answer appear anywhere inside the prediction, or vice versa?

Substring match is not a pure accuracy metric — it correlates with answer verbosity. Here's why different configs score differently:

ConfigEM %Sub-EM %GapExplanation
**SochDB (baseline)**20200Short precise answers (~4 tokens). When wrong, no overlap at all.
**SochDB + HyDE**3045+15Slightly longer answers. Wrong predictions still contain gold keywords.
**SochDB + Rerank**2550+25Reranker surfaces better context → predictions contain gold as substring.
**Mem0**530+25Very verbose answers (~13 tokens). Gold words appear by chance in long text.

Example: Gold answer is "Catholic" - Baseline predicts "Orthodox" → Sub-EM ❌ (short, no overlap) - Rerank predicts "Catholic orthodoxy" → Sub-EM ✅ (gold is a substring) - Mem0 predicts "The predominant religion was Catholic Christianity" → Sub-EM ✅ (verbose, gold appears)

⚠️ For developers: High Sub-EM with low EM (like Mem0: 5% EM / 30% Sub-EM) means the system is vaguely right but imprecise. High EM with proportional Sub-EM (like HyDE: 30% EM / 45% Sub-EM) means the system gives useful answers. Rerank's 50% Sub-EM with 25% EM is the sweet spot — it frequently gets the right entity even if not the exact formatting.

Key Findings

  • 🏆 SochDB + HyDE achieves 6× higher exact match than Mem0 (30.0% vs 5.0%)
  • 🏆 SochDB + Rerank is the recommended config — best substring match (50%) with strong F1 (40.2%) and 27% faster than HyDE
  • SochDB builds memory 5,170× faster than Mem0 (0.01s vs 51.7s)
  • 🧠 Retrieval strategy > model size: gpt-4.1 = gpt-4.1-mini at same retrieval (both 20% EM), but HyDE on mini → 30% EM
  • ⚠️ Don't stack all features: Advanced (HyDE+Hybrid+Rerank) scores worse than using HyDE or Rerank independently
  • 📊 Substring match tracks answer verbosity, not pure accuracy — use EM and F1 for quality decisions

Multi-Dataset Results (SochDB, 100 queries)

DatasetContextEM %F1 %Sub-EM %
Ruler QA1 197K197K tokens13.027.038.0
Ruler QA2 421K421K tokens**31.0****42.7****49.0**
LongMemEval400K tokens3.39.74.0
Note: Multi-dataset runs used gpt-4o-mini/gpt-4.1-mini with k=100. QA2 achieved higher accuracy than QA1 due to more distinctive key-value patterns.

Why SochDB is Different

  1. No External Dependencies: SochDB is the only system in this benchmark that requires zero Python packages for its core operation. GraphRAG needs LangChain + spaCy + FAISS + NER. Self-RAG needs custom retrieval chains. Even BM25 needs a ranking library. SochDB runs as an embedded Rust library via FFI.
  1. Reliable Under Pressure: SochDB completed 100% of queries (20/20) on every configuration. GraphRAG failed 50% due to API rate limits during NER extraction. RAPTOR couldn't even start. Self-RAG was blocked by content filters.
  1. Memory Build Speed: SochDB stores embeddings directly in its HNSW index — no LLM calls during memorization. GraphRAG needs LLM NER calls per document chunk (10× slower). Mem0 processes each memory through an extraction pipeline (5,170× slower).
  1. Retrieval Quality: SochDB's HyDE generates a synthetic answer before searching, bridging the question-document gap. This single technique (zero external dependencies) achieves 75% of GraphRAG's accuracy with 10× faster build and 100% completion rate.
  1. Honest Assessment: GraphRAG's knowledge graph approach is genuinely more accurate on the queries it completes. For applications where reliability and deployment simplicity matter more than peak accuracy, SochDB is the better choice. For research workloads with high API quotas, GraphRAG is worth considering.

---

Token Efficiency (TOON vs JSON)

DatasetJSON TokensTOON TokensReduction
Users (100 rows, 5 cols)2,340782**66.6%**
Events (1000 rows, 3 cols)18,2007,650**58.0%**
Products (500 rows, 8 cols)15,6005,980**61.7%**

---

KV Performance (vs SQLite)

Methodology: SochDB vs SQLite under similar durability settings (WAL mode, synchronous=NORMAL). Results on Apple M-series hardware, 100k records.
DatabaseModeInsert RateNotes
**SQLite**File (WAL)~1.16M ops/secIndustry standard
**SochDB**Embedded (WAL)~760k ops/secGroup commit disabled
**SochDB**put_raw~1.30M ops/secDirect storage layer
**SochDB**insert_row_slice~1.29M ops/secZero-allocation API

---

Run Rust benchmarks (SochDB vs SQLite)

cargo run -p benchmarks --release ```

Note: Performance varies by workload. SochDB excels in LLM context assembly scenarios (token-efficient output, vector search, context budget management). SQLite remains the gold standard for general-purpose relational workloads.

---

🎯 aiskill88 AI 点评 A 级 2026-06-27

SochDB是一个高性能的向量数据库,适合AI应用场景

⚡ 核心功能

👥 适合人群

Claude Desktop / Claude Code 用户AI 工具开发者需要扩展 AI 能力的专业人士自动化工程师

🎯 使用场景

  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站

⚖️ 优点与不足

✅ 优点
  • +标准化 MCP 协议,生态互联性强
  • +与 Claude 官方生态无缝对接
  • +即插即用,配置简单快捷
⚠️ 不足
  • 依赖 Claude 客户端,非 Claude 用户无法使用
  • MCP 协议仍在持续演进,接口可能变更
  • 需要一定的配置步骤
⚠️ 使用须知

该工具使用 AGPL-3.0 协议,商用场景请仔细阅读协议条款,必要时咨询法律意见。

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

⚠️ AGPL 3.0 — 最严格的 Copyleft,网络服务端使用也需开源,SaaS 使用受限。

🔗 相关工具推荐

🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

SochDB是一个高性能嵌入式向量数据库
💡 AI Skill Hub 点评

经综合评估,SochDB 在MCP工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。

⬇️ 获取与下载
⬇ 下载源码(GPL)
⚠️ 本工具使用 AGPL-3.0 协议。您可以自由下载和使用,但衍生作品必须以相同协议开源,不可商业闭源。使用前请确认符合协议要求。
📚 深入学习 SochDB
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 sochdb
Topics mcpai-agentsdatabaseembeddingsrust
GitHub https://github.com/sochdb/sochdb
License AGPL-3.0
语言 Rust
🔗 原始来源
🐙 GitHub 仓库  https://github.com/sochdb/sochdb 🌐 官方网站  https://sochdb.dev

收录时间:2026-06-27 · 更新时间:2026-06-27 · License:AGPL-3.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。

📺 订阅 AI Skill Hub Daily Telegram 频道
每天 8 条精选 AI Skill、MCP、Agent 与自动化工具推送
加入频道 →