mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-08-30 04:40:16 +00:00
- Migrate from mint.json to docs.json (Mintlify v4) - Theme: maple, emerald green + near-black dark / cream light palette (#059669 primary, #0A0A0A dark bg, #FAF7F0 light bg) - Typography: Lexend headings, Inter body - 5-tab navigation: Documentation, Quick Start, API Reference, Cookbook, FAQ - Homepage: removed badge stickers, redundant h2, added blockquote tagline, full 27-module reference table with semantica.mcp_server added - quickstart.md: CodeGroup per pipeline step, pattern vs LLM options, AccordionGroup for patterns and troubleshooting - faq.md: full AccordionGroup structure across 5 sections - reference/explorer.md: NEW — FastAPI explorer, Ontology Hub, Distance Intelligence, CLI reference, REST API endpoints - reference/mcp_server.md: NEW — MCP stdio server, 12 tools with I/O examples, 3 resources, Claude Desktop/VS Code/Windsurf/Cline config - docs.json: explorer added to Output group, mcp_server to Utilities group - Chat, feedback (thumbs/suggest/raise), OG/Twitter metadata, search topbar - All reference pages reformatted with Mintlify JSX components Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2.8 KiB
2.8 KiB
title, description, icon
| title | description | icon |
|---|---|---|
| Vector Store: High-Performance Usage | Parallel ingestion, batch processing, and performance tuning for the Semantica Vector Store. | bolt |
High-performance batch ingestion with parallel embedding generation — 3–10× faster than sequential processing.
Key Features
- Parallel ingestion — multi-threaded embedding generation and storage
- Batch processing — minimizes overhead by grouping documents into chunks
- Unified API —
add_documentshandles embedding generation and storage in one call
Quick Start: Parallel Ingestion
from semantica.vector_store import VectorStore
import time
store = VectorStore(backend="faiss", dimension=768)
documents = [f"This is document number {i} with some content." for i in range(1000)]
metadata = [{"source": "generated", "id": i} for i in range(1000)]
start = time.time()
ids = store.add_documents(
documents=documents,
metadata=metadata,
batch_size=64,
parallel=True, # default: True
)
print(f"Ingested {len(ids)} documents in {time.time() - start:.2f}s")
Performance Comparison
Old method (sequential loop) — slower due to per-item overhead:
for doc in documents:
emb = embedder.generate(doc)
store.store_vectors([emb], [{"text": doc}])
New method (parallel batching) — 3–10× faster:
store.add_documents(documents, parallel=True)
Configuration and Tuning
max_workers
Number of concurrent threads for embedding generation.
- Default: 6 (optimized for most systems)
- Override only if you have very high core counts or specific throughput needs
store = VectorStore(max_workers=16)
batch_size
Number of documents processed in a single chunk.
- Default: 32
- Local models: 32–64 works well
- API models (OpenAI, etc.): 100–200 reduces network latency overhead
store.add_documents(documents, batch_size=100)
Manual Batch Embedding
If you need embeddings without immediately storing them:
vectors = store.embed_batch(texts=documents[:100])
print(f"Generated {len(vectors)} vectors")