ワンクリックで
emdb-insert
// Insert vectors into EmergentDB using the SDK. Use when the user wants to store embeddings, index documents, or batch upload vectors into EmergentDB.
// Insert vectors into EmergentDB using the SDK. Use when the user wants to store embeddings, index documents, or batch upload vectors into EmergentDB.
| name | emdb-insert |
| description | Insert vectors into EmergentDB using the SDK. Use when the user wants to store embeddings, index documents, or batch upload vectors into EmergentDB. |
| allowed-tools | Bash, Read, Write, Edit |
Help the user insert vectors into EmergentDB using the official SDKs.
emdb_)import { EmergentDB } from "emergentdb";
const db = new EmergentDB("emdb_your_api_key");
// Single insert
const result = await db.insert(1, embedding, { title: "My doc" }, "production");
// result: { success: true, id: 1, namespace: "production", upserted: false }
// Batch insert (max 1000 per call)
const batch = await db.batchInsert([
{ id: 1, vector: [...], metadata: { title: "Doc 1" } },
{ id: 2, vector: [...], metadata: { title: "Doc 2" } },
], "production");
// Unlimited batch (auto-chunks into 1000s)
const all = await db.batchInsertAll(vectors, "production");
from emergentdb import EmergentDB
db = EmergentDB("emdb_your_api_key")
# Single insert
result = db.insert(1, embedding, metadata={"title": "My doc"}, namespace="production")
# Batch insert
result = db.batch_insert([
{"id": 1, "vector": [...], "metadata": {"title": "Doc 1"}},
{"id": 2, "vector": [...], "metadata": {"title": "Doc 2"}},
], namespace="production")
# Unlimited batch
result = db.batch_insert_all(vectors, namespace="production")
upserted: true."default". Created automatically on first use.title (str), content (str), source_url (str), tags (str[])batchInsert / batch_insert call. Use batchInsertAll / batch_insert_all for larger sets.| Code | Meaning |
|---|---|
| 400 | Invalid request — bad JSON, wrong vector dimension, missing field |
| 401 | Missing or invalid API key |
| 402 | Vector capacity exceeded — upgrade plan |
| 429 | Rate limit exceeded — back off and retry |
| 500 | Server error — retry with backoff |
| Plan | Limit |
|---|---|
| Free | 60 req/min |
| Launch | 300 req/min |
| Scale | 600 req/min |
import openai
from emergentdb import EmergentDB
client = openai.OpenAI()
db = EmergentDB("emdb_your_key")
# Generate + store
resp = client.embeddings.create(model="text-embedding-3-small", input="My document text")
db.insert(1, resp.data[0].embedding, metadata={"title": "My document"})
When helping the user, determine which SDK they prefer and guide them through the insert flow. If they have raw text, suggest using OpenAI or another embedding model first.
View EmergentDB analytics and usage stats. Use when the user wants to check API usage, latency, errors, growth, or per-key stats.
Delete vectors from EmergentDB by ID. Use when the user wants to remove vectors, clean up data, or delete entries from the database.
List and manage namespaces in EmergentDB. Use when the user wants to see their namespaces, organize vectors into groups, or understand namespace isolation.
Search for similar vectors in EmergentDB. Use when the user wants to query, find similar documents, or do semantic search against their vector database.