# OriginChainDB SQL, vector search, graph relationships and full-text search in one database. Applications use the documented interfaces and coordinate source records and search indexes. - [Documentation](https://originchaindb.com/docs) - [Product](https://originchaindb.com/product) - [Pricing](https://originchaindb.com/pricing) - [Engineering articles](https://blogs.originchaindb.com/) - [Current full website text](https://originchaindb.com/llms-full.txt) Use current documentation for API behavior and pricing for current offers. Dated release notes describe their publication dates. Examples and preview screenshots are not customer deployment evidence. Cite the canonical page URL. --- ## OriginChainDB — The distributed multimodal database Canonical source: https://originchaindb.com/ Distributed multimodal database One database. Four data models. SQL, vector, graph, and full-text search. One engine for your next application. Start free See how it works Start free / Scale with dedicated resources SQLStructured records VectorSemantic similarity GraphConnected context Full-textPrecise retrieval One engine four data models Four data models under one roof Why OriginChainDB? The same records you search can also help you recommend an item or investigate suspicious activity. Your team can build all three features in one database. Knowledge search Find documents by exact words or meaning. ↗ Recommendations Suggest related items that are in stock. ↗ Fraud investigation Trace accounts that share a device. ↗ Explore the architecture ↗ Sample catalog record Canal Rolltop bag/042 Try a query SQL Vector Graph Full-text Filter for bags under $100 and in stock. This one qualifies at $89. Search for “rainy commute.” The waterproof shell makes this bag a match. Follow the bag’s accessory link to find a compatible bike clip. Search for “rolltop.” The word appears in this bag’s name. SQL What’s in stock? Find laptop chargers under $50 that are ready to ship. Vector What did the shopper mean? A search for “power pack” can find a battery guide, even when the wording differs. Graph Which charger fits? Follow the links from a laptop model to chargers marked as compatible. Full-text Where does “reset” appear? Find the manuals that mention “reset” and open the matching passage. Prefer to ask in plain English? Query your tables with /ask. Explore natural-language queries ↗ Full-text + Vector Knowledge search Search for “power pack” and find the battery guide, even when the wording differs. Open the exact page behind the result. Explore search and RAG ↗ SQL + Vector Agent memory Let a support agent pick up where it left off. Recall what the customer asked and which fixes the team already tried. Explore agent memory ↗ Graph Dependency maps Before retiring a service, follow its connections to see which applications still depend on it. Explore graph queries ↗ SQL + Vector Personalized feeds A reader chooses photography. Find articles on related topics, then filter for their language and experience level. Explore personalization ↗ SQL Operations dashboards Give a warehouse team a view of orders awaiting shipment. Group them by location so the team can see where work is piling up. Explore operational analytics ↗ 04 / Deployment & operations Start with an idea. Build for production. Start free. Move to dedicated resources in your region. Your region. Dedicated compute. Optional warm standby.Asynchronous replication. Access controls. Daily snapshots.Configure for your dedicated instance. Explore deployment options ↗ Your application Primary engine OriginChainDB Warm standby Optional Asynchronous replication SQL · Vector · Graph · Full-text Replication guide ↗ Customer support Can this item be returned? Search the policy in the customer’s own words. Give the rep the return window and the passage they can share. Explore knowledge search ↗ Policy excerpt Returns § 2 Unopened items: within 30 days Fraud investigation Are these accounts connected? Follow a flagged order back to its device. See which other accounts used it before deciding what to investigate. Explore fraud investigation ↗ Shared device Device 04 Acct. A Acct. B Operations Which queue needs a hand? Group open tickets by queue and compare the counts. A team lead can see where to send the next available agent. Explore operational analytics ↗ Open tickets Billing 12 Setup 3 Architecture One record. Four ways in. See how tables, search indexes, and relationships point back to the same data. Read the architecture → Record SQLVectorGraphFull-text Benchmarks Compare the dataset, query mix, and hardware with the workload you expect to run. Read the benchmark methodology → Client compatibility Check which protocols and operations your existing database tools can use. Check supported protocols → What can I query in one database? Filter records with SQL, search by meaning with vectors, follow links with graph queries, or find exact words with full-text search. Each can lead back to the same record. Explore the database ↗ Who creates the indexes and embeddings? You choose which indexes to create. A table’s full-text index follows row writes. For vector search, supply embeddings yourself or schedule an embedder on a dedicated configuration. Read about embeddings ↗ Can I keep my existing client? Use the HTTP API, an SDK, or a supported adapter. Check the operations your app relies on before switching clients. See connection options ↗ How do I go from a trial to production? Start on the free tier. When you need dedicated resources, choose a region and configuration, then review access controls, snapshots, and standby options. Plan your deployment ↗ Release notes 19 October 2026 Read this release → Vectors · Dedicated configurations Search your tables in plain language Find rows by meaning, even when the wording differs. Schedule updates to include new rows in searches. ↗ Database · Every configuration Connect rows in existing tables Add a relationship to link the rows you already have. The links stay current as records change. ↗ Vezual · Console, Beta Build dashboards with Vezual Open Vezual under Plugins in the console to build dashboards and share live pages. ↗ Sample ticket #184 “I can’t sign in after the update.” Open SQL Is the issue still open? Filter by status to find open tickets like this one. Full-text Where does “update” appear? Find the exact word in the customer’s report. Vector Who else is locked out? Find similar reports, even when people describe the problem differently. Graph Which release is involved? Follow the ticket’s link to release 2.4. Talk to our team A multimodal database keeps an answer connected to its source. Search can find a passage in a manual. A graph can show which product it belongs to. --- ## Architecture: how the data connects | OriginChainDB Canonical source: https://originchaindb.com/architecture Architecture One engine. Clear paths to your data. Keep structured records, embeddings, relationships and searchable text in OriginChainDB. Choose the query path for each question, then use record IDs to bring the results together in your application. Start free Explore the quickstart Your applicationChoose a query OriginChainDBOne engine SQLFilter & summarize VectorMatch by similarity GraphFollow relationships Full-textMatch words & phrases ID Connected by record identityRetrieve the source. Build the response. Conceptual query paths. Your application coordinates the requests and combines results when needed. The query layer Different questions. Four ways to explore. Each interface works with a different representation. A shared record ID keeps a match connected to its source. 01 SQL Work with the facts. Filter fields, join related tables and summarize records through the supported SQL interface. Works with Structured rows Returns Fields, rows and aggregates 02 Vector Search by similarity. Use a saved embedder on dedicated configurations or supply your own vectors. Keep dimensions consistent; metadata filtering depends on the selected index. Works with Embeddings + metadata Returns Record IDs and distances 03 Graph Follow the connections. Declare relationships between records, then explore neighbours, paths and supported graph patterns. Works with Records + declared relations Returns Connected IDs, paths or records 04 Full-text Find the right words. Index selected text fields and retrieve matching documents. Use the available search modes for words, phrases and ranked results. Works with Searchable text Returns Document IDs and scores Supported queries and result shapes depend on the interface and configuration. Read the API reference for the exact request and response formats. The write path One identity. Clear responsibilities. Table indexes can follow your source rows. Choose configured embedding runs or explicit API writes for the other representations your application needs. See explicit API writes ID Reuse the record's identity across entries so a search result can lead back to the original fields. Define the source record. Register a schema, choose a primary key and save your rows. Configure table full-text indexes and declare the relationships you need; these follow row changes. Choose how to produce embeddings. On dedicated configurations, use a saved embedder and schedule runs for new or changed rows. Alternatively, generate vectors in your application and submit them through the vector API. Coordinate explicit index writes. If you supply vectors or use the separate document-index API, track those writes independently. Reconcile incomplete work and update or remove the explicit entries when their source changes. Table full-text indexes and declared graph relations are maintained with row changes. Configured embedding runs prepare vectors separately. Explicit row, vector and document-index API calls commit separately and require coordinated updates and retries. From matches to context Find the evidence. Keep the source in view. A retrieval workflow can use several query paths. Your application decides which results matter and how to present them. 01Query interfaces Find candidates Run vector and full-text searches for similar meaning and matching words. VectorFull-text 02Your application Combine matches Merge rankings and choose the record IDs relevant to the request. Ranked IDs 03Records & graph Retrieve context Fetch source fields by ID. Follow declared relationships when more context helps. RowsRelationships 04Your application Build the response Use the records in a search experience, a recommendation or an AI prompt. Source-backed context Vector hybrid search combines dense and sparse vectors. Combining vector results with full-text BM25 rankings is a separate application workflow. Build a retrieval workflow ? Prefer to ask in plain language? Ask AI translates supported requests into a query plan over the engine. Inspect the plan and use the returned results in your application. Explore Ask AI Deployment & recovery Understand the topology. Plan for recovery. Dedicated configurations run in your chosen region. Replication and backups serve different recovery needs. Your selected regionDedicated PrimaryOne active writer Accepts writes while holding the writer lease. Asynchronous replicationThe standby can trail the writer. Optional standbyA follower in the same region Replays changes received from the writer. Illustrative dedicated topology. Availability and replica configuration depend on your plan. 01 Know what a write confirms. Check endpoint-specific durability and replication behaviour. A successful response is not a guarantee that the standby has received the change. Write durability 02 Monitor before you promote. Track replication lag and follow the promotion procedure. An abrupt primary loss can leave recent writes missing from the standby; promotion is operator-driven by default. Deployment details 03 Practice restoring your data. Daily snapshots provide a separate recovery path on dedicated configurations. Check the current archive and point-in-time recovery limitations before setting recovery targets. Backup & restore Cross-region active-active replication is in development. Review topology and query limits when planning across nodes. Build with OriginChainDB Start with a record. Add the queries you need. Start free Explore the quickstart --- ## Benchmarks, test conditions and methodology | OriginChainDB Canonical source: https://originchaindb.com/benchmarks Benchmarks Performance. With the context. Explore published reads, writes and search results with the setup that produced them. Then test the workload your application actually needs. Plan an evaluation Explore the results Behind every resultTest plan 01 WorkloadData · queries · concurrency 02 EnvironmentCompute · region · limits 03 MeasurementNetwork path · test duration A result you can interpret. Speed, quality and the conditions behind both. Illustrative test plan. Published measurements appear below. Know what the clock includes. The published runs measure three different paths. An end-to-end HTTPS result and an in-process search timing answer different questions. 01 / Remote HTTPS From client to engine. YCSB and BEIR ran from an India-based laptop against a Mumbai reference engine. Reference engine2 vCPU · 2 GB Network round tripApproximately 100 ms IncludedHTTPS + network time 02 / In-region HTTPS Closer to the workload. A separate YCSB sweep used production configurations and a driver in the engine’s region. Configurations4 or 8 vCPU Client loadRecorded per run IncludedProvisioned rate limits 03 / In-process Inside the vector index. The ANN test measured HNSW search directly in a Rust release build on a development machine. ExecutionSingle thread · AVX2 NetworkNo HTTP request Measured togetherRecall + search timing The reference engine used substrate compression and a bounded memory guard. These runs describe the configurations tested; they do not establish an unthrottled engine ceiling or a service-level guarantee. Explore the published results. Open a report to inspect its configuration and measurements. Keep latency, throughput and retrieval quality in view together. 01Reads & writesYCSB · remote and in-region HTTPS Five operational workloads. A 20,000-row table with Zipfian access and 50,000 operations across workloads A, B, C, D and F. Remote HTTPS · reference engine · latency in milliseconds WorkloadOperation mixOps/secp50 (ms)p95 (ms)p99 (ms)Errors A 50% read / 50% update2921041432020 B 95% read / 5% update321921201580 C 100% read1461255571,2200 D 95% read latest / 5% insert338921191380 F Read-modify-write2151652252520 All five reported workloads recorded zero errors and no rate-limit hits. Workload E is not included in this dataset. The in-region sweep. Measured 11 June 2026 A separate run used the same YCSB driver in the engine’s region. Client concurrency and provisioned request limits are part of these results. In-region HTTPS · configured tenants · latency in milliseconds SetupOps/secp99 (ms)Run notes 4-vCPU node 1,046Not suppliedProvisioned limit of approximately 1,000 requests/sec. 8-vCPU node · one client 1,384117The report identifies the client driver as the limiting factor. 8-vCPU node · four clients 4,940173Read traffic; zero errors. Provisioned limit of approximately 5,000 requests/sec. The four-client result is read traffic. The report supplies no p99 measurement for the 4-vCPU run. Treat the stated limits as properties of these test setups. 02Vector retrievalANN-Benchmarks protocol · SIFT 100K · HNSW Recall at each search setting. 100,000 SIFT vectors with 128 dimensions, 1,000 queries, M=16 and ef_construction=200. Single-threaded AVX2, measured in process. SIFT 100K subset · HNSW · latency in microseconds ef_searchRecall@10Queries/secp50 (µs)p99 (µs) 10 0.286187.95,2088,170 20 0.115154.86,2799,685 50 0.232110.78,96611,313 100 0.37873.913,18319,852 200 0.56547.620,71826,153 400 0.76528.434,95243,987 800 0.91816.261,57076,478 Rows are retained as published, including the non-monotonic recall at ef_search 10 and 20. Pick the quality target first, then assess query rate and tail latency at that setting. What this run does not cover. The report identifies a Rust integration test, but does not supply its invocation or exact development-machine specification. It publishes no SIFT-1M or 100M-vector result. These HNSW measurements do not establish IVF or IVF-PQ performance. Review the index choices 03Full-text relevanceBEIR · SciFact · BM25 Relevance across the first ten results. The published SciFact run used English tokenisation and default Anserini BM25 parameters. NDCG@10 evaluates the ranking of relevant results. SciFact · one dataset from the BEIR suite DatasetDocumentsQueriesOriginChainDB NDCG@10Published BM25 NDCG@10Difference SciFact5,1833000.6620.665−0.003 The 0.665 reference comes from the BEIR paper, Table 2, rather than a side-by-side run on this hardware. This result does not cover the full BEIR suite. Reported indexing rate73 documents/sec Reported query rate67 queries/sec Measurement pathRemote HTTPS Explore BM25 search Source: OriginChainDB’s published benchmark report. These are reported runs, not current service telemetry. The measurements apply to the datasets and conditions shown. Make the next result relevant to you. A useful evaluation starts with a real workload and ends with enough detail to repeat the test. Define what success means. Choose your query mix, dataset size and expected concurrency. Set a latency target and, for retrieval, the quality level your application needs. Keep the conditions comparable. Record the engine version, CPU, memory, region, network path and provisioned limits. Keep index parameters, warm-up and test duration consistent. Save more than the average. Retain p50, p95 and p99 latency, error counts and raw logs. Report vector recall or text relevance alongside speed, then repeat the run. Evaluation checklist Keep the setup with the result. DataCorpus, query mix & relevance judgments RuntimeEngine version, hardware & network LoadConcurrency, duration & rate limits EvidenceConfiguration, raw logs & errors Discuss your evaluation Reproduction commands from the published report Run these in a checkout containing the benchmark harness, with the matching dataset and environment. The report lists these commands but does not link a standalone harness or raw-log download; request the matching materials when planning an evaluation. YCSB · five workloads python benchmarks/ycsb/run.py --record-count 20000 --op-count 10000 --workloads C,B,A,D,F BEIR · SciFact python benchmarks/beir/run.py --dataset scifact The ANN report does not include an executable test invocation. Confirm the exact test, build and machine before attempting to reproduce its timings. Build your evaluation. Connect the reported results to the configuration and query paths your team plans to use. Build with OriginChainDB Your workload is the real test. Plan an evaluation Explore the results --- ## Careers at OriginChainDB | Build database infrastructure Canonical source: https://originchaindb.com/careers Careers Build the foundations. Make them useful. Database engineering reaches from how a record is stored to how a developer finds an answer. Get to know the work behind OriginChainDB. Introduce yourself Current opportunities Engine, infrastructure and developer tools. Current opportunities No open roles listed right now. Future opportunities Interested in the work? Tell us what you enjoy building and share a project, portfolio or repository that helps us understand your experience. An introduction is an expression of interest, rather than an application to an advertised vacancy. Start a conversation Get to know the work From the engine to the everyday experience. Explore these parts of the product before you introduce yourself. These are areas of work, not advertised positions. 01 Database internals Explore how records, indexes and query interfaces fit together across SQL, vector, graph and full-text. Read the architecture 02 Infrastructure & operations Understand the deployment choices, access controls and recovery considerations around the engine. Explore deployment 03 Developer experience See how developers connect their tools, work with SDKs and explore data through the console. Explore the tools A useful introduction Start with something you’ve worked on. A concrete example makes it easier to understand your interests and how you approach a problem. How we handle personal information The problem What were you trying to build, fix or understand? Describe the constraints that shaped the work. Your contribution Explain the part you owned and one decision you made. A public link or short write-up is useful. What you want to explore next Tell us which part of database infrastructure or developer tooling interests you, and why. Build with OriginChainDB Show us what you like to build. Introduce yourself Current opportunities --- ## OriginChainDB release notes Canonical source: https://originchaindb.com/changelog ← Resources The release archive Earlier releases. Past product updates, kept with their original release dates. 13 published entriesDecember 2025 — July 2026Read the last archived entry ↓ These notes describe the listed releases. They do not identify the version currently running on your instance. For current availability and limits, use the current guides. New releases are published on the Releases page. This page keeps the versioned archive. Documentation update · 5 October 2026 Current guides Read the current guides for setup, migration, search and database connections. The Elasticsearch reference now describes dedicated deployment availability and the supported API subset, including scroll, Point-in-Time, extended statistics and index templates. Unknown URL parameters can be ignored; check supported options before relying on them. This date records the documentation update, not a new engine release or the first availability of every feature. The versioned archive below retains its original entries. Browse the current guides →Find tutorial help → A map of the archive Browse by version Published version and date sequenceOldest to newest · select a version to read its notes Dec 2025 v0.518↗ Jan 2026 v0.620↗ Feb 2026 v0.712↗ Mar 2026 v0.820↗ Apr 2026 v0.1022↗v0.1123↗v0.1230↗ May 2026 v1.001↗v1.002↗v1.0.102↗v1.103↗ Jun 2026 v1.208↗ Jul 2026 v1.306↗ About the tags featFeatures perfPerformance fixFixes docsDocumentation breakingBreaking changes Newest first Multi-node configurations reach GA - write throughput that scales with node count behind one endpoint, transactions that span nodes and commit atomically, point-in-time recovery to the roll-up window, and rate budgets that grow with your configuration. Release details5 notes+ feat Multi-node configurations are generally available. Pick a node count when you build your configuration: write throughput scales with nodes (~2x measured at 2 nodes), data distributes across nodes automatically table by table, and your application keeps talking to a single endpoint with a single key - no client-side routing, no code changes. Each node can optionally carry its own synchronized standby through the same resilience configurations as single-node. feat Atomic cross-node transactions. BEGIN / COMMIT / ROLLBACK over the SQL endpoint now spans tables on different nodes with the same all-or-nothing guarantee as a single node: every write in the transaction lands, or none do. ROLLBACK is idempotent and always safe to call; a lost transaction surfaces as a clean 409 with zero partial writes. See the new Transactions reference in the docs. feat Point-in-time recovery: restore an instance to a roll-up boundary, with integrity verification on the restored data before it serves traffic. Driven from the console or the API. The archive window that bounds how close to a chosen moment you can land is a server-side setting, not a measured recovery point. feat Rate budgets now scale with node count. Per-key budgets (requests/sec, bytes/sec, natural-language queries/sec, concurrent queries) multiply by the number of nodes in your configuration, and the full aggregate budget is delivered through the single endpoint. 429 responses now carry an X-OC-Limit-Hit header naming exactly which budget you exhausted. docs New docs pages: Transactions (lifecycle, error handling, the retry pattern) and Multi-node configurations (what you get, choosing a node count, growing later). The rate-limits reference is rewritten around the four per-key budgets - and why batch endpoints (~18x measured throughput vs single-row calls) are the first lever to pull. Link to this release ↗ Vectors scale past 10M per tenant, graphs learn embeddings, full-text reduces to canonical lemmas, and multi-writer cluster replication stays on the roadmap - active-passive remains the only replication mode any shipped engine serves. Release details12 notes+ feat IVF and IVF-PQ vector indexes land end-to-end. IVF partitions vectors by inverted-file cells for 10M+ scale per tenant; IVF-PQ adds residualised product quantization per cell (the Jegou 2011 path) for 64× memory savings at D=128 and 768× at D=1536 OpenAI ada-002 dims. The CI acceptance floor is recall@10 >= 0.75 at nprobe=4 on a small planted-cluster corpus. 1M IVF bulk-load in 80 s. feat Binary quantization (32× memory savings) and PQ quantization (64× at the headline config) attach to HNSW or IVF as separate index kinds. Pick the recall/memory tradeoff per-collection without rewriting your client code. feat GraphSAGE attribute-aware node embeddings ship with three aggregator choices: Mean (fastest), MaxPool (best representational capacity per parameter), and LSTM (sequence-aware, deterministic per-(node, layer) shuffle so retrains converge to the same vector). Pairs with Node2Vec persistence for downstream similarity search. feat Full-text lemmatization in 9 languages — English, Spanish, French, German, Italian, Portuguese, Russian, Dutch, Swedish — reduces inflected forms to a dictionary-backed canonical lemma. Higher precision than Snowball stemming on natural-language fields. Stemming for 18 languages remains available as a separate analyzer step. ICU + geo tokenizer ship alongside for mixed-script and location-aware queries. feat Cypher v3 closes: CALL subqueries, nested FOREACH, list comprehensions (row-time), MERGE, DELETE, CREATE relation, and multi-hop undirected matches. The DELETE / CREATE path lands first; MERGE follows the same idempotent contract you'd expect from a Cypher implementation. feat Materialized views with on-demand refresh: install_materialized_view computes the initial materialization, refresh_materialized_view re-runs the definition with an atomic overwrite. POST install / POST :name/refresh / GET :name. Incremental refresh stays on the roadmap. feat Foreign keys and CHECK constraints (Phase B). FK on-delete supports NoAction, Restrict, and SetNull at write-time; Cascade and SetDefault are deferred. CHECK expression language: literals, =/!=//>=, AND/OR/NOT, IS [NOT] NULL, IN — with 3-valued logic. feat JOIN cap raised from 5 to 32 tables. Left-deep planner; analytics rollups across a long dimension chain no longer hit the ceiling. feat Multi-writer (quorum) cluster replication is roadmap, not a shipped mode, and has no scheduled date. No shipped engine commits a write through consensus: a request to run a database in quorum mode is refused at config-install time rather than accepted and quietly degraded, and the consensus machinery runs only on engines explicitly configured for engineering drills. Active-passive replication is the supported mode and the default for every tenant. feat Serializable MVCC Phase B (preview): per-key version chains with !ts prefix-scan-from-newest give O(1) conflict detection at ~28-byte overhead per version. Range-serializability via gap locks is Phase C work. feat PostgreSQL ingest connector v1 (POST /v1/.../ingest/postgres/sync) pulls rows from an existing Postgres source into your OriginChainDB tenant — no separate ETL service needed. feat Python SDK adds typed namespaces: oc.sql, oc.vector, oc.fts, oc.graph. IDE autocomplete works against the shape you're actually using. Link to this release ↗ Transactional email, crash-injection in CI, shape-level diagnostics, and a fistful of dashboard fixes. Release details16 notes+ feat Forgot- and reset-password flow shipped end-to-end. Request a reset link from /forgot, set a new password from /reset-password - single-use, time-limited tokens delivered through our managed transactional email service. feat Magic-link login and password-reset emails now go through our managed transactional email service. Delivery is signed, DKIM-authenticated, and falls back to a journal log if the provider has a hiccup so you never lose access. feat Crash-injection harness lives in CI. Every commit crashes the engine at four critical durability boundaries twenty times each - recovered state must be a prefix of a known-good model. 4×20 = 80 green on every push. feat Optimiser landed on the hot path: cost-based shape routing now picks the cheapest plan from a small fixed menu instead of always taking the first match. No tuning knobs to learn. feat Synchronous-replica catch-up now uses an explicit sync state-machine - followers report replication delay in real time and the primary refuses to ack writes until the standby is caught up. feat Configuration-upgrade flow in the dashboard: change compute configuration from Single-zone → HA → HA+ without recreating the instance. Rolling resize, no downtime, prorated on the next bill. fix Billing math: monthly spend now includes only running instances. Stopped instances no longer accrue compute charges in the current-cycle estimate (storage still does, since data still lives on disk). fix Admin login: the auth-gate IIFE no longer fires on / or /magic-link, so the reload loop reported on a few accounts is structurally impossible. Login form is always interactive, even before boot-status comes back. fix Dashboard /app/backups: hoisted the tenant-ownership check out of an N+1 loop and translated AbortError into a friendly retry banner. List-backups no longer SIGNAL_ABORTED on instances with hundreds of backups. fix Console snapshot list now caches results for 30 s and the SDK times out at 60 s - slow snapshot directories no longer hang the page. fix Public docs: scrubbed a leaked tenant ULID and replaced with the acme.* placeholder used elsewhere. fix Crash-replay test corpus expanded - every persisted shape now has a deterministic replay test. perf Per-repo CI: each crate, each SDK, and the frontend run in their own pipeline. Builds that don't touch a target skip its tests entirely - typical PR feedback dropped from ~9 min to ~2 min. docs New blog post: "Crash at every durability boundary" - how the new crash-injection harness works and why it caught two real bugs the day it landed. docs New blog post: "One commit, every shape" - how multi-shape writes commit atomically as a single durable unit. docs New blog post: a deep-dive on how the cost-based optimiser picks shape routes. Link to this release ↗ Marketing surface, MCP server, and an OpenAPI 3.1 spec - built so AI agents and humans can both read OriginChainDB. Release details11 notes+ feat @originchain/mcp-server published - a Model Context Protocol server that exposes /rows, /query, /ask, /watch, and the add-on shapes to any MCP-aware client (Claude Desktop, Cursor, etc.). Drop in your bearer, point at your endpoint, you're live. feat OpenAPI 3.1 spec published at /openapi.json - every public HTTP endpoint, every schema, every error code. Generate clients in any language, or paste it straight into your editor's HTTP plugin. feat Eight head-to-head comparison pages: OriginChainDB vs Postgres, MongoDB, Neon, Supabase, Pinecone, Qdrant, Weaviate, and Milvus. Honest about where each tool wins and where ours does. feat Site-wide search via Pagefind. Hit the search input on any page, get instant results across docs, blogs, and marketing pages - fully static, no backend, works offline once cached. feat Real /status page wired to the same metrics the on-call dashboard reads. Per-region uptime, 30-day incident history, current SLO burn. feat Schema delete in the dashboard: drop a key shape from the console with a typed-confirmation guard. Backed by new DELETE endpoints (DELETE /v1/schemas/:name with cascade flag). feat Per-page Open Graph images: every marketing page renders a tailored OG card with its own title and category, so links look right on Slack, Twitter, LinkedIn, and Discord. feat Mobile hamburger navigation across the marketing site, with dark theme as the default. Light theme toggle still available. feat IndexNow ping on every deploy - search engines hear about new docs and blog posts within seconds of merge. feat Three new long-form engineering blog posts on storage internals, replication, and the new add-on architecture. fix Go SDK: corrected the module path to github.com/originchain-ai/originchain-go. `go get` and `go mod tidy` now resolve correctly. Link to this release ↗ Six new paid add-ons attach to any configuration - opt in only what your workload needs. A seventh, the multi-writer cluster, was announced here but has not shipped. The prices below are the ones announced that day and are no longer the offer: SQL Pro was folded into every paid configuration on 2026-06-03, and Vector Search, Full-Text Pro and Graph followed on 2026-09-02 - all four are now included at no extra charge. MVCC Transactions and Intra-Segment PITR are still priced add-ons. A configuration is priced as a whole today - see pricing for what applies now. Release details7 notes+ feat SQL Pro add-on ($49/mo): GROUP BY with COUNT/SUM/AVG/MIN/MAX, INNER + LEFT/RIGHT/FULL OUTER joins, HAVING filters, and chained 3+ table joins (left-deep, up to five tables). feat Vector Search add-on ($79/mo + $0.0002 per topk): HNSW with cosine, dot, L2 metrics and tunable speed/recall. Default high_recall mode hits recall@10 = 0.96 at 100k vectors with p99 109 ms; fast mode runs p99 37 ms at recall 0.69. Filtered topk via metadata equality, f32 SIMD distance kernels, deserialized graph cache. feat Full-Text Pro add-on ($49/mo): Lucene-default BM25 (k1=1.2, b=0.75), phrase queries via position-list intersection, UAX #29 Unicode tokenizer, and Snowball stemming for 18 languages. feat Graph add-on ($59/mo): forward and reverse one-hop neighbors (correct on self-relations), BFS up to a configurable max depth, path reachability, and weighted shortest path (Dijkstra) with caller-supplied weight functions. feat Transactions add-on ($99/mo): multi-row snapshot-isolation transactions with optimistic conflict detection - begin / get / put / delete / commit / abort across multiple rows. feat Intra-Segment PITR add-on ($149/mo): tighter point-in-time recovery via a continuous change stream with embedded microsecond timestamps. Preview - the archive window that bounds restore granularity is a server-side setting, not a measured recovery point. feat Multi-Writer Cluster add-on (Enterprise): announced here as a multi-node write cluster with TLS transport and durable persistence. It has not shipped. Quorum replication remains roadmap with no scheduled date, a request to run a database in that mode is refused at config-install time, and every database in service runs the active-passive path. Link to this release ↗ OriginChainDB reaches general availability - single-tenant, region-isolated, sub-100 ms in-region p99. Release details5 notes+ feat Single-tenant region-isolated compute live in Asia Pacific (Mumbai). Each instance gets a dedicated instance, durable transaction logging, and an HTTPS endpoint provisioned in about two minutes. feat Standby replication on every paid configuration. A write is acknowledged once it is flushed to durable storage on the primary; frames stream to the standby continuously, asynchronously. feat Three compute configurations (Single-zone, HA, HA+) and four storage configurations (20 GB to 2 TB). Resize compute and storage independently, hot, with no downtime. feat Console-driven bearer rotation with a 60-second grace window for rolling deploys. perf p99 read latency under 8 ms in-region on HA and HA+; cached /ask responses return in under 50 ms. Link to this release ↗ Promoted-follower failover verified end-to-end on live infrastructure. Release details4 notes+ feat Snapshot-bootstrap: a new follower can join a running primary without operator intervention, receiving a consistent snapshot before tailing live frames. feat Failover preserves full state - promoted follower serves reads and writes immediately on takeover. perf Promotion is operator-triggered by default. An opt-in automatic promotion path also exists: it is off by default, a standby takes the writer role only once the writer lease has expired, an external restart hook completes the switch, and a standby that is not fully caught up refuses to promote. perf Active-passive replication remains the production path. Promotion is fenced by a single-primary claim; because replication is asynchronous, an abrupt primary loss can still cost the most recent acknowledged writes. Link to this release ↗ Engine, managed console, and Razorpay billing go live. Release details4 notes+ feat Managed console: signup, region selection, configuration selection, instance provisioning, metrics and audit log access. feat Razorpay billing integration: USD pricing, monthly and annual cycles, prorated mid-cycle changes, hosted card capture at instance create. feat Encrypted nightly backups with daily integrity checks; continuous-archive point-in-time recovery on every paid configuration. feat Python SDK - fully typed, sync and async, with helpers for /rows, /query, /ask, /watch, /sql, /vector, /fts, /graph. Link to this release ↗ Natural-language compile path runs fully in-region with no API key in the customer's path. Release details4 notes+ feat Every /ask call compiles in the same region as the tenant's instance. Credentials are scoped per instance and handled for you - no LLM API keys anywhere in the customer's stack. feat Schema prompt caching: repeated /ask calls with the same catalog pay the cached-read rate (~90% discount on repeated catalog tokens). feat Per-instance scope locked to a single model identifier - no other foundation models, no cross-tenant access. perf Shared runtime + per-region inference client cache; SDK startup cost is paid once per process, not per /ask. Link to this release ↗ Hot-path concurrency, atomic backups, chaos and load harnesses. Release details5 notes+ feat MVCC-lite on hot-path writes - conflicting updates serialize per row without blocking reads. feat oc backup create / oc backup restore - atomic at the filesystem level, with daily integrity checks. feat Chaos and load harnesses run on every build (process kill, disk full, interrupted-write recovery; 10k rps steady-state). feat HTTP body limit enforced at 8 MiB; rate limiter is a real token bucket with Retry-After headers. perf Concurrent-read path reworked to remove a hot-index bottleneck - p50 reads down ~18%. Link to this release ↗ Live views over Server-Sent Events; durable plan cache. Release details3 notes+ feat New /v1/watch endpoint - Server-Sent Events stream of updates for a live expression. Same protocol across every region and configuration. feat Plan cache spills to disk; cold start reloads hot plans without re-invoking the LLM. perf Catalog lookup is lock-free; consult cost dropped to ~12 µs. Link to this release ↗ Single managed engine replaces the multi-engine split. Release details3 notes+ breaking Storage consolidated onto a single managed engine - one recovery path, one backup path, one mental model. Earlier multi-engine split removed. breaking Parquet, Arrow, DataFusion, and KuzuDB dependencies dropped. feat Plans compile down to index, ref-walk, and range-scan primitives on the unified store. Cost-based routing retired - no routing to do. Link to this release ↗ Initial public release. Release details2 notes+ feat HTTP ingress, row-keyed store, and the natural-language to query-plan compiler land for the first time. docs Specification document published; HTTP API documented. Link to this release ↗ Keep up with the changes Get release updates. Request release updates by email, or use the docs to explore a feature. Subscribe by email ↗Open the documentation ↗ --- ## OriginChainDB community | Discuss, learn & contribute Canonical source: https://originchaindb.com/community Community Bring a question. Build the conversation. Find people, code and practical guidance around OriginChainDB. Choose a place to ask, learn or share what you are building. Visit the forum Explore the community Questions, examples and useful conversations. Find your place A few useful places. Different ways to take part. Go straight to the discussion, repository or channel you need. These links lead to our existing community destinations. Discuss Developer forum Ask implementation questions, compare approaches and share what you are building. Visit the forum Explore code GitHub Explore published repositories and SDKs. Check each project’s README for setup, issue reporting and contribution guidance. Explore repositories Watch YouTube Find the current video collection and follow walkthroughs at your own pace. Watch on YouTube Follow LinkedIn Follow the official OriginChainDB company page for product and company updates. Follow OriginChainDB Prefer a guided starting point? Browse the tutorials or use the documentation to look up a specific operation. Browse tutorials Read the docs Make a useful contribution Start small. Make it easy to follow. A clear question or practical example gives the next person something to work with. 01 Ask a clear question Describe the result you expected, what happened instead, and the query or SDK you used. Include a small example that others can follow. Ask the community 02 Share what you learned Post a useful query pattern, integration note or project walkthrough. Explain the choices you made and what someone else could reuse. Share your work 03 Improve a published project Find the relevant repository and read its contribution guidance before opening an issue or proposing a change. Find a repository Find the right help Some questions need a direct conversation. For account-specific help or a private report, contact the team directly. Keep credentials and customer information out of public posts. Technical support Share an error, request ID and a small, sanitized reproduction. Security disclosure Find the private reporting route and disclosure guidance. Product & project questions Talk through a workload, evaluation or deployment. Build with OriginChainDB Your next question can start a conversation. Visit the forum Explore the community --- ## About OriginChainDB | Our story and founders Canonical source: https://originchaindb.com/company Company The people behind OriginChainDB. We’re a Bengaluru-based team building a multimodal database. Our work connects database engineering with the everyday experience of building applications. Talk to our team Meet the founders Engineering the database.Building the tools around it. Why we started Applications need their data in context. An application may need to look up a record, search a passage and follow a relationship in the same workflow. Keeping that context usable is the problem we work on. The OriginChainDB project began in late 2024. We are building a Rust-based database engine alongside the APIs, console and developer tools needed to use it. Our aim is straightforward: give developers one database product for structured queries, similarity search, relationships and text, with clear documentation of how each interface works. Read the architecture Project startedLate 2024 Based inBengaluru, India Database engineBuilt in Rust Our founders Meet Bharath and Zaheer. Get in touch BKS Co-Founder Bharath Kumar S Bharath is a co-founder of OriginChain, the team behind OriginChainDB. The company builds a multimodal database for structured records, search and connected data. Connect on LinkedIn ZK Co-Founder & Chief Commercial Officer Zaheer Kazi Zaheer leads commercial operations, revenue and customer success. He brings more than three decades of enterprise technology experience, including roles at Hewlett-Packard, DXC Technology and Sun Microsystems. Connect on LinkedIn Our progress From the first build to a public product. A few milestones from the project’s history. See recent releases Late 2024 Work starts on a database that brings records, retrieval and relationships into one product. 18 Dec 2025 Version 0.5 is published in the release archive. Release notes 01 May 2026 The general availability announcement is published. Release notes 04 Jun 2026 OriginChain announces its membership in the NVIDIA Inception program. Announcement Security programs & memberships Review the company you are building with. Security information Information security ISO/IEC 27001 In progress Controls assessment SOC 2 Type II In progress Industry memberships Part of the NVIDIA Inception program and the AI Council of India at IAMAI. Work with us There’s more than one way to get involved. Careers Help build the product See our current hiring status and introduce yourself. Community Build alongside other developers Ask questions, share what you are making and find technical resources. Contact Talk through your application Reach the team for a technical evaluation, support or a security question. Legal entitySilicoyn Technologies Pvt Ltd The operator of OriginChainDB and the entity on our agreements. Build with OriginChainDB Have a project in mind? Talk to our team Meet the founders --- ## Contact OriginChainDB | Sales, support & security Canonical source: https://originchaindb.com/contact Contact Talk to the team behind the database. Planning an application, connecting a tool or reviewing a deployment? Reach the team that can help with the next step. Fill out the form Contact us directly Tell us what you need. A few details to start the conversation. Full name Work email Company (optional) How can we help?Sales & technical evaluationTechnical supportSecurity enquiryCareer introductionGeneral enquiry Your message What are you building, and where could we help? We’ll use these details to respond to your enquiry. Privacy policy Opens your email app with your message filled in. Review and send it there. Enable JavaScript to send your message, or email info@originchaindb.com directly. Open email draft again No email app? Copy your messageYour email draft Three direct routes Choose the right contact. Reach us directly for a project discussion, a technical question or a private security report. Career introductions Tell us what you would like to work on. There are no open roles listed at the moment. You can introduce yourself with a short note about your interests and links to work you would like us to see. Write your introduction Plan a project Sales & technical evaluation Talk through your application, query patterns, deployment options and evaluation plan. sales@originchaindb.com Compare plans Get help building Technical support Share the error, request ID and a minimal reproduction so the team can understand the issue. support@originchaindb.com Browse documentation Report privately Security team Report a potential vulnerability directly. Request a PGP key before sharing sensitive details. security@originchaindb.com Disclosure guidance For support and security reports, omit passwords, tokens and customer records. Start with a minimal, sanitized example. Planning your first conversation Tell us what you are working on. You don’t need a finished architecture. A short description of the problem and the data is enough to start a useful discussion. Describe your workload Just getting started? You can explore the product and documentation before choosing a deployment. Explore the database 01 What should your app do? The question it needs to answer or the workflow you want to improve. For example: Find the right policy and its source. 02 What data will it use? The data models, approximate size, update frequency and current tools. For example: Records, documents and their relationships. 03 What does success look like? Your evaluation criteria, preferred region, timeline and security needs. For example: Relevant results with permission checks. Keep moving Before we talk. Find the technical details, available configurations and security information that help you prepare. Connect Use your existing tools. Explore SQL clients, SDKs and MCP integration. Plan Review the configuration. Compare capacity and hourly price equivalents. Evaluate Bring your security team. Review controls and request assessment information. Looking into an availability issue? View published status Build with OriginChainDB Start with the problem you want to solve. Fill out the form Contact us directly --- ## Example application workloads | OriginChainDB Canonical source: https://originchaindb.com/customers Example workloads See where the database fits. Search documents, suggest items or investigate connections. See how each uses the database. Explore the examples Evaluate your own workload Three applications, different questions Illustrative application patterns Three example applications. These are example workloads, not customer case studies. 01 / Knowledge search Find an answer and its source. Vector · Full-text · SQL Search by meaning or exact words. Filter the results and keep source IDs to open the original document. Set-up check. Set up embeddings and search indexes. Test relevance and permissions. Explore search and RAG 02 / Recommendations Suggest a relevant item. Vector · Graph · SQL Find similar items, check related records and filter for availability. Your app combines the results. Set-up check. Check that suggestions are useful, current and allowed for the user. Explore recommendations 03 / Fraud investigation Follow the connections behind an alert. Graph · SQL · Full-text Follow links between accounts, devices and transactions. Add matching records and notes for a reviewer. Set-up check. Keep the source records and a human review. A connection alone does not prove fraud. Explore investigations Your workload is the test Try a pattern with your own data. Choose one task, add representative records and measure the result. Understand the database SQL, vector, graph and full-text capabilities in one engine. Explore industry scenarios See how data requirements change with the application. Plan a focused pilot Agree on data, queries and evidence before a wider move. Build with OriginChainDB Test the pattern with your own data. Explore the examples Evaluate your own workload --- ## OriginChainDB documentation | OriginChainDB docs Canonical source: https://originchaindb.com/docs OriginChainDB documentation Start with a database, add a few records and run a query. Then use SQL to filter rows, vector search to find similar content, graph queries to follow relationships, or full-text search to find words. Each guide explains the setup and the result you should expect. How your application uses OriginChainDB Your applicationSend a query OriginChainDBChoose a query model SQLFilter records VectorFind similar content GraphFollow relationships Full-textMatch words Each model has its own setup. The guides below show what to prepare and how to query it. Start here Create your first database Set up an account and find your connection details. Run your first query Create a table, add a record and get a result with SQL. API reference Find endpoints, request fields and code examples. Connect an application Choose a client library or use the HTTP API. A practical route through the documentationStart with a small working example, then open the reference for the feature you need. 01 Get a working connectionCreate an instance or use an existing one. 02 Save a few known recordsFollow the quickstart with data you can verify. 03 Choose the query modelUse values, meaning, words or relationships to guide your choice. 04 Open the detailed referenceCheck request fields, permissions and limits before expanding. Choose the query your task needs Query modelWhat it helps you doRead next SQLFilter records, join tables and calculate totals.SQL guide VectorFind items with similar meaning using numerical representations called embeddings.Vector search GraphFollow relationships between records, such as a person and their accounts.Graph guide Full-textFind words and phrases in indexed text.Full-text search Each query model has its own setup and interface. Adding a table row does not automatically create every search index. Give the same record the same ID in each model so your application can connect its results. Build on what you know Eight SDKs are available on GitHub. Follow the setup instructions for the version you choose; new 1.0 source examples are not installed by the older npm and PyPI releases. Connect DBeaver, pgAdmin or another SQL client. Move existing PostgreSQL data. Check MCP availability for an AI client. Review authentication and permissions before connecting a shared application. If you are evaluating the product, start with choosing a query. If you are implementing it, follow the quickstart and then open the relevant API endpoint. Create a free account Create your account, verify your email and open the instance setup guide. --- ## Find answers in the docs | OriginChainDB docs Canonical source: https://originchaindb.com/docs/ai Find answers in the docs Use the search box to find a feature, error message or API route. The sidebar groups guides by task; the API reference lists request fields and examples. Find the guide for your taskDocumentation search finds instructions; Ask AI queries records in your database. 01 Search a taskUse a feature, error message or endpoint name. 02 Open the matching guideCheck its prerequisites and supported version. 03 Try the smallest exampleCompare the actual response with the expected result. Start with your task Create a database and run a query. Choose between SQL, vector, graph and full-text queries. Connect your application or a SQL client. Look up an endpoint when you know the operation you need. Troubleshoot an error when a request fails. Search for specific terms Search for an endpoint name, a request field, or the error text returned by the server. Open the matching guide and check its prerequisites before copying an example. For setup questions, start with the guide. For exact request and response fields, use the API reference. Features can differ by deployed engine version, so check your instance's capabilities when an option is unavailable. Ask a question about your database The Ask feature answers questions about database tables. It is separate from documentation search. Read that guide to learn how to choose tables, inspect the generated query and check the returned rows. Get help with a specific problem Contact the team with the page or endpoint, the operation you tried, the error message and a request ID if available. Remove tokens, passwords and private records before sharing an example. Natural-language use cases Previous Page Console overview Next Page --- ## API reference | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api API reference Find the request, fields and response examples for each OriginChainDB API operation. Use the API to store records, run queries and manage your database. Each endpoint page shows its purpose, required inputs and copyable request and response examples. Find the operation your application needsDatabase requests and organization-management requests use different credentials. 01 Choose the taskFind a record, query, search or management operation. 02 Read its contractCheck the method, address, required fields and credential. 03 Handle its resultUse the documented response and error guidance. Set up your connection Copy the database URL and credential from Connect. Make your first requests Create a sample table, write records and query them. Connection setup For application SQL, use POST $OC_URL/sql with Authorization: Bearer $OC_TOKEN. Copy OC_URL exactly from Connect; do not add or remove tenant segments. Access-token support depends on the deployment's reported Connect capability. Supported dedicated, non-raft, non-sharded configurations can use access tokens; other configurations still need the instance credential shown in Connect. The endpoint reference also documents explicit paths such as /v1/tenants/{tenant}/sql. Those examples use OC_BASE_URL and OC_TENANT for that contract. They are not instructions to reconstruct your Connect URL. Control-plane endpoints have separate credentials and connection details. Read an endpoint An endpoint is one operation at a specific URL. The method tells you how to call it; the input tables tell you what to supply. Input locationWhat you supply PathReplace placeholders such as {schema} with the target resource's identifier. QueryAdd options after ?, such as a result limit or cursor. HeadersSend the credential and any content type or version condition. BodySend the JSON, text or file described by that operation. Only fields marked Required must always be present. Optional fields can still become necessary for a particular mode; check the rules below the table. Check its method and path. Complete the prerequisites and fill in required inputs. Choose cURL, HTTP, JavaScript or Python. Replace the example values. Inspect the HTTP status and response body. Examples use sample data and do not run from this website. Use a development database for the quickstart writes. Check available features Read the capabilities endpoint before depending on an operation. Support can vary by engine build, configuration and permissions. Browse the reference Schemas Define a table before writing its records. Register a schema · List schemas · Start a schema migration Records Write, retrieve or delete ordinary table rows by primary key. Write a row · Write a batch · Retrieve a row SQL and transactions Run a SQL statement or keep related operations inside a transaction. Execute SQL · Begin a transaction · Create a materialized view Graph Follow relationships, find paths or analyze connected data. List neighbors · Find a path · Execute Cypher Vector Store embeddings and search by similarity. Vector-index records have their own namespace-based endpoints. Store a vector · Find nearest vectors · Insert vector-index records Full-text Index words, search documents and work with text results. Index a document · Search a text field · Aggregate results Users and permissions Create roles and users, assign grants and control which rows can be read. Create a role · Set a grant · Set a row policy Import and sync Copy data from files or a supported source into your database. Upload a file · PostgreSQL sync · MySQL sync · Object-storage import Jobs and maintenance Check background work and inspect database activity. Check a background job · Read query metrics · Read usage and limits Audit Read, verify or export the tenant's audit history. Read audit entries · Verify the log · Export the log Vector index management Manage vector indexes and their namespaces separately from SQL table schemas. Create an index · Create a namespace · Read index counts Control plane Manage project vector indexes, embedding models and embedding credits with the control-plane credential. List projects · List embedding models · Create embeddings Retry carefully A failed connection does not prove a write failed. Check the database state and the endpoint's retry behavior before sending it again. An idempotency key only helps where that operation supports it. Response errors Use the error guide to interpret status codes, and review request limits when handling throttling. Existing limits still apply. Elasticsearch compatibility For the compatible adapter, use the Elasticsearch guide and check its supported operations before moving an integration. OpenAPI specifications Database API specification Control-plane API specification Use these files for complete schemas and generated clients. Use the sidebar to open an individual endpoint. API quickstart Create a sample table, write three rows and query them through the explicit database HTTP API. --- ## API authentication | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/authentication API authentication Use the URL and credential supplied by Connect, and distinguish application access from explicit endpoint and control-plane requests. Start in your instance's Connect panel. Copy its database URL and the credential offered for that deployment. From Connect to an authenticated queryKeep the database address exactly as Connect supplies it. 01 Copy the connectionTake the database URL and credential from Connect. 02 Configure your applicationStore the connection values in your server environment. 03 Check SQL accessRun a small read query with the bearer credential. Application SQL Use OC_URL exactly as supplied by Connect. It is an opaque database address: do not build it from an instance name or add or remove tenant segments. Send SQL to $OC_URL/sql with the bearer credential in OC_TOKEN. Bind values through params instead of inserting them into the SQL string. export OC_URL="" export OC_TOKEN="" curl --include --request POST "$OC_URL/sql" \ --header "Authorization: Bearer $OC_TOKEN" \ --header "Content-Type: application/json" \ --data '{"sql":"SELECT $1 AS value","params":[1]}' The query should return one row with value equal to 1; it creates no table and changes no data. A successful response checks this SQL connection, not permission to every table. Access tokens are supported on dedicated, non-raft, non-sharded configurations that report token support. Other configurations still require the instance credential shown in Connect. Check the reported capability; there has been no blanket cutoff of instance keys. Explicit database endpoint requests The endpoint reference retains paths such as /v1/tenants/{tenant}/schemas. Its examples use these separate values: VariableMeaning OC_BASE_URLDatabase origin for the explicit endpoint contract, without a trailing slash. OC_TENANTTenant ID for that endpoint. OC_TOKENDatabase bearer credential accepted by that deployment. Do not derive these values by trimming or editing OC_URL. Use the values provided for the explicit endpoint contract. Example: list schemas through the explicit endpoint export OC_BASE_URL="https://your-database-host" export OC_TENANT="your-tenant" export OC_TOKEN="" curl --include "$OC_BASE_URL/v1/tenants/$OC_TENANT/schemas" \ --header "Authorization: Bearer $OC_TOKEN" Database identity Some deployment policies also require an acting database user and key. Send the pair together when required. OC_DB_USER and OC_DB_KEY below are example environment-variable names; obtain the values from your database administrator. # Add both headers when your deployment requires database identity. curl --include "$OC_BASE_URL/v1/tenants/$OC_TENANT/schemas" \ --header "Authorization: Bearer $OC_TOKEN" \ --header "x-oc-db-user: $OC_DB_USER" \ --header "x-oc-db-key: $OC_DB_KEY" See roles and permissions for database access controls. Control-plane requests Managed embeddings and project vector indexes use an organization API key on the control-plane origin. Call these routes from your server; cross-origin browser requests are not supported. export OC_ORG_API_KEY="" curl --include "https://api.originchain.ai/v1/embeddings/catalog" \ --header "Authorization: Bearer $OC_ORG_API_KEY" Credentials and permissions Keep secrets in a server environment or secret manager. Personal-token access is limited by the owner's current role; organization tokens use their explicit grants and database-user binding. Token revocation and propagation to database engines are separate. A successful control-plane deletion is not proof that every database engine has already rejected that credential. PostgreSQL clients use a separate database username and password over TLS. They do not use OC_TOKEN as the password; the offered login capability remains read-only. See PostgreSQL connection setup. API quickstart Create a sample table, write three rows and query them through the explicit database HTTP API. API errors Read the HTTP status and response body, identify the cause, and decide what to fix before retrying. --- ## Configure vector index | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/control-plane/configure-vector-index Control plane Configure vector index Changes the deletion protection or the tags of a vector index. PATCH /v1/projects/{project_id}/vector-indexes/{index_name} Change an index's editable settingsDimensions and distance metric stay fixed. 01 Identify the project indexUse the project ID and existing index name. 02 Send the changed settingsSupply tags or deletion protection. 03 Check the configurationConfirm the response contains the intended settings. Before you start Use your organization API key on the control-plane origin. Connection setup Use the project ID and index name returned at creation. Dimension and metric cannot be changed. Path parameters FieldTypeRequired project_idstringRequired index_namestringRequired Request body application/json Limits and accepted values The JSON body is forwarded unchanged to the instance. At least one of deletion_protection (enabled|disabled) or tags is required (400 otherwise). Naming any other index field (name, dimension, metric, sparse, text_fields, visibility_fields, embedding, metadata_publish, identifier_profile, index_id, state, score_direction, compat_family, created_at) answers 400 immutable_field; any unknown key answers 400. A body that is not valid JSON answers 400 before the key is checked. FieldTypeRequiredDescription deletion_protectionstringOptional— tagsobjectOptionalMap of tag key (1-80 characters of A-Z, a-z, 0-9, _ and -) to tag value (at most 120 printable ASCII characters). Merged into the existing tags; an empty-string value removes that tag; more than 20 tags after the merge answers 400 and changes nothing. Read the result The response is the index's updated configuration. Check deletion_protection and tags; this operation cannot change the dimension or distance metric. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request PATCH "https://api.originchain.ai/v1/projects/%3CPROJECT_ID%3E/vector-indexes/demo-search" \ --header "Authorization: Bearer ${OC_ORG_API_KEY}" \ --header "Content-Type: application/json" \ --data-binary '{ "tags": { "environment": "docs" } }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error415 Error422 Error429 Error500 Error501 Error502 Error503 Error { "index_id": "22222222-2222-4222-8222-222222222222", "name": "demo-search", "state": "active", "dimension": 3, "metric": "cosine", "score_direction": "higher_is_better", "sparse": false, "text_fields": [], "visibility_fields": [], "embedding": null, "deletion_protection": "disabled", "tags": { "environment": "docs" }, "identifier_profile": "unicode", "compat_family": "vectors", "created_at": "2026-10-30T00:00:00.000Z", "project_id": "44444444-4444-4444-8444-444444444444" } { "error": { "message": "Invalid request: check the fields and values." } } Correct the request before retrying. { "error": { "message": "Missing or invalid bearer credential." } } Check the credential and Authorization header. { "error": { "message": "This operation requires available credits or feature access." } } Check feature access or available credits. { "error": { "message": "The credential does not have access to this operation." } } Check tenant access, roles and permissions. { "error": { "message": "The requested resource was not found." } } Check the resource ID and API route. { "error": { "message": "The request conflicts with the current resource state." } } Resolve the conflict before retrying. { "error": { "message": "The request Content-Type is not supported." } } Send the required Content-Type. { "error": { "message": "The supplied values cannot be processed." } } Correct the values or unsupported combination. { "error": { "message": "Too many requests. Retry after backing off." } } Honor Retry-After when present; back off. { "error": { "message": "The server could not complete the request." } } Check the outcome before retrying a write. { "error": { "message": "This operation is not supported by this deployment." } } Check deployment support for this operation. { "error": { "message": "An upstream service returned an invalid response." } } Check service availability and the write outcome. { "error": { "message": "The service is temporarily unavailable." } } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Export the audit log Export the tenant's full audit log as newline-delimited JSON, oldest first. Create embeddings Creates embedding vectors for the given input with the selected embedding model and debits the cost from your organization's embedding credits. --- ## Create embeddings | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/control-plane/create-embeddings Control plane Create embeddings Creates embedding vectors for the given input with the selected embedding model and debits the cost from your organization's embedding credits. POST /v1/embeddings Turn model input into embedding vectorsThis request consumes the organization's embedding credits. 01 Choose an available modelCheck its input types, dimensions and price. 02 Supply text or imagesSend the input items to the selected model. 03 Match vectors to inputsUse each returned index to recover input order. Before you start Use your organization API key on the control-plane origin. Connection setup Choose an available, priced model from the embedding catalog. Requests consume embedding credits. Request body application/json Limits and accepted values model must be a catalog id that is currently available and priced (otherwise 400 for an unknown or unavailable model, 403 for an unpriced one); a missing or non-string model is rejected with 422. input is declared optional for parsing but the route rejects an absent, null or empty-array input with 400: send a single item (a string, or an object with exactly one of text or image) or an array of items, up to the deployment's batch limit (400 above it). Any additional fields (for example input_type, query or document) are forwarded unchanged to the embedding service. FieldTypeRequired modelstringRequired inputany JSONRequired Read the result Each item in data contains an embedding and its input index. Match that index to your original input order. dim is the vector length; usage.total_tokens reports usage for the billed request. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 415Send the required Content-Type. 422Correct the values or unsupported combination. 500Check the outcome before retrying a write. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "https://api.originchain.ai/v1/embeddings" \ --header "Authorization: Bearer ${OC_ORG_API_KEY}" \ --header "Content-Type: application/json" \ --data-binary '{ "model": "", "input": [ "Trail mug with insulated steel" ] }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error415 Error422 Error500 Error502 Error503 Error { "object": "list", "model": "", "dim": 3, "data": [ { "object": "embedding", "index": 0, "embedding": [ 0.1, 0.2, 0.3 ] } ], "usage": { "total_tokens": 6 } } Shape illustration using a synthetic three-value vector; actual model dimensions, embedding values and billed tokens come from the selected model. { "error": { "message": "Invalid request: check the fields and values." } } Correct the request before retrying. { "error": { "message": "Missing or invalid bearer credential." } } Check the credential and Authorization header. { "error": { "message": "This operation requires available credits or feature access." } } Check feature access or available credits. { "error": { "message": "The credential does not have access to this operation." } } Check tenant access, roles and permissions. { "error": { "message": "The request Content-Type is not supported." } } Send the required Content-Type. { "error": { "message": "The supplied values cannot be processed." } } Correct the values or unsupported combination. { "error": { "message": "The server could not complete the request." } } Check the outcome before retrying a write. { "error": { "message": "An upstream service returned an invalid response." } } Check service availability and the write outcome. { "error": { "message": "The service is temporarily unavailable." } } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Configure vector index Changes the deletion protection or the tags of a vector index. Create vector index Creates a vector index in a project. --- ## Create vector index | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/control-plane/create-vector-index Control plane Create vector index Creates a vector index in a project. POST /v1/projects/{project_id}/vector-indexes Add a search index to a projectThe project must already have dedicated capacity and vector-search entitlement. 01 Choose an existing projectUse the project ID tied to your credential. 02 Define the search shapeSet dense dimensions and metric, sparse vectors or text fields. 03 Keep the index IDUse it for later record and search requests. Before you start Use your organization API key on the control-plane origin. Connection setup Use an existing dedicated project with vector-search entitlement. Creating an index does not provision new capacity. Path parameters FieldTypeRequired project_idstringRequired Request body application/json Limits and accepted values The JSON body is forwarded unchanged to the instance, which validates it; unknown keys are refused with 400. name: 1-45 characters of a-z, 0-9 and '-', starting and ending with a letter or digit, unique among the project's live indexes (409 otherwise). At least one of dimension (1-8192; above 8192 answers 402), sparse: true, or text_fields (at most 16) is required. metric (cosine|dot|l2|manhattan) is required with dimension and refused without it. visibility_fields: at most 16. deletion_protection: enabled|disabled (default disabled). identifier_profile: unicode|ascii (default unicode; frozen at creation; governs which characters namespace names may use). embedding (any non-null value answers 501) and metadata_publish (strict|immediate_when_not_embedding_input; answers 400) are recognised keys that are currently refused. Creating an index provisions no new capacity: it is added to the caller's existing dedicated instance, which holds at most 100 live indexes (402 beyond); the vector search add-on is required (402). FieldTypeRequired namestringRequired dimensionintegerOptional metricstringOptional sparsebooleanOptional text_fieldsobject[]Optional Fields in text_fields FieldTypeRequired namestringRequired analyzerstringRequired FieldTypeRequired visibility_fieldsstring[]Optional Fields in visibility_fields FieldTypeRequiredDescription visibility_fieldsstringOptionalA metadata key: 1-512 bytes, not starting with $ or _oc, unique within the list. FieldTypeRequiredDescription embeddingany JSONOptional— metadata_publishstringOptional— deletion_protectionstringOptional— tagsobjectOptionalMap of tag key (1-80 characters of A-Z, a-z, 0-9, _ and -) to tag value (at most 120 printable ASCII characters); at most 20 tags; an empty value is dropped. identifier_profilestringOptional— Read the result Save index_id for record and search requests. dimension, metric and state describe the created index. This adds an index to an existing dedicated project; it does not provision a database. Response statuses HTTP status reference StatusWhat to do 201Created 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "https://api.originchain.ai/v1/projects/%3CPROJECT_ID%3E/vector-indexes" \ --header "Authorization: Bearer ${OC_ORG_API_KEY}" \ --header "Content-Type: application/json" \ --data-binary '{ "name": "demo-search", "dimension": 3, "metric": "cosine" }' Response example Examples use synthetic values to show the response format. Response status201 Success400 Error401 Error402 Error403 Error404 Error409 Error415 Error422 Error429 Error500 Error501 Error502 Error503 Error { "index_id": "22222222-2222-4222-8222-222222222222", "name": "demo-search", "state": "active", "dimension": 3, "metric": "cosine", "score_direction": "higher_is_better", "sparse": false, "text_fields": [], "visibility_fields": [], "embedding": null, "deletion_protection": "disabled", "tags": {}, "identifier_profile": "unicode", "compat_family": "vectors", "created_at": "2026-10-30T00:00:00.000Z", "project_id": "44444444-4444-4444-8444-444444444444" } { "error": { "message": "Invalid request: check the fields and values." } } Correct the request before retrying. { "error": { "message": "Missing or invalid bearer credential." } } Check the credential and Authorization header. { "error": { "message": "This operation requires available credits or feature access." } } Check feature access or available credits. { "error": { "message": "The credential does not have access to this operation." } } Check tenant access, roles and permissions. { "error": { "message": "The requested resource was not found." } } Check the resource ID and API route. { "error": { "message": "The request conflicts with the current resource state." } } Resolve the conflict before retrying. { "error": { "message": "The request Content-Type is not supported." } } Send the required Content-Type. { "error": { "message": "The supplied values cannot be processed." } } Correct the values or unsupported combination. { "error": { "message": "Too many requests. Retry after backing off." } } Honor Retry-After when present; back off. { "error": { "message": "The server could not complete the request." } } Check the outcome before retrying a write. { "error": { "message": "This operation is not supported by this deployment." } } Check deployment support for this operation. { "error": { "message": "An upstream service returned an invalid response." } } Check service availability and the write outcome. { "error": { "message": "The service is temporarily unavailable." } } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Create embeddings Creates embedding vectors for the given input with the selected embedding model and debits the cost from your organization's embedding credits. Delete vector index Deletes a vector index and, in the background, all of its records. --- ## Delete vector index | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/control-plane/delete-vector-index Control plane Delete vector index Deletes a vector index and, in the background, all of its records. DELETE /v1/projects/{project_id}/vector-indexes/{index_name} Start removing a project indexA deleting state confirms the start, not the end, of background removal. 01 Check the targetIdentify the project and index to remove. 02 Request index deletionSend DELETE for that index. 03 Follow its stateRecords continue to be removed in the background. Before you start Use your organization API key on the control-plane origin. Connection setup Use the project and index you intend to inspect or change. Path parameters FieldTypeRequired project_idstringRequired index_namestringRequired Read the result A response with state: deleting means deletion has started. Record removal continues in the background; do not treat this response as confirmation that every record has already been erased. Response statuses HTTP status reference StatusWhat to do 202Accepted 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request DELETE "https://api.originchain.ai/v1/projects/your-project-id/vector-indexes/demo-index" \ --header "Authorization: Bearer ${OC_ORG_API_KEY}" Response example Examples use synthetic values to show the response format. Response status202 Success400 Error401 Error402 Error403 Error404 Error409 Error429 Error500 Error501 Error502 Error503 Error { "index_id": "22222222-2222-4222-8222-222222222222", "name": "demo-search", "state": "deleting", "dimension": 3, "metric": "cosine", "score_direction": "higher_is_better", "sparse": false, "text_fields": [], "visibility_fields": [], "embedding": null, "deletion_protection": "disabled", "tags": {}, "identifier_profile": "unicode", "compat_family": "vectors", "created_at": "2026-10-30T00:00:00.000Z", "project_id": "44444444-4444-4444-8444-444444444444" } { "error": { "message": "Invalid request: check the fields and values." } } Correct the request before retrying. { "error": { "message": "Missing or invalid bearer credential." } } Check the credential and Authorization header. { "error": { "message": "This operation requires available credits or feature access." } } Check feature access or available credits. { "error": { "message": "The credential does not have access to this operation." } } Check tenant access, roles and permissions. { "error": { "message": "The requested resource was not found." } } Check the resource ID and API route. { "error": { "message": "The request conflicts with the current resource state." } } Resolve the conflict before retrying. { "error": { "message": "Too many requests. Retry after backing off." } } Honor Retry-After when present; back off. { "error": { "message": "The server could not complete the request." } } Check the outcome before retrying a write. { "error": { "message": "This operation is not supported by this deployment." } } Check deployment support for this operation. { "error": { "message": "An upstream service returned an invalid response." } } Check service availability and the write outcome. { "error": { "message": "The service is temporarily unavailable." } } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Create vector index Creates a vector index in a project. Describe vector index Returns the configuration and state of one vector index, addressed by name or by index ID. --- ## Describe vector index | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/control-plane/describe-vector-index Control plane Describe vector index Returns the configuration and state of one vector index, addressed by name or by index ID. GET /v1/projects/{project_id}/vector-indexes/{index_name} Inspect a project's index before useConfiguration describes the index; it does not contain its records. 01 Select the project indexAddress the index by its name or ID. 02 Read its configurationInspect dimensions, metric and state. 03 Prepare matching inputsUse vectors compatible with that configuration. Before you start Use your organization API key on the control-plane origin. Connection setup Use the project and index you intend to inspect or change. Path parameters FieldTypeRequired project_idstringRequired index_namestringRequired Read the result Read state before using the index, and match new vectors to its dimension and metric. This returns configuration, not the records stored in the index. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "https://api.originchain.ai/v1/projects/your-project-id/vector-indexes/demo-index" \ --header "Authorization: Bearer ${OC_ORG_API_KEY}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error500 Error501 Error502 Error503 Error { "index_id": "22222222-2222-4222-8222-222222222222", "name": "demo-search", "state": "active", "dimension": 3, "metric": "cosine", "score_direction": "higher_is_better", "sparse": false, "text_fields": [], "visibility_fields": [], "embedding": null, "deletion_protection": "disabled", "tags": {}, "identifier_profile": "unicode", "compat_family": "vectors", "created_at": "2026-10-30T00:00:00.000Z", "project_id": "44444444-4444-4444-8444-444444444444" } { "error": { "message": "Invalid request: check the fields and values." } } Correct the request before retrying. { "error": { "message": "Missing or invalid bearer credential." } } Check the credential and Authorization header. { "error": { "message": "This operation requires available credits or feature access." } } Check feature access or available credits. { "error": { "message": "The credential does not have access to this operation." } } Check tenant access, roles and permissions. { "error": { "message": "The requested resource was not found." } } Check the resource ID and API route. { "error": { "message": "Too many requests. Retry after backing off." } } Honor Retry-After when present; back off. { "error": { "message": "The server could not complete the request." } } Check the outcome before retrying a write. { "error": { "message": "This operation is not supported by this deployment." } } Check deployment support for this operation. { "error": { "message": "An upstream service returned an invalid response." } } Check service availability and the write outcome. { "error": { "message": "The service is temporarily unavailable." } } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete vector index Deletes a vector index and, in the background, all of its records. Get embedding credits Returns your organization's embedding credit balance, its one-time trial grant and the number of tokens embedded this calendar month. --- ## Get embedding credits | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/control-plane/get-embedding-credits Control plane Get embedding credits Returns your organization's embedding credit balance, its one-time trial grant and the number of tokens embedded this calendar month. GET /v1/embed-credits Check the budget for embedding requestsOne million micro-US dollars equals one US dollar. 01 Identify your organizationUse its control-plane API key. 02 Read the balanceCheck remaining credit and the trial grant. 03 Compare monthly usageToken usage is separate from the remaining credit balance. Before you start Use your organization API key on the control-plane origin. Connection setup Read the result balance_micro_usd is the remaining balance in millionths of a US dollar; 1,000,000 equals US$1. month_tokens is usage for the calendar month, not the remaining balance. Response statuses HTTP status reference StatusWhat to do 200OK 401Check the credential and Authorization header. 403Check tenant access, roles and permissions. 500Check the outcome before retrying a write. Request example curl --include --request GET "https://api.originchain.ai/v1/embed-credits" \ --header "Authorization: Bearer ${OC_ORG_API_KEY}" Response example Examples use synthetic values to show the response format. Response status200 Success401 Error403 Error500 Error { "balance_micro_usd": 1000000, "trial_granted_micro_usd": null, "month_tokens": 0 } Illustrative balance, not pricing or a promised trial grant; one million micro-USD equals one USD. { "error": { "message": "Missing or invalid bearer credential." } } Check the credential and Authorization header. { "error": { "message": "The credential does not have access to this operation." } } Check tenant access, roles and permissions. { "error": { "message": "The server could not complete the request." } } Check the outcome before retrying a write. Download the OpenAPI specification for the complete response schemas. Describe vector index Returns the configuration and state of one vector index, addressed by name or by index ID. List embedding credit history Lists your organization's 200 most recent embedding credit ledger entries, newest first. --- ## List embedding credit history | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/control-plane/list-embedding-credit-history Control plane List embedding credit history Lists your organization's 200 most recent embedding credit ledger entries, newest first. GET /v1/embed-credits/history Trace recent embedding-credit changesThe response contains at most 200 entries, newest first. 01 Request the credit ledgerUse the organization's control-plane credential. 02 Read recent entriesReview changes in reverse chronological order. 03 Reconcile the activityCompare entries with the organization's embedding use. Before you start Use your organization API key on the control-plane origin. Connection setup Read the result Read entries from newest to oldest. The response covers at most 200 ledger entries, so it is recent activity rather than a complete account export. Response statuses HTTP status reference StatusWhat to do 200OK 401Check the credential and Authorization header. 403Check tenant access, roles and permissions. 500Check the outcome before retrying a write. Request example curl --include --request GET "https://api.originchain.ai/v1/embed-credits/history" \ --header "Authorization: Bearer ${OC_ORG_API_KEY}" Response example Examples use synthetic values to show the response format. Response status200 Success401 Error403 Error500 Error { "entries": [] } { "error": { "message": "Missing or invalid bearer credential." } } Check the credential and Authorization header. { "error": { "message": "The credential does not have access to this operation." } } Check tenant access, roles and permissions. { "error": { "message": "The server could not complete the request." } } Check the outcome before retrying a write. Download the OpenAPI specification for the complete response schemas. Get embedding credits Returns your organization's embedding credit balance, its one-time trial grant and the number of tokens embedded this calendar month. List embedding models Lists the embedding models offered to your organization, with each model's dimensions, supported input types, availability and price. --- ## List embedding models | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/control-plane/list-embedding-models Control plane List embedding models Lists the embedding models offered to your organization, with each model's dimensions, supported input types, availability and price. GET /v1/embeddings/catalog Choose a model before generating vectorsAn empty catalog offers no model to call. 01 Open the model catalogRead models available to your organization. 02 Compare model propertiesCheck accepted input, dimensions, availability and price. 03 Use the model IDInclude the chosen ID in the embedding request. Before you start Use your organization API key on the control-plane origin. Connection setup Read the result Choose a model that reports both availability and a price, then use its ID in the embedding request. Check dimensions and accepted input types before choosing a model. An empty models list offers no model to call. Response statuses HTTP status reference StatusWhat to do 200OK 401Check the credential and Authorization header. 403Check tenant access, roles and permissions. 500Check the outcome before retrying a write. Request example curl --include --request GET "https://api.originchain.ai/v1/embeddings/catalog" \ --header "Authorization: Bearer ${OC_ORG_API_KEY}" Response example Examples use synthetic values to show the response format. Response status200 Success401 Error403 Error500 Error { "embedder_reachable": true, "models": [] } A valid empty-catalog illustration. Query the actual catalog for purchasable model ids, dimensions, availability and prices; no model or price is invented here. { "error": { "message": "Missing or invalid bearer credential." } } Check the credential and Authorization header. { "error": { "message": "The credential does not have access to this operation." } } Check tenant access, roles and permissions. { "error": { "message": "The server could not complete the request." } } Check the outcome before retrying a write. Download the OpenAPI specification for the complete response schemas. List embedding credit history Lists your organization's 200 most recent embedding credit ledger entries, newest first. List projects Lists the project that the presented API key belongs to. --- ## List projects | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/control-plane/list-projects Control plane List projects Lists the project that the presented API key belongs to. GET /v1/projects Find the project your key can manageThis lists the key's project, not every project in the organization. 01 Present the API keyUse the organization-management connection. 02 Read its projectInspect the project returned for that key. 03 Keep the project IDUse the ID for project-level index operations. Before you start Use your organization API key on the control-plane origin. Connection setup Read the result Use the returned project id for project-level index operations. This lists the project bound to the presented API key; it is not a list of every project in the organization. Response statuses HTTP status reference StatusWhat to do 200OK 401Check the credential and Authorization header. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 500Check the outcome before retrying a write. 501Check deployment support for this operation. Request example curl --include --request GET "https://api.originchain.ai/v1/projects" \ --header "Authorization: Bearer ${OC_ORG_API_KEY}" Response example Examples use synthetic values to show the response format. Response status200 Success401 Error403 Error404 Error500 Error501 Error { "data": [ { "id": "44444444-4444-4444-8444-444444444444", "name": "Demo database", "host_token_state": "bound" } ] } { "error": { "message": "Missing or invalid bearer credential." } } Check the credential and Authorization header. { "error": { "message": "The credential does not have access to this operation." } } Check tenant access, roles and permissions. { "error": { "message": "The requested resource was not found." } } Check the resource ID and API route. { "error": { "message": "The server could not complete the request." } } Check the outcome before retrying a write. { "error": { "message": "This operation is not supported by this deployment." } } Check deployment support for this operation. Download the OpenAPI specification for the complete response schemas. List embedding models Lists the embedding models offered to your organization, with each model's dimensions, supported input types, availability and price. List project vector indexes Lists the vector indexes in a project, in ascending name order, one page at a time. --- ## List project vector indexes | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/control-plane/list-vector-indexes Control plane List project vector indexes Lists the vector indexes in a project, in ascending name order, one page at a time. GET /v1/projects/{project_id}/vector-indexes Browse a project's vector indexesA returned cursor means another page may be available. 01 Select the projectOptionally narrow index names by prefix. 02 Read one pageInspect index IDs, configurations and states. 03 Continue with the cursorKeep the same project and filters for the next page. Before you start Use your organization API key on the control-plane origin. Connection setup Use the project ID whose vector indexes you want to list. Path parameters FieldTypeRequired project_idstringRequired Query parameters FieldTypeRequired limitintegerOptional cursorstringOptional prefixstringOptional Read the result Each item in indexes contains the index ID, configuration and state. This operation returns one page; use a returned cursor for the next page rather than treating the first page as the complete inventory. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "https://api.originchain.ai/v1/projects/your-project-id/vector-indexes" \ --header "Authorization: Bearer ${OC_ORG_API_KEY}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error500 Error501 Error502 Error503 Error { "indexes": [ { "index_id": "22222222-2222-4222-8222-222222222222", "name": "demo-search", "state": "active", "dimension": 3, "metric": "cosine", "score_direction": "higher_is_better", "sparse": false, "text_fields": [], "visibility_fields": [], "embedding": null, "deletion_protection": "disabled", "tags": {}, "identifier_profile": "unicode", "compat_family": "vectors", "created_at": "2026-10-30T00:00:00.000Z", "project_id": "44444444-4444-4444-8444-444444444444" } ] } { "error": { "message": "Invalid request: check the fields and values." } } Correct the request before retrying. { "error": { "message": "Missing or invalid bearer credential." } } Check the credential and Authorization header. { "error": { "message": "This operation requires available credits or feature access." } } Check feature access or available credits. { "error": { "message": "The credential does not have access to this operation." } } Check tenant access, roles and permissions. { "error": { "message": "The requested resource was not found." } } Check the resource ID and API route. { "error": { "message": "Too many requests. Retry after backing off." } } Honor Retry-After when present; back off. { "error": { "message": "The server could not complete the request." } } Check the outcome before retrying a write. { "error": { "message": "This operation is not supported by this deployment." } } Check deployment support for this operation. { "error": { "message": "An upstream service returned an invalid response." } } Check service availability and the write outcome. { "error": { "message": "The service is temporarily unavailable." } } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List projects Lists the project that the presented API key belongs to. --- ## Export the audit log | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/audit-export Database endpoints Export the audit log Export the tenant's full audit log as newline-delimited JSON, oldest first. GET /v1/tenants/{tenant}/audit/export Download the complete audit trailEach line is a separate JSON entry, ordered oldest first. 01 Select the tenantRequest its full audit export. 02 Receive the NDJSON streamRead the response one line at a time. 03 Process each entryPreserve the sequence when archiving or analysing events. Before you start Use your database bearer token. Connection setup Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result The response is NDJSON: each line is a separate audit entry, ordered oldest first. Process it line by line rather than parsing the entire download as one JSON object. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/audit/export" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error503 Error {"seq":1,"at_unix":1793318400,"actor":"tenant","action":"user.create","target":"demo_user","detail":{"roles":["demo_reader"]},"prev_hash":"","hash":""} One JSON object per line, ascending by seq, with no trailing newline; the placeholder hash is not verifiable evidence. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Verify the audit log Check the audit log's hash chain and find the first damaged entry, if any. Configure vector index Changes the deletion protection or the tags of a vector index. --- ## Read the audit log | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/audit-list Database endpoints Read the audit log Read the newest entries in the tenant's tamper-evident audit log. GET /v1/tenants/{tenant}/audit Inspect the most recent audited actionsUse the export endpoint when you need the complete log. 01 Choose an entry limitAsk for the recent audit records you need. 02 Read actor and actionIdentify who acted and which target was affected. 03 Keep the sequence numberLocate each event within the audit chain. Before you start Use your database bearer token. Connection setup Path parameters FieldTypeRequired tenantstringRequired Query parameters FieldTypeRequired limitintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result entries contains recent audit records. Use actor, action and target to understand an event; seq identifies its place in the chain. Use the export endpoint when you need the full log. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/audit?limit=20" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error503 Error { "entries": [ { "seq": 1, "at_unix": 1793318400, "actor": "tenant", "action": "user.create", "target": "demo_user", "detail": { "roles": [ "demo_reader" ] }, "prev_hash": "", "hash": "" } ] } Illustrative metadata and actor; the opaque hash placeholder is not a cryptographically verifiable chain. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Cancel a background job Stop a filtered update or delete job. Changes already applied are not rolled back. Verify the audit log Check the audit log's hash chain and find the first damaged entry, if any. --- ## Verify the audit log | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/audit-verify Database endpoints Verify the audit log Check the audit log's hash chain and find the first damaged entry, if any. GET /v1/tenants/{tenant}/audit/verify Check whether the audit chain is intactIntegrity does not determine whether an action was appropriate. 01 Select the audit logUse the tenant whose chain needs checking. 02 Verify linked hashesCheck the log's recorded sequence for damage. 03 Inspect the outcomeIf broken, read the first damaged sequence and detail. Before you start Use your database bearer token. Connection setup Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result ok: true means this check found an intact hash chain. If it is false, inspect first_broken_seq and detail. Chain integrity does not itself tell you whether an audited action was authorized or appropriate. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/audit/verify" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error503 Error { "ok": true, "entries": 3, "first_broken_seq": null, "detail": "Chain intact" } Illustrative integrity result; a broken chain can also return HTTP 200 with ok:false. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Read the audit log Read the newest entries in the tenant's tamper-evident audit log. Export the audit log Export the tenant's full audit log as newline-delimited JSON, oldest first. --- ## Cancel a background job | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/cancel-job Database endpoints Cancel a background job Stop a filtered update or delete job. Changes already applied are not rolled back. POST /v1/tenants/{tenant}/vector-indexes/{index}/jobs/{job_id}/cancel Stop remaining work in a background jobCancellation does not undo changes already applied. 01 Locate the running jobUse the ID from the filtered update or delete. 02 Request cancellationA 202 response acknowledges the request. 03 Recheck job progressInspect its final state and work already completed. Before you start Use your database bearer token. Connection setup Use the job ID returned by a filtered vector-record update or delete. Cancelling does not undo completed work. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired job_idstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result The 202 response acknowledges the cancellation request and has no documented response body. Check the job afterward. Cancellation does not undo changes that the job already applied. Response statuses HTTP status reference StatusWhat to do 202Accepted 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/jobs/%3CJOB_ID%3E/cancel" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status202 Success400 Error401 Error402 Error403 Error404 Error409 Error429 Error500 Error501 Error503 Error HTTP/1.1 202 No response body specified by the contract. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Check a background job Check the state and progress of a filtered vector-record update or delete job. Read the audit log Read the newest entries in the tenant's tamper-evident audit log. --- ## Retrieve capabilities | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/capabilities Database endpoints Retrieve capabilities Check which features, indexes, SQL operations and wire protocols this engine reports as supported. GET /v1/capabilities Check what this engine supportsReported support does not grant access or provision a connection listener. 01 Contact the engineRequest its capability report. 02 Inspect the relevant sectionFind the query, index or protocol your application needs. 03 Check access separatelyConfirm credentials and deployment configuration before use. Before you start No bearer credential declared by the contract. Connection setup Read the result Use the capability sections to decide which operations this engine supports. The presence of a capability does not grant permission or provision a listener; check your connection and access separately. Response statuses HTTP status reference StatusWhat to do 200OK Request example curl --include --request GET "${OC_BASE_URL}/v1/capabilities" Response example Examples use synthetic values to show the response format. Response status200 Success { "engine_version": "your-engine-version", "es_aggregations": {}, "fts_lemmatizers": {}, "fts_tokenizer_kinds": {}, "geo_index_kinds": {}, "graph_embedding_aggregators": {}, "graph_embedding_algos": {}, "index_kinds": {}, "index_residency": {}, "kernel": {}, "mssql_tds_dialect": {}, "mysql_wire_dialect": {}, "postgres_wire": {}, "quantization": {}, "replication_modes": {}, "row_optimistic_concurrency": {}, "search_execution_limits": {}, "sql_constraint_kinds": {}, "sql_cte": {}, "sql_insert_on_conflict": {}, "sql_isolation_levels": {}, "sql_joins": {}, "sql_materialized_view_refresh_modes": {}, "sql_oracle_compat": {}, "sql_procedure_languages": {}, "sql_statement_complexity": {}, "sql_trigger_kinds": {}, "sql_udf_languages": {}, "sql_window_functions": {}, "topology": {} } Shape only: each empty object stands for deployment-specific fields. Call this endpoint to read the actual capability values. Download the OpenAPI specification for the complete response schemas. Retrieve engine version Returns the engine's version, build stamps and storage health. Read usage and limits Returns the tenant's configuration, limits and live usage counters. --- ## Update a vector index | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/configure-index Database endpoints Update a vector index Change a vector index's tags or deletion protection. PATCH /v1/tenants/{tenant}/vector-indexes/{index} Update tags or deletion protectionTags merge; an empty-string value removes that tag. 01 Select an existing indexUse its name or ID in this tenant. 02 Supply editable settingsChange tags or the deletion-protection flag. 03 Review the saved settingsDimensions and metric are unchanged. Before you start Use your database bearer token. Connection setup Use the existing index's name or ID. Only tags and deletion protection can change; dimension and metric stay fixed. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values At least one field is required. deletion_protection: enabled|disabled. tags merge into the existing tags and an empty-string value removes a tag; at most 20 after the merge. Naming any other index field answers 400 immutable_field. FieldTypeRequired deletion_protectionstringOptional tagsobjectOptional Read the result The response shows the updated index configuration. Tags are merged; an empty-string tag value removes that tag. Changing tags or deletion protection does not change the index's dimensions or metric. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request PATCH "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "tags": { "environment": "docs" } }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "index_id": "22222222-2222-4222-8222-222222222222", "name": "demo-search", "state": "active", "dimension": 3, "metric": "cosine", "score_direction": "higher_is_better", "sparse": false, "text_fields": [], "visibility_fields": [], "embedding": null, "deletion_protection": "disabled", "tags": { "environment": "docs" }, "identifier_profile": "unicode", "compat_family": "vectors", "created_at": "2026-10-30T00:00:00.000Z" } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Read a vector index Returns the configuration of a vector index, addressed by its id or name. Search an index Search a vector namespace with dense, sparse, lexical or hybrid ranking and an optional metadata filter. --- ## Set namespace capacity | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/configure-namespace Database endpoints Set namespace capacity Set or remove the record-capacity declaration for a vector namespace. POST /v1/tenants/{tenant}/vector-indexes/{index}/namespaces/configure Declare a namespace's record capacityRemoving this declaration does not make the database unlimited. 01 Select the namespaceLocate it inside its vector index. 02 Set or remove capacitySend a positive declaration, or null to remove it. 03 Read the saved declarationA value below current usage is rejected. Before you start Use your database bearer token. Connection setup Use an existing namespace. A declared capacity cannot be smaller than its current usage. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values declared_capacity must be sent: an integer 1-9007199254740991 sets it, null removes it, absent answers 400. A value below current usage answers 409. dry_run: true is refused with 400. Naming another namespace field answers 400 immutable_field. FieldTypeRequired declared_capacityintegerOptional dry_runbooleanOptional namestringRequired Read the result Check declared_capacity in the returned namespace. A number sets the declaration and null removes it. This value is not a statement that the database has unlimited capacity. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/namespaces/configure" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "name": "demo", "declared_capacity": 2000 }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "name": "demo", "namespace_id": "33333333-3333-4333-8333-333333333333", "state": "active", "record_count": 2, "pending_records": 0, "pending_new_records": 0, "dense_ids": 2, "sparse_ids": 0, "declared_capacity": 2000, "position": { "domain": "wal", "value": "1042:0" } } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Read a vector namespace Returns a namespace of a vector index with its record counts. Delete a vector namespace Deletes a namespace and erases its records in the background. --- ## Count vector records | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/count Database endpoints Count vector records Count records in a vector namespace, with an optional metadata filter. Counts are exact. POST /v1/tenants/{tenant}/vector-indexes/{index}/records/count Count the records matching your filterCounts are exact; an over-budget request fails instead of estimating. 01 Choose the namespaceOptionally supply one metadata filter. 02 Evaluate matching recordsCount records within that namespace. 03 Read the countUse the returned number for the selected scope. Before you start Use your database bearer token. Connection setup Use the target vector index and, where required, its namespace. The examples use index demo-search and namespace demo. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values filter_expr is the native filter expression and filter the legacy metadata filter; send at most one. An empty filter counts every record. Counts are never approximate: a filtered count over its budget is refused (413/422). FieldTypeRequired filterobjectOptional filter_exprobjectOptional namespacestringRequired Read the result count is the exact number of records matching the namespace and optional filter. A rejected over-budget count is an error, not an approximate answer. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/records/count" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "namespace": "demo" }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "namespace": "demo", "count": 2 } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List vector record IDs Read a page of vector record IDs in byte order, optionally restricted to a prefix. Update vector records Change one vector record by ID, or update matching metadata in a background job. --- ## Create a vector index | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/create-index Database endpoints Create a vector index Create a vector index for dense vectors, sparse vectors or text, with an empty default namespace. POST /v1/tenants/{tenant}/vector-indexes Define a vector index before loading recordsCreating the index starts an empty default namespace. 01 Choose the representationsDefine dense vectors, sparse vectors or searchable text. 02 Create the indexSet its name and supported configuration. 03 Save the index IDAdd records through the record endpoints next. Before you start Use your database bearer token. Connection setup Choose a unique index name and the dimensions or text configuration your data needs. The example creates demo-search for three-dimensional vectors. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values name is 1-45 bytes of [a-z0-9-]. At least one of dimension, sparse: true or text_fields is required; dimension 1-8192 needs metric (cosine, dot, l2, manhattan). deletion_protection: enabled|disabled (default disabled); identifier_profile: unicode|ascii (default unicode); tags: string map, at most 20. embedding is refused with 501 and metadata_publish with 400 (generated-embedding indexes are not available yet). Unknown fields are refused with 400 unknown_request_field. FieldTypeRequired deletion_protectionstringOptional dimensionintegerOptional embeddingobjectOptional identifier_profilestringOptional metadata_publishstringOptional metricstringOptional namestringRequired sparsebooleanOptional tagsobjectOptional text_fieldsobject[]Optional Fields in text_fields FieldTypeRequired analyzerstringRequired namestringRequired FieldTypeRequired visibility_fieldsstring[]Optional Fields in visibility_fields FieldTypeRequired visibility_fieldsstringOptional Read the result Save index_id; the search route uses it. The response records the fixed dimensions and metric, and the index starts with an empty default namespace. Creating an index does not insert vectors. Response statuses HTTP status reference StatusWhat to do 201Created 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "name": "demo-search", "dimension": 3, "metric": "cosine", "deletion_protection": "disabled" }' Response example Examples use synthetic values to show the response format. Response status201 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "index_id": "22222222-2222-4222-8222-222222222222", "name": "demo-search", "state": "active", "dimension": 3, "metric": "cosine", "score_direction": "higher_is_better", "sparse": false, "text_fields": [], "visibility_fields": [], "embedding": null, "deletion_protection": "disabled", "tags": {}, "identifier_profile": "unicode", "compat_family": "vectors", "created_at": "2026-10-30T00:00:00.000Z" } { "error": { "code": "unknown_request_field", "message": "Unrecognized field in request.", "status": 400, "retryable": false } } Illustrative message; code and envelope follow the documented vector-index contract. Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete vectors in bulk Delete up to 10,000 vectors and report which IDs were deleted or not found. List vector indexes Read the vector indexes visible to the caller, in name order. --- ## Build an IVF-PQ index | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/create-ivf-pq-index Database endpoints Build an IVF-PQ index Train a compressed IVF-PQ index from the vectors already stored in a table. POST /v1/tenants/{tenant}/vector/{table}/create-ivf-pq-index Compress an existing vector collectionDiscarding raw vectors is irreversible and affects later exact refinement. 01 Start with stored vectorsChoose the table and compression preset. 02 Train the compressed indexBuild the IVF-PQ representation from those vectors. 03 Check training and installationInspect whether raw vectors were retained. Before you start Use your database bearer token. Connection setup Provide enough compatible stored vectors to train the index. Three-value toy examples alone do not establish training readiness. Review drop_raw_vectors before discarding raw data. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values preset: high_recall | compressed. seed defaults to 0. drop_raw_vectors (default false) irreversibly discards the stored raw vectors table-wide, keeping only compressed codes; refused with 400 for the high_recall preset. FieldTypeRequired drop_raw_vectorsbooleanOptional presetstringRequired seedintegerOptional Read the result trained and installed report the training outcome. Check raw_vectors_retained before relying on exact refinement later. Setting drop_raw_vectors discards the original vectors irreversibly. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector/demo_vectors/create-ivf-pq-index" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "preset": "high_recall", "seed": 42, "drop_raw_vectors": false }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "trained": true, "installed": true, "preset": "high_recall", "partitions": 64, "pq_m": 1, "pq_bits": 8, "keep_raw": true, "raw_vectors_retained": true, "dim": 3, "training_corpus_size": 256 } Assumes a separate corpus of 256 compatible three-dimensional vectors, not the two-vector seed; preset resolution gives 64 partitions and one PQ subquantizer. Training and success remain illustrative. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Explain a vector search Run a vector search and inspect the search settings used for its results. Delete a vector Deletes one vector from a vector table by id; deleting an id that does not exist still succeeds with deleted set to false. --- ## Create a vector namespace | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/create-namespace Database endpoints Create a vector namespace Create a namespace inside a vector index and optionally declare its record capacity. POST /v1/tenants/{tenant}/vector-indexes/{index}/namespaces/create Separate records within a vector indexA new namespace initially contains no records. 01 Choose the indexSelect the parent vector index. 02 Name the namespaceOptionally declare its record capacity. 03 Keep its identifierUse the namespace name in record requests. Before you start Use your database bearer token. Connection setup Create the vector index first. The example adds demo to demo-search; __default__ is reserved. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values __default__ cannot be created (400 namespace_reserved). declared_capacity is 1-9007199254740991. FieldTypeRequired declared_capacityintegerOptional namestringRequired Read the result Save namespace_id and use the namespace name in record requests. Its initial record_count is zero. A declared capacity is a limit declaration, not inserted data. Response statuses HTTP status reference StatusWhat to do 201Created 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/namespaces/create" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "name": "demo", "declared_capacity": 1000 }' Response example Examples use synthetic values to show the response format. Response status201 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "name": "demo", "namespace_id": "33333333-3333-4333-8333-333333333333", "state": "active", "record_count": 0, "pending_records": 0, "pending_new_records": 0, "dense_ids": 0, "sparse_ids": 0, "declared_capacity": 1000, "position": { "domain": "wal", "value": "1042:0" } } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete a vector index Deletes a vector index; its namespaces are erased in the background. List vector namespaces Read a vector index's namespaces and record counts, one page at a time. --- ## Create role | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/create-role Database endpoints Create role Creates a database role, optionally inheriting the privileges of existing roles. POST /v1/tenants/{tenant}/db/roles Define reusable database permissionsCreating a role does not assign it to a user. 01 Choose a role nameSelect a new non-reserved name. 02 Set existing parent rolesInherit their privileges when needed. 03 Create the roleUse the returned name in grants and user assignments. Before you start Use your database bearer token. Connection setup Use an identity authorized to manage access. Create any inherited roles before referencing them. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values name must be non-empty, free of control characters, and not a reserved system role name (ll_admin, ll_system). Every role named in inherits must already exist, else 400. FieldTypeRequired inheritsstring[]Optional Fields in inherits FieldTypeRequired inheritsstringOptional FieldTypeRequired namestringRequired Read the result The response returns the role name. An inherited role contributes its permissions through the role relationship; creating a role does not assign it to a user. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/roles" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "name": "demo_reader" }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "name": "demo_reader" } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete user Deletes a database user and all of its credentials. List roles Lists the tenant's database roles, including the built-in system roles. --- ## Create user | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/create-user Database endpoints Create user Creates a database user that authenticates with either a password or a generated API key. POST /v1/tenants/{tenant}/db/users Create a database user's credentialsA database-user key is separate from an organization-management credential. 01 Choose the user's accessSelect its roles and authentication method. 02 Create the userSupply a password or request a generated API key. 03 Store the credential securelyCapture a returned API key without exposing it. Before you start Use your database bearer token. Connection setup Use an identity authorized to manage access. Create the roles you will assign, and store a returned API key securely. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values auth is one of: password, api_key. password is required (non-empty) when auth is password and must use the portable character set accepted by every wire protocol. roles defaults to []. An existing username is a 400. FieldTypeRequired authstringRequired passwordstringOptional rolesstring[]Optional Fields in roles FieldTypeRequired rolesstringOptional FieldTypeRequired usernamestringRequired Read the result For auth: api_key, capture the returned api_key securely. The assigned roles determine access. This database-user API key is not an organization-management credential or a promise that a PostgreSQL listener exists. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/users" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "username": "demo_user", "auth": "api_key", "roles": [ "demo_reader" ] }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "username": "demo_user", "api_key": "" } One-time credential placeholder; store the actual returned key securely. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Search by location Find locations inside a bounding box, within a radius, or nearest to a point. List users Lists the tenant's database users with their authentication method, roles and number of API keys. --- ## Execute Cypher | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/cypher-exec Database endpoints Execute Cypher Run an openCypher query and receive matching rows or write counts. POST /v1/tenants/{tenant}/cypher Run a graph pattern with CypherExplain previews read plans; it cannot explain a write here. 01 Prepare the patternSupply Cypher and named parameter values. 02 Execute the queryMatch graph patterns or apply the requested writes. 03 Read the result kindDistinguish returned rows from write counts. Before you start Use your database bearer token. Connection setup For this example, register and populate demo.people. default_schema resolves node patterns that do not name a label. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values default_schema (namespace.table) is used for node patterns without a label. params supplies $name values as scalars (string, number, bool or null). explain=true (default false) returns the plan a read would run without executing it, and is refused with 400 for a query that writes. FieldTypeRequired cypherstringRequired default_schemastringOptional explainbooleanOptional paramsobjectOptional Read the result Check kind to distinguish returned rows from a write result. params supplies named values such as $name. explain: true previews a read plan and cannot be used to explain a write on this endpoint. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/cypher" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "cypher": "MATCH (p) RETURN p.id LIMIT 5", "default_schema": "demo.people" }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error499 Error500 Error501 Error502 Error503 Error { "kind": "select", "rows": [ { "id": "u1" }, { "id": "u2" }, { "id": "u3" } ] } Illustrative projection labels; inspect the actual column names emitted for unaliased Cypher expressions. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete a document Removes a document from a table field's full-text index, including its stored text and facet values. List neighbors Returns the one-hop neighbours of a node along a relation. --- ## Delete vector records | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/delete Database endpoints Delete vector records Delete vector records by ID, by metadata filter, or across a whole namespace. POST /v1/tenants/{tenant}/vector-indexes/{index}/records/delete Remove selected vector records deliberatelyID deletion, filtered deletion and clearing a namespace have different outcomes. 01 Choose one deletion scopeUse IDs, a non-empty filter or all records. 02 Review the requestFor delete-all, confirmation must match the namespace. 03 Inspect counts or job progressA filtered job can continue in the background. Before you start Use your database bearer token. Connection setup Choose one selector: IDs, a metadata filter, or the whole namespace. The example deletes only v1. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values Three forms; exactly one of ids, a filter (filter_expr or filter, at most one) or all: true, otherwise 400 exactly_one_selector. By ids: ids holds 1-1,000 distinct ids of at most 1,024 bytes (dry_run: true refused with 400). By filter: an empty filter is refused (400 filter_empty_for_mutation); dry_run: true counts the matches and writes nothing; a filtered job deletes at most 1,000,000 records, then ends limit_reached; on a namespace holding more than 100,000 records it is refused 501 not_implemented (details.reason = delete_by_filter_namespace_too_large, a provisional bound). One running and 100 retained filtered jobs per namespace; beyond either, 429 job_limit_reached (retryable; details.bound, details.limit). A filtered job needs a key of at least 32 bytes (403 key_scope_insufficient). The job is read at GET .../jobs/{job_id} and stopped at POST .../jobs/{job_id}/cancel. Delete-all: all: true with confirm equal to namespace; dry_run: true returns the count without deleting. FieldTypeRequired allbooleanOptional confirmstringOptional dry_runbooleanOptional filterobjectOptional filter_exprobjectOptional idsstring[]Optional Fields in ids FieldTypeRequired idsstringOptional FieldTypeRequired namespacestringRequired Read the result By-ID results report deleted and missing counts. A filtered delete can instead start a job; track that job to learn how much work completed. For delete-all, confirm must match the namespace exactly. Response statuses HTTP status reference StatusWhat to do 200OK 202Accepted 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/records/delete" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "namespace": "demo", "ids": [ "v1" ] }' Response example Examples use synthetic values to show the response format. Response status200 Success202 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "deleted": 1, "missing": 0, "receipt": { "tenant": "your-tenant", "index_id": "22222222-2222-4222-8222-222222222222", "namespace_id": "33333333-3333-4333-8333-333333333333", "incarnation_id": "66666666-6666-4666-8666-666666666666", "restore_epoch": { "counter": 0, "nonce_prefix": "" }, "position": { "domain": "wal", "value": "1042:0" }, "durability_scope": "local_fsync", "records": [ { "id": "v1", "state": "durable" } ] } } { "job_id": "55555555-5555-4555-8555-555555555555", "receipt": { "tenant": "your-tenant", "index_id": "22222222-2222-4222-8222-222222222222", "namespace_id": "33333333-3333-4333-8333-333333333333", "incarnation_id": "66666666-6666-4666-8666-666666666666", "restore_epoch": { "counter": 0, "nonce_prefix": "" }, "position": { "domain": "wal", "value": "1042:0" }, "durability_scope": "local_fsync", "records": [] } } 202 illustrates a filter-based mutation; the displayed id-based request returns 200 instead. { "error": { "code": "exactly_one_selector", "message": "Supply exactly one record selector.", "status": 400, "retryable": false } } Illustrative message; code and envelope follow the documented vector-index contract. Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": { "code": "job_limit_reached", "message": "The namespace has reached its concurrent job limit.", "status": 429, "retryable": true, "details": { "bound": "running", "limit": 1 } } } Illustrative message; code and envelope follow the documented vector-index contract. Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Update vector records Change one vector record by ID, or update matching metadata in a background job. Index a document Indexes the text of one document for full-text search on a table field. --- ## Delete a vector index | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/delete-index Database endpoints Delete a vector index Deletes a vector index; its namespaces are erased in the background. DELETE /v1/tenants/{tenant}/vector-indexes/{index} Remove an index and its namespacesNamespace data is erased in the background. 01 Verify the indexCheck its identity and deletion protection. 02 Request removalDelete the selected vector index. 03 Follow the deleting stateDo not treat acceptance as completed data removal. Before you start Use your database bearer token. Connection setup Disable deletion protection before deleting the intended index. Its namespace data is removed in the background. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result state: deleting means background removal has started, not that all namespace data has already gone. Deletion protection must be disabled before this request succeeds. Response statuses HTTP status reference StatusWhat to do 202Accepted 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request DELETE "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status202 Success400 Error401 Error402 Error403 Error404 Error409 Error429 Error500 Error501 Error503 Error { "index_id": "22222222-2222-4222-8222-222222222222", "name": "demo-search", "state": "deleting", "dimension": 3, "metric": "cosine", "score_direction": "higher_is_better", "sparse": false, "text_fields": [], "visibility_fields": [], "embedding": null, "deletion_protection": "disabled", "tags": {}, "identifier_profile": "unicode", "compat_family": "vectors", "created_at": "2026-10-30T00:00:00.000Z" } Accepted deletion; inspect the index state before assuming reclamation completed. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Read vector index counts Read vector record counts for each namespace and the index as a whole. Create a vector namespace Create a namespace inside a vector index and optionally declare its record capacity. --- ## Delete a vector namespace | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/delete-namespace Database endpoints Delete a vector namespace Deletes a namespace and erases its records in the background. POST /v1/tenants/{tenant}/vector-indexes/{index}/namespaces/delete Remove a named vector namespaceThe reserved default namespace cannot be deleted this way. 01 Verify the namespaceCheck the parent index and exact namespace name. 02 Confirm that same nameSupply the matching confirmation value. 03 Follow background removalThe deleting state means erasure is underway. Before you start Use your database bearer token. Connection setup Set confirm to the exact namespace name. The reserved __default__ namespace cannot be deleted. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values confirm must equal name (400 otherwise). __default__ cannot be deleted; clear it with a delete-all instead. dry_run: true is refused with 400. FieldTypeRequired confirmstringOptional dry_runbooleanOptional namestringRequired Read the result state: deleting means the namespace is being removed in the background. Check the name and matching confirm value before sending; the reserved default namespace cannot be deleted this way. Response statuses HTTP status reference StatusWhat to do 202Accepted 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/namespaces/delete" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "name": "demo", "confirm": "demo" }' Response example Examples use synthetic values to show the response format. Response status202 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "namespace_id": "33333333-3333-4333-8333-333333333333", "state": "deleting", "receipt": { "tenant": "your-tenant", "index_id": "22222222-2222-4222-8222-222222222222", "namespace_id": "33333333-3333-4333-8333-333333333333", "incarnation_id": "66666666-6666-4666-8666-666666666666", "restore_epoch": { "counter": 0, "nonce_prefix": "" }, "position": { "domain": "wal", "value": "1042:0" }, "durability_scope": "local_fsync", "records": [] } } Accepted deletion; the receipt lists no individual records. { "error": { "code": "namespace_reserved", "message": "The default namespace cannot be deleted.", "status": 400, "retryable": false } } Illustrative message; code and envelope follow the documented vector-index contract. Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Set namespace capacity Set or remove the record-capacity declaration for a vector namespace. Insert or replace vector records Insert or replace up to 1,000 vector records. A missing namespace is created. --- ## Delete a row policy | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/delete-rls Database endpoints Delete a row policy Deletes the row-level security policy for a role on a table. DELETE /v1/tenants/{tenant}/db/rls Remove a role's row filterRemoving a filter can change which rows that role may read. 01 Identify the role and tableSelect the exact policy to remove. 02 Delete the row policyRemove its stored predicate. 03 Review resulting accessCheck remaining policies and grants for the role. Before you start Use your database bearer token. Connection setup Use an identity authorized to manage access in this tenant. Path parameters FieldTypeRequired tenantstringRequired Query parameters FieldTypeRequired tablestringRequired rolestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result deleted reports removal of this role's policy on the table. Removing a row filter can change what that role may read; review the role's grants and remaining policies separately. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request DELETE "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/rls?table=demo.people&role=demo_reader" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error429 Error500 Error501 Error503 Error { "deleted": true } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Check a user's row policies See which row policies apply to a user on a table, without running a query as that user. Import a CSV or NDJSON file Upload a CSV or NDJSON file and load its rows into an existing table. --- ## Delete role | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/delete-role Database endpoints Delete role Remove a database role. References from grants, policies, users or other roles prevent deletion unless cascade is requested. DELETE /v1/tenants/{tenant}/db/roles/{name} Remove a role after checking dependenciesCascade can also affect grants, memberships, inheritance and policies. 01 Review role referencesIdentify users, roles and policies that rely on it. 02 Choose deletion behaviorReferences block deletion unless cascade is requested. 03 Inspect affected dependenciesReview the returned deletion and cascade details. Before you start Use your database bearer token. Connection setup Use an identity authorized to manage access. Remove dependent grants, users and policies, or review the cascade option. Path parameters FieldTypeRequired tenantstringRequired namestringRequired Query parameters FieldTypeRequired cascadebooleanOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result deleted reports the role removal. When cascade is requested, the cascaded groups identify affected grants, members, inherited roles and policies. Review these dependencies before using cascade. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request DELETE "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/roles/demo_reader" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error429 Error500 Error501 Error503 Error { "deleted": true, "cascaded": { "grants": [], "inherited_by": [], "members": [], "rls_policies": [] } } Illustrates deletion after dependencies have been removed. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List roles Lists the tenant's database roles, including the built-in system roles. Set a role's permissions Set a role's permissions and optional column masks for a table or all tables. This replaces the role's existing grant on that object. --- ## Delete user | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/delete-user Database endpoints Delete user Deletes a database user and all of its credentials. DELETE /v1/tenants/{tenant}/db/users/{username} Remove a database user and credentialsThis does not remove an organization member. 01 Identify the database userCheck the username in the selected tenant. 02 Delete the userRemove the account and its database credentials. 03 Confirm the removalRead the returned deletion result. Before you start Use your database bearer token. Connection setup Use an identity authorized to manage access in this tenant. Path parameters FieldTypeRequired tenantstringRequired usernamestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result deleted reports that the database user and its credentials were removed. This is a database-user operation, not removal of an organization member. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request DELETE "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/users/demo_user" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error429 Error500 Error501 Error503 Error { "deleted": true } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Create another user API key Issue another API key for a database user. Existing keys remain valid. Create role Creates a database role, optionally inheriting the privileges of existing roles. --- ## Read a vector index | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/describe-index Database endpoints Read a vector index Returns the configuration of a vector index, addressed by its id or name. GET /v1/tenants/{tenant}/vector-indexes/{index} Match your vectors to the indexThis returns metadata rather than stored vector records. 01 Address the vector indexUse its ID or name. 02 Read shape and stateCheck dimensions, distance metric and availability state. 03 Prepare compatible recordsMatch subsequent vectors to the index configuration. Before you start Use your database bearer token. Connection setup Use the target vector index and, where required, its namespace. The examples use index demo-search and namespace demo. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Use dimension and metric when preparing vectors, and inspect state before sending work. The response is index metadata; use fetch or search endpoints for records. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error500 Error501 Error503 Error { "index_id": "22222222-2222-4222-8222-222222222222", "name": "demo-search", "state": "active", "dimension": 3, "metric": "cosine", "score_direction": "higher_is_better", "sparse": false, "text_fields": [], "visibility_fields": [], "embedding": null, "deletion_protection": "disabled", "tags": {}, "identifier_profile": "unicode", "compat_family": "vectors", "created_at": "2026-10-30T00:00:00.000Z" } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List vector indexes Read the vector indexes visible to the caller, in name order. Update a vector index Change a vector index's tags or deletion protection. --- ## Check a background job | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/describe-job Database endpoints Check a background job Check the state and progress of a filtered vector-record update or delete job. GET /v1/tenants/{tenant}/vector-indexes/{index}/jobs/{job_id} Separate job progress from completed changesA stopped or limited job may have already changed records. 01 Use the returned job IDIdentify the filtered update or delete. 02 Inspect state and progressCompare examined, matched and applied work. 03 Decide whether to continueBase follow-up actions on the reported outcome. Before you start Use your database bearer token. Connection setup Use the job ID returned by a filtered vector-record update or delete on this index. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired job_idstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Check state together with progress. Examined or matched records are not the same as updated records. A stopped or limited job can have applied some changes already. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/jobs/%3CJOB_ID%3E" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error500 Error501 Error503 Error { "job_id": "55555555-5555-4555-8555-555555555555", "kind": "update_by_filter", "state": "succeeded", "namespace_id": "33333333-3333-4333-8333-333333333333", "incarnation_id": "66666666-6666-4666-8666-666666666666", "restore_epoch": { "counter": 0, "nonce_prefix": "" }, "created_at": "2026-10-30T00:00:00.000Z", "updated_at": "2026-10-30T00:00:00.000Z", "progress": { "examined": 2, "matched": 1, "updated": 1 } } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": { "code": "job_not_found", "message": "The job was not found.", "status": 404, "retryable": false } } Illustrative message; code and envelope follow the documented vector-index contract. Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Report client diagnostics Send an opted-in SDK's call diagnostics to the database's telemetry pipeline. Cancel a background job Stop a filtered update or delete job. Changes already applied are not rolled back. --- ## Read a vector namespace | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/describe-namespace Database endpoints Read a vector namespace Returns a namespace of a vector index with its record counts. POST /v1/tenants/{tenant}/vector-indexes/{index}/namespaces/describe Inspect one namespace's stored recordsPending counters and stored-record counts describe different states. 01 Select the index and namespaceUse the namespace's exact name. 02 Read its state and countersInspect record_count and pending work separately. 03 Interpret current usageDo not add unrelated counters into one total. Before you start Use your database bearer token. Connection setup Use the target vector index and, where required, its namespace. The examples use index demo-search and namespace demo. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values include_deleting: true needs manage on the index and currently answers 501. FieldTypeRequired include_deletingbooleanOptional namestringRequired Read the result record_count describes stored records, while pending counters describe work that is not yet in the same state. Do not add every counter together as though they were disjoint totals. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/namespaces/describe" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "name": "demo" }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "name": "demo", "namespace_id": "33333333-3333-4333-8333-333333333333", "state": "active", "record_count": 2, "pending_records": 0, "pending_new_records": 0, "dense_ids": 2, "sparse_ids": 0, "declared_capacity": 1000, "position": { "domain": "wal", "value": "1042:0" } } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List vector namespaces Read a vector index's namespaces and record counts, one page at a time. Set namespace capacity Set or remove the record-capacity declaration for a vector namespace. --- ## Fetch vector records | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/fetch Database endpoints Fetch vector records Read up to 1,000 vector records by ID from one namespace. POST /v1/tenants/{tenant}/vector-indexes/{index}/records/fetch Retrieve vector records by their IDsVector values and sparse data are included only when requested. 01 Choose namespace and IDsSupply the specific records you want to read. 02 Select returned fieldsRequest needed metadata, text or vector values. 03 Inspect records and missing IDsKeep revision tokens for conditional updates. Before you start Use your database bearer token. Connection setup Use the target vector index and, where required, its namespace. The examples use index demo-search and namespace demo. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values ids: 1-1,000 distinct ids. include_metadata defaults to true, the other include_* to false. metadata_fields (at most 64) narrows metadata and cannot be combined with include_metadata: false; text_fields at most 16. include_pending needs manage and currently answers 501. FieldTypeRequired idsstring[]Required Fields in ids FieldTypeRequired idsstringOptional FieldTypeRequired include_metadatabooleanOptional include_pendingbooleanOptional include_sparsebooleanOptional include_valuesbooleanOptional metadata_fieldsstring[]Optional Fields in metadata_fields FieldTypeRequired metadata_fieldsstringOptional FieldTypeRequired namespacestringRequired text_fieldsstring[]Optional Fields in text_fields FieldTypeRequired text_fieldsstringOptional Read the result records is keyed by record ID; missing lists requested IDs that were not found. Save a record's revision_token if you plan a conditional update. Values and sparse data are omitted unless requested. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/records/fetch" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "namespace": "demo", "ids": [ "v1", "v2" ], "include_values": true, "include_metadata": true }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "namespace": "demo", "records": { "v1": { "id": "v1", "rev": 1, "revision_token": "", "updated_at": "2026-10-30T00:00:00.000Z", "values": [ 0.1, 0.2, 0.3 ], "metadata": { "category": "outdoor" } }, "v2": { "id": "v2", "rev": 1, "revision_token": "", "updated_at": "2026-10-30T00:00:00.000Z", "values": [ 0.2, 0.1, 0.4 ], "metadata": { "category": "indoor" } } }, "missing": [], "receipt_position": { "domain": "wal", "value": "1042:0" } } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Insert or replace vector records Insert or replace up to 1,000 vector records. A missing namespace is created. Fetch records by filter Read a page of vector records that match a metadata filter. --- ## Fetch records by filter | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/fetch-by-filter Database endpoints Fetch records by filter Read a page of vector records that match a metadata filter. POST /v1/tenants/{tenant}/vector-indexes/{index}/records/fetch-by-filter Read matching vector records in pagesPages use read-committed data rather than one frozen snapshot. 01 Set the metadata filterSelect the namespace and desired record fields. 02 Read the current pageInspect returned records keyed by ID. 03 Follow the returned cursorContinue with the same namespace and filter. Before you start Use your database bearer token. Connection setup Choose exactly one nonempty filter. Results contain the current committed records. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values Exactly one of filter_expr or filter is required and it must not be empty. limit 1-10,000, default 100. Projection fields as for fetch. consistency: read_committed (default); snapshot is refused with 400. FieldTypeRequired consistencystringOptional cursorstringOptional filterobjectOptional filter_exprobjectOptional include_metadatabooleanOptional include_sparsebooleanOptional include_valuesbooleanOptional limitintegerOptional metadata_fieldsstring[]Optional Fields in metadata_fields FieldTypeRequired metadata_fieldsstringOptional FieldTypeRequired namespacestringRequired text_fieldsstring[]Optional Fields in text_fields FieldTypeRequired text_fieldsstringOptional Read the result records contains the current page of matching records, keyed by ID. Follow a returned cursor to continue. This is a read-committed view, not a frozen snapshot across pages. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/records/fetch-by-filter" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "namespace": "demo", "filter": { "category": "outdoor" }, "limit": 10, "include_metadata": true }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "namespace": "demo", "records": { "v1": { "id": "v1", "rev": 1, "revision_token": "", "updated_at": "2026-10-30T00:00:00.000Z", "metadata": { "category": "outdoor" } } } } Before the update fixture changes v1.category to camping; only outdoor records match. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Fetch vector records Read up to 1,000 vector records by ID from one namespace. List vector record IDs Read a page of vector record IDs in byte order, optionally restricted to a prefix. --- ## Aggregate text results | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/fts-aggs Database endpoints Aggregate text results Summarize stored document values across matching full-text results or the whole field. POST /v1/tenants/{tenant}/fts/{table}/_aggs Summarize values from matching documentsStore facet values first; indexing words alone is not enough. 01 Choose the document setUse a text search or the whole field. 02 Aggregate stored valuesGroup or summarize the requested facets. 03 Read counts and summariesCompare doc_count with the named aggregation results. Before you start Use your database bearer token. Connection setup Store facet values with Store original text before aggregating them. The example uses category facets. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values field names the full-text field whose per-document values (written via the doc endpoint) are aggregated. aggs must be non-empty (400 otherwise). filter_expr is accepted only to be refused: any non-null value, top-level or inside search, answers 501. FieldTypeRequiredDescription aggsobjectOptionalMap of aggregation name -> aggregation node. A node is {"": {...}, "aggs": {}}. Bucket kinds: terms, range, histogram, date_histogram, filter, filters, missing, global. Metric kinds: count, min, max, sum, avg, stats, extended_stats, cardinality, percentiles, percentile_ranks, top_hits. Pipeline kinds: bucket_sort, cumulative_sum, derivative, serial_diff, moving_fn, bucket_script, bucket_selector, avg_bucket, sum_bucket, min_bucket, max_bucket, stats_bucket. Fields are named with "field". fieldstringRequired— searchobjectOptionalA _search request body selecting the documents to aggregate (doc_values_field is refused here). Absent means match_all over field. Fields in search FieldTypeRequiredDescription default_fieldstringOptional— exact_totalbooleanOptional— min_scorenumberOptional— paramsobjectOptionalBM25 tunables; both optional. Fields in params FieldTypeRequired bnumberOptional k1numberOptional FieldTypeRequiredDescription queryany JSONRequired— search_afterobjectOptionalvalues holds one JSON scalar per sort key (any scalar type; null means missing) and must match the sort length. doc_id is the tiebreak of the last hit seen. Fields in search_after FieldTypeRequired doc_idstringOptional valuesany JSON[]Required Fields in values FieldTypeRequired valuesany JSONOptional FieldTypeRequired sortobject[]Optional Fields in sort FieldTypeRequired ascendingbooleanRequired fieldstringRequired missingany JSONOptional modestringOptional rolestringRequired truncatebooleanOptional FieldTypeRequired tablestringOptional top_kintegerOptional total_ceilingintegerOptional unindexed_fields_are_emptybooleanOptional universe_fieldstringOptional Read the result Read doc_count alongside the named results in aggs. Bucket counts group stored facet values, so you must store those values before aggregating them; indexing words alone is not enough. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/fts/demo_docs/_aggs" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "field": "body", "aggs": { "categories": { "terms": { "field": "category" } } } }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error413 Error415 Error422 Error429 Error499 Error500 Error501 Error503 Error { "doc_count": 1, "aggs": { "categories": { "kind": "buckets", "buckets": [ { "key": "outdoor", "doc_count": 1, "aggs": {} } ] } } } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Suggest completions Find completions and spelling or phrase corrections using an indexed field's terms. Configure synonyms Replaces the synonym map for a table field's full-text index. --- ## Delete a document | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/fts-delete-doc Database endpoints Delete a document Removes a document from a table field's full-text index, including its stored text and facet values. POST /v1/tenants/{tenant}/fts/{table}/{field}/delete Remove one document's searchable textSuccessful removal does not prove the document previously existed. 01 Identify the text entrySelect table, field and document ID. 02 Remove its indexed contentDelete terms, stored text and facet values. 03 Read the deletion resultKeep source-row deletion separate if also required. Before you start Use your database bearer token. Connection setup Use the document ID and text field to remove. The example removes p1 from demo_docs/body. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired fieldstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values Idempotent: deleting a document that was never indexed also succeeds. FieldTypeRequired doc_idstringRequired Read the result deleted: true also applies when the document was never indexed. Treat it as confirmation that the requested removal succeeded, not as proof that the document previously existed. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/fts/demo_docs/body/delete" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "doc_id": "p1" }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error503 Error { "deleted": true } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Configure stopwords Replaces the stopword list for a table field's full-text index. Execute Cypher Run an openCypher query and receive matching rows or write counts. --- ## Search with the query DSL | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/fts-dsl-search Database endpoints Search with the query DSL Run a structured full-text query and receive ranked document IDs and a match count. POST /v1/tenants/{tenant}/fts/{table}/_search Turn a structured text query into matchesFetch source records separately when you need their contents. 01 Describe the text queryChoose clauses, sorting and result limits. 02 Search the indexed fieldsEvaluate matching documents and rank hits. 03 Use IDs and scoresRead the match count under your counting options. Before you start Use your database bearer token. Connection setup Index documents in the target field first. The examples search demo_docs/body. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values table is optional and must equal the URL table if sent. top_k defaults to 10 and may not exceed the server hit ceiling (default 10,000). search_after requires a non-empty sort. doc_values_field names the field whose stored facet values back numeric_range / function_score clauses and sorts. A non-null filter_expr key answers 501. Unknown top-level keys are ignored (body is not strictly checked). FieldTypeRequiredDescription default_fieldstringOptional— doc_values_fieldstringOptional— exact_totalbooleanOptional— min_scorenumberOptional— paramsobjectOptionalBM25 tunables; both optional. Fields in params FieldTypeRequired bnumberOptional k1numberOptional FieldTypeRequiredDescription queryany JSONRequired— search_afterobjectOptionalvalues holds one JSON scalar per sort key (any scalar type; null means missing) and must match the sort length. doc_id is the tiebreak of the last hit seen. Fields in search_after FieldTypeRequired doc_idstringOptional valuesany JSON[]Required Fields in values FieldTypeRequired valuesany JSONOptional FieldTypeRequired sortobject[]Optional Fields in sort FieldTypeRequired ascendingbooleanRequired fieldstringRequired missingany JSONOptional modestringOptional rolestringRequired truncatebooleanOptional FieldTypeRequired tablestringOptional top_kintegerOptional total_ceilingintegerOptional unindexed_fields_are_emptybooleanOptional universe_fieldstringOptional Read the result hits contains document IDs and relevance scores, and total reports the match count under the requested counting options. Fetch original records separately when your application needs their contents. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/fts/demo_docs/_search" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "query": { "match": { "field": "body", "query": "trail" } }, "default_field": "body", "top_k": 5 }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error413 Error415 Error422 Error429 Error499 Error500 Error501 Error503 Error { "hits": [ { "doc_id": "p1", "score": 0.2877 } ], "total": 1 } Illustrative relevance score for the p1 fixture; corpus statistics affect scoring. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Search a text field Searches the full-text index of a table field by boolean match, phrase or BM25 relevance ranking. Suggest completions Find completions and spelling or phrase corrections using an indexed field's terms. --- ## Index a document | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/fts-index Database endpoints Index a document Indexes the text of one document for full-text search on a table field. POST /v1/tenants/{tenant}/fts/{table}/{field} Make one document's words searchableSuccess returns an empty 201 response, not JSON. 01 Choose a document IDReuse the source record's identifier. 02 Index its textSelect the table field and analyzer. 03 Find it through text searchUse the matching ID to reopen the source. Before you start Use your database bearer token. Connection setup Choose the table and text field to index. The example indexes document p1 under demo_docs/body. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired fieldstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values The document key is `doc_id`. `analyzer` is a string ("keyword", "whitespace") or an object such as {"language": "english"}; absent uses the default analyzer. `values` indexes each string as one exact token instead of analysing `text` (`text` is still required). Success is 201 with an empty body. FieldTypeRequired analyzerany JSONOptional doc_idstringRequired textstringRequired valuesstring[]Optional Fields in values FieldTypeRequired valuesstringOptional Read the result A successful write returns 201 with an empty body. Do not attempt to decode JSON from it. Use the same doc_id when relating the search result to your source record. Response statuses HTTP status reference StatusWhat to do 201Created 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/fts/demo_docs/body" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "doc_id": "p1", "text": "Trail mug with insulated steel" }' Response example Examples use synthetic values to show the response format. Response status201 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error502 Error503 Error HTTP/1.1 201 No response body specified by the contract. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete vector records Delete vector records by ID, by metadata filter, or across a whole namespace. Index JSON fields Index the string values in a JSON document, optionally restricting which paths are searchable. --- ## Index JSON fields | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/fts-index-json Database endpoints Index JSON fields Index the string values in a JSON document, optionally restricting which paths are searchable. POST /v1/tenants/{tenant}/fts/{table}/{field}/json Select which JSON text becomes searchableOnly string leaves are indexed; omitted paths include all string leaves. 01 Supply the JSON documentKeep its source document ID. 02 Choose searchable pathsOptionally restrict indexing with dotted paths. 03 Index the selected stringsAn empty 201 response confirms the write. Before you start Use your database bearer token. Connection setup Choose the table, text field and JSON paths to index. The example uses demo_docs/body. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired fieldstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values `paths` are dotted paths into `json`; empty or absent indexes every string leaf. Success is 201 with an empty body. FieldTypeRequired doc_idstringRequired jsonany JSONRequired pathsstring[]Optional Fields in paths FieldTypeRequired pathsstringOptional Read the result Success is 201 with an empty body. Only string leaves in the selected dotted paths are indexed; omitting paths indexes every string leaf in the supplied JSON. Response statuses HTTP status reference StatusWhat to do 201Created 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/fts/demo_docs/body/json" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "doc_id": "p2", "json": { "title": "Trail bottle", "description": "Insulated steel bottle" }, "paths": [ "title", "description" ] }' Response example Examples use synthetic values to show the response format. Response status201 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error502 Error503 Error HTTP/1.1 201 No response body specified by the contract. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Index a document Indexes the text of one document for full-text search on a table field. Store original text Store the original text and facet values used for highlighting and aggregation. This does not make the text searchable. --- ## Configure stopwords | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/fts-install-stopwords Database endpoints Configure stopwords Replaces the stopword list for a table field's full-text index. POST /v1/tenants/{tenant}/fts/{table}/{field}/stopwords Replace a field's ignored-word listSend the complete desired list; an empty list disables stopwords. 01 Choose the indexed fieldTarget the table and full-text field. 02 Supply the complete listInclude every word the setting should retain. 03 Confirm the saved settingExpect an empty 201 response. Before you start Use your database bearer token. Connection setup This replaces the field's complete stopword list. Send an empty list to disable stopwords for that field. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired fieldstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values The complete list for this table field; an empty array disables stopwords for the field. FieldTypeRequired stopwordsstring[]Required Fields in stopwords FieldTypeRequired stopwordsstringOptional Read the result Success is 201 with an empty body. The supplied array replaces the whole field's stopword list. Send all words you want to keep, or an empty array to disable the list. Response statuses HTTP status reference StatusWhat to do 201Created 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/fts/demo_docs/body/stopwords" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "stopwords": [ "the", "a", "an" ] }' Response example Examples use synthetic values to show the response format. Response status201 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error503 Error HTTP/1.1 201 No response body specified by the contract. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Configure synonyms Replaces the synonym map for a table field's full-text index. Delete a document Removes a document from a table field's full-text index, including its stored text and facet values. --- ## Configure synonyms | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/fts-install-synonyms Database endpoints Configure synonyms Replaces the synonym map for a table field's full-text index. POST /v1/tenants/{tenant}/fts/{table}/{field}/synonyms Replace a field's synonym dictionaryThis replaces the previous map rather than appending one entry. 01 Choose the indexed fieldTarget the table field needing equivalent terms. 02 Map terms to synonymsSend the complete canonical-term dictionary. 03 Confirm the new mapExpect an empty 201 response. Before you start Use your database bearer token. Connection setup This replaces the field's complete synonym map. Include every mapping you want to keep. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired fieldstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values Maps each canonical term to an array of synonym strings; replaces any previous map for the table field in full. FieldTypeRequired synonymsobjectRequired Read the result Success is 201 with an empty body. The map replaces the previous map for this field; it does not append a single synonym to existing settings. Response statuses HTTP status reference StatusWhat to do 201Created 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/fts/demo_docs/body/synonyms" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "synonyms": { "mug": [ "cup" ], "trail": [ "hike" ] } }' Response example Examples use synthetic values to show the response format. Response status201 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error503 Error HTTP/1.1 201 No response body specified by the contract. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Aggregate text results Summarize stored document values across matching full-text results or the whole field. Configure stopwords Replaces the stopword list for a table field's full-text index. --- ## List text indexes | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/fts-list Database endpoints List text indexes Lists every full-text indexed field in the tenant with its document count and average document length. GET /v1/tenants/{tenant}/fts See which fields have text indexesCounts describe indexed content; this request does not retrieve documents. 01 List the tenant's indexesRequest the full-text index inventory. 02 Find the table fieldIdentify each searchable field. 03 Inspect its document statisticsCompare count and average document length. Before you start Use your database bearer token. Connection setup Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Each entry identifies an indexed table field, its document count and average document length. Use these values to inspect indexing, not to retrieve the indexed documents themselves. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/fts" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error502 Error503 Error { "complete": true, "fields": [ { "table": "demo_docs", "field": "body", "num_docs": 1, "avg_doc_length": 5 } ] } Illustrates the single indexed p1 fixture; counts change when p2 is indexed. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Store original text Store the original text and facet values used for highlighting and aggregation. This does not make the text searchable. Search a text field Searches the full-text index of a table field by boolean match, phrase or BM25 relevance ranking. --- ## Search a text field | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/fts-search Database endpoints Search a text field Searches the full-text index of a table field by boolean match, phrase or BM25 relevance ranking. GET /v1/tenants/{tenant}/fts/{table}/{field} Match words, phrases or relevanceThe response shape depends on the selected search mode and options. 01 Choose field and querySelect the indexed text to search. 02 Pick the matching modeUse boolean terms, a phrase or BM25 ranking. 03 Read the matching IDsInterpret scores only when that mode returns them. Before you start Use your database bearer token. Connection setup Index documents in the target field first. The examples search demo_docs/body. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired fieldstringRequired Query parameters FieldTypeRequired qstringRequired modestringOptional kintegerOptional fuzzyintegerOptional highlightbooleanOptional facetsstringOptional explainbooleanOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result BM25 returns ranked document IDs and scores. Boolean and phrase modes can return IDs without scores; highlight or facet options can produce an envelope. Read the response example for the mode you request instead of assuming one wire shape. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 413Split or reduce the request body. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/fts/demo_docs/body?q=trail&mode=bm25&k=5" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error413 Error429 Error499 Error500 Error501 Error503 Error [ { "doc_id": "p1", "score": 0.2877 } ] Illustrative BM25 score; values depend on corpus statistics. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List text indexes Lists every full-text indexed field in the tenant with its document count and average document length. Search with the query DSL Run a structured full-text query and receive ranked document IDs and a match count. --- ## Store original text | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/fts-set-doc Database endpoints Store original text Store the original text and facet values used for highlighting and aggregation. This does not make the text searchable. POST /v1/tenants/{tenant}/fts/{table}/{field}/doc Save text for highlights and facetsStoring the original text does not create searchable terms. 01 Identify the source documentUse the same ID as its indexed entry. 02 Save text and facet valuesPreserve content for highlighting and aggregation. 03 Index terms separatelySearch needs the separate document-indexing operation. Before you start Use your database bearer token. Connection setup Store the text and facets for the same document ID used by your index. Call Index a document separately to make that text searchable. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired fieldstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values facets maps a facet name to string values, for example {"color": ["red"], "tags": ["a", "b"]}. Stored text is used for highlighting. This operation does not create the terms used by search. FieldTypeRequired doc_idstringRequired facetsobjectOptional textstringRequired Read the result Success is 201 with an empty body. This saves original text and facet values for later highlighting or aggregation. It does not add searchable terms; index the document separately. Response statuses HTTP status reference StatusWhat to do 201Created 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/fts/demo_docs/body/doc" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "doc_id": "p1", "text": "Trail mug with insulated steel", "facets": { "category": [ "outdoor" ] } }' Response example Examples use synthetic values to show the response format. Response status201 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error503 Error HTTP/1.1 201 No response body specified by the contract. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Index JSON fields Index the string values in a JSON document, optionally restricting which paths are searchable. List text indexes Lists every full-text indexed field in the tenant with its document count and average document length. --- ## Suggest completions | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/fts-suggest Database endpoints Suggest completions Find completions and spelling or phrase corrections using an indexed field's terms. POST /v1/tenants/{tenant}/fts/{table}/_suggest Offer useful alternatives to a searchCompletion, term and phrase requests return different suggestion fields. 01 Choose a suggestion typeComplete a prefix or correct terms or phrases. 02 Use the field's indexed termsSupply the prefix or query text for that type. 03 Read the suggested candidatesUse frequency and scan details to interpret results. Before you start Use your database bearer token. Connection setup Index text in the target field before asking for term or prefix suggestions. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values Tagged by kind: completion | term | phrase. completion requires prefix and accepts size, order (frequency | lexicographic), max_scan. term requires text and accepts size, max_edits, mode (missing | popular | always), min_word_length. phrase requires text and accepts size, max_edits, candidates_per_term, confidence (default 1.0), min_word_length. A missing or unknown kind is rejected by body parsing. FieldTypeRequired candidates_per_termintegerOptional confidencenumberOptional fieldstringRequired kindstringRequired max_editsintegerOptional max_scanintegerOptional min_word_lengthintegerOptional modestringOptional orderstringOptional prefixstringOptional sizeintegerOptional textstringOptional Read the result The result shape follows kind: completion returns completions, while term and phrase requests return their own suggestions. Frequency and scan fields help you interpret how candidates were selected. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/fts/demo_docs/_suggest" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "kind": "completion", "field": "body", "prefix": "tra", "size": 5 }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error413 Error415 Error422 Error429 Error499 Error500 Error501 Error503 Error { "kind": "completion", "source": "segmented", "prefix": "tra", "completions": [ { "text": "trail", "df": 1, "total_tf": 1, "score": 1 } ], "frequency_ranked": true, "df_exact": true, "scanned": 1 } Illustrative completion for the one-document fixture; dictionary source and statistics can vary. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Search with the query DSL Run a structured full-text query and receive ranked document IDs and a match count. Aggregate text results Summarize stored document values across matching full-text results or the whole field. --- ## Inspect geospatial indexes | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/geo-config-get Database endpoints Inspect geospatial indexes Read a schema's geospatial index definitions and current point counts. GET /v1/tenants/{tenant}/geo/{schema} Check whether locations are indexed consistentlyThis reports index health, not nearby locations. 01 Choose the table schemaRequest its geospatial configuration. 02 Compare point and index countsInspect points, indexed and consistency. 03 Check for pending repairAccount for repair state before relying on searches. Before you start Use your database bearer token. Connection setup Use a registered schema with a declared geospatial field. The example targets demo.locations. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Compare points with indexed, and check consistent and index_repair_pending. This inspects geospatial indexing; it does not return nearby locations. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/geo/demo.locations" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error500 Error503 Error { "schema": "demo.locations", "fields": [ { "field": "location", "source": "location", "index": "r_tree", "points": 1, "indexed": 1, "consistent": true, "index_repair_pending": false } ] } Assumes demo.locations declares an R-tree index on the location source column and contains the one geo fixture point. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Search GraphSAGE embeddings Find nodes similar to a selected node using saved GraphSAGE embeddings. Search by location Find locations inside a bounding box, within a radius, or nearest to a point. --- ## Search by location | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/geo-search Database endpoints Search by location Find locations inside a bounding box, within a radius, or nearest to a point. GET /v1/tenants/{tenant}/geo/{schema}/{field} Find records near a locationDistance is returned only for modes that provide it. 01 Describe the search areaSupply a box, radius or nearest-point request. 02 Search the location fieldMatch points within the selected schema. 03 Read matching document IDsInspect distance and any pending index repair. Before you start Use your database bearer token. Connection setup Register a geospatial index on demo.locations.location and insert coordinates before running the example. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired fieldstringRequired Query parameters FieldTypeRequired modestringOptional latnumberOptional lonnumberOptional radius_mnumberOptional kintegerOptional min_latnumberOptional min_lonnumberOptional max_latnumberOptional max_lonnumberOptional limitintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result hits contains matching document IDs, with distance_m when the search mode provides a distance. count is the returned hit count. Check index_repair_pending before assuming the index is fully repaired. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/geo/demo.locations/location?mode=radius&lat=12.9716&lon=77.5946&radius_m=5000&limit=10" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error500 Error503 Error { "mode": "radius", "count": 1, "hits": [ { "doc_id": "location-1", "distance_m": 250 } ], "index_repair_pending": false } Assumes the separate geo setup inserted a point 250 metres from the sample centre; people rows alone cannot produce this result. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Inspect geospatial indexes Read a schema's geospatial index definitions and current point counts. Create user Creates a database user that authenticates with either a password or a generated API key. --- ## Find all simple paths | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-all-simple-paths Database endpoints Find all simple paths Lists the simple paths from one node to another along a relation, up to a depth and path-count limit. GET /v1/tenants/{tenant}/graph/{schema}/all_simple_paths Explore routes without revisiting a nodeDepth and path-count limits bound the returned routes. 01 Choose two recordsSet the source, destination and relation. 02 Follow directed linksExplore simple paths within the chosen limits. 03 Read each ordered pathEach returned path contains no repeated node. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired srcstringRequired dststringRequired max_depthintegerOptional max_pathsintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Each pks array is an ordered path from source to destination with no repeated node. Depth and path-count limits bound the search; the returned list is not necessarily every possible path. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/all_simple_paths?rel=follows&src=u1&dst=u3&max_depth=3&max_paths=10" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error503 Error [ { "pks": [ "u1", "u2", "u3" ] } ] Illustrative path; traversal direction/order depends on the relation and algorithm. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Find k shortest paths Returns up to k loop-free shortest paths between two nodes, ranked by cost. Find paths in either direction Lists the simple paths between two nodes when each hop may follow a relation edge in either direction. --- ## Find paths in either direction | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-all-simple-paths-bidir Database endpoints Find paths in either direction Lists the simple paths between two nodes when each hop may follow a relation edge in either direction. GET /v1/tenants/{tenant}/graph/{schema}/all_simple_paths_bidir Explore routes across either link directionA returned path does not imply every link points toward the destination. 01 Set the endpointsChoose the source, destination and relation. 02 Follow links both waysSearch within the depth and path-count limits. 03 Read the simple pathsEach route lists its nodes in traversal order. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired srcstringRequired dststringRequired max_depthintegerOptional max_pathsintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Each pks array is an ordered simple path. A hop may follow an edge in either direction, so a returned path does not imply that every edge points from source toward destination. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/all_simple_paths_bidir?rel=follows&src=u1&dst=u3&max_depth=3&max_paths=10" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error503 Error [ { "pks": [ "u1", "u2", "u3" ] } ] Illustrative path; traversal direction/order depends on the relation and algorithm. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Find all simple paths Lists the simple paths from one node to another along a relation, up to a depth and path-count limit. List reverse neighbors Returns the nodes that point to a node along a relation (its inbound edges). --- ## Measure node betweenness | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-betweenness Database endpoints Measure node betweenness Score nodes by how often they lie on shortest paths, using exact calculation or sampling. GET /v1/tenants/{tenant}/graph/{schema}/betweenness Find nodes that bridge shortest routesSampling and node limits affect the reported scores. 01 Select the graph scopeChoose a relation and calculation limits. 02 Compare shortest routesMeasure how often each node lies between other nodes. 03 Read bridge scoresCompare nodes using the same calculation settings. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired max_nodesintegerOptional samplesintegerOptional seedintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Each row pairs a node key with its betweenness score. Scores describe its position in this graph and relation; sampling and node limits affect the calculation, so keep those settings consistent when comparing runs. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/betweenness?rel=follows&max_nodes=100" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error503 Error [ { "pk": [ "u1" ], "betweenness": 1 }, { "pk": [ "u2" ], "betweenness": 1 }, { "pk": [ "u3" ], "betweenness": 1 } ] Illustrative centrality values; normalization and graph orientation determine exact scores. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Measure eigenvector centrality Score a node's influence using the influence of its connected nodes. Find connected components Labels every node in a graph schema with its connected component, treating a self-relation as undirected. --- ## Breadth-first traversal | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-bfs Database endpoints Breadth-first traversal Walks a relation breadth-first from a node and returns each node reached with its depth. GET /v1/tenants/{tenant}/graph/{schema}/bfs Explore connections one level at a timeDepth counts links followed from the start node. 01 Choose a starting recordSelect its relation and maximum depth. 02 Visit nearby levelsTraverse one hop, then the next. 03 Read keys and depthsEach result identifies a reached record and its distance. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired pkstringRequired max_depthintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Each result gives a reached node's primary key and hop depth from the start. max_depth limits traversal, not the total number of nodes in the graph. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/bfs?rel=follows&pk=u1&max_depth=2" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error503 Error [ { "depth": 1, "pk": "u2" }, { "depth": 2, "pk": "u3" } ] Illustrative traversal entries; the versioned canary proves u3 at depth 2, not this full response or its ordering. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Find a path Reports whether one node can reach another along a relation within a depth limit. Weighted shortest path Returns the lowest total weight of a path between two nodes, using caller-supplied edge weights. --- ## Find connected components | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-components Database endpoints Find connected components Labels every node in a graph schema with its connected component, treating a self-relation as undirected. GET /v1/tenants/{tenant}/graph/{schema}/components Find groups that have no connecting linksThis calculation treats the self-relation as undirected. 01 Select a self-relationChoose the graph's schema and relation. 02 Group connected nodesFind records reachable within each connected component. 03 Compare component labelsMatching labels identify membership, not importance. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired include_rowsbooleanOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Nodes with the same _component value belong to the same connected component. The self-relation is treated as undirected; the component label is an identifier, not a score. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 413Split or reduce the request body. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/components?rel=follows" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error413 Error429 Error499 Error500 Error503 Error [ { "pk": [ "u1" ], "_component": "[\"u1\"]" }, { "pk": [ "u2" ], "_component": "[\"u1\"]" }, { "pk": [ "u3" ], "_component": "[\"u1\"]" } ] { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Measure node betweenness Score nodes by how often they lie on shortest paths, using exact calculation or sampling. Detect communities Detects communities in a graph schema with the Louvain modularity algorithm. --- ## Find broken graph links | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-dangling Database endpoints Find broken graph links Find relation edges whose source or target row is missing. Results are returned in resumable pages. GET /v1/tenants/{tenant}/graph/{schema}/dangling Locate links with missing endpoint recordsContinue truncated scans before treating an empty page as an all-clear. 01 Select the relationSet scan budget and result limit. 02 Check link endpointsFind edges with missing source or target rows. 03 Continue from next_afterResume when the response reports truncation. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired budgetintegerOptional limitintegerOptional afterstringOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Read dangling for broken links. If truncated is true, continue with next_after; an empty page is not an all-clear when scanning stopped at a budget or page limit. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 413Split or reduce the request body. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/dangling?rel=follows&budget=1000&limit=10" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error413 Error429 Error500 Error501 Error503 Error { "schema": "demo.people", "relation": "follows", "edge_model": "derived", "endpoints": [ { "side": "target", "column": "follows_id", "target": "demo.people", "target_registered": true } ], "budget": 1000, "limit": 10, "scanned_rows": 3, "probes": 3, "dangling": [], "truncated": false, "truncated_by": null, "next_after": null } The seeded relation has registered targets; work counters are illustrative. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List reverse neighbors Returns the nodes that point to a node along a relation (its inbound edges). Rank nodes with PageRank Scores a set of nodes by PageRank over a relation. --- ## Weighted shortest path | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-dijkstra Database endpoints Weighted shortest path Returns the lowest total weight of a path between two nodes, using caller-supplied edge weights. GET /v1/tenants/{tenant}/graph/{schema}/dijkstra Calculate the least total travel costThis endpoint returns a cost, not the ordered route. 01 Supply endpoints and weightsChoose the relation and caller-provided edge costs. 02 Minimize the combined costEvaluate weighted routes between the selected nodes. 03 Read the lowest costUse a path-returning endpoint if you need the route. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired srcstringRequired dststringRequired weights_jsonstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result cost is the lowest total weight found between the selected nodes. This endpoint reports the cost, not an ordered node path. Use a path-returning endpoint when you need the route itself. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/dijkstra?rel=follows&src=u1&dst=u3&weights_json=%7B%22u1%7Cu2%22%3A1.5%2C%22u2%7Cu3%22%3A0.5%7D" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error503 Error { "cost": 2 } The supplied weights u1|u2=1.5 and u2|u3=0.5 total 2.0. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Breadth-first traversal Walks a relation breadth-first from a node and returns each node reached with its depth. Find k shortest paths Returns up to k loop-free shortest paths between two nodes, ranked by cost. --- ## Measure eigenvector centrality | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-eigenvector-centrality Database endpoints Measure eigenvector centrality Score a node's influence using the influence of its connected nodes. GET /v1/tenants/{tenant}/graph/{schema}/eigenvector_centrality Measure influence through influential neighborsScores apply to this graph and selected relation. 01 Choose the graph relationSet iteration and convergence limits. 02 Share influence through linksA node's neighbors contribute to its influence. 03 Compare node scoresRead the eigenvector score paired with each key. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired max_iterintegerOptional tolnumberOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Each row contains a node key and its eigenvector score. The score measures influence in this selected graph, not an absolute probability or a cross-database ranking. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/eigenvector_centrality?rel=follows&max_iter=50&tol=0.000001" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error503 Error [ { "pk": [ "u1" ], "eigenvector": 0.5773502692 }, { "pk": [ "u2" ], "eigenvector": 0.5773502692 }, { "pk": [ "u3" ], "eigenvector": 0.5773502692 } ] Illustrative normalized symmetric scores; exact numeric results depend on graph and convergence. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Rank nodes with PageRank Scores a set of nodes by PageRank over a relation. Measure node betweenness Score nodes by how often they lie on shortest paths, using exact calculation or sampling. --- ## Train GraphSAGE embeddings | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-graphsage Database endpoints Train GraphSAGE embeddings Train node embeddings from graph relationships and row features, and optionally save them for similarity search. POST /v1/tenants/{tenant}/graph/{schema}/graphsage Learn representations from links and featuresSave embeddings when you intend to use the GraphSAGE similarity endpoint. 01 Prepare links and featuresChoose the relation and numeric row-feature column. 02 Train node embeddingsCombine graph neighborhoods with feature values. 03 Check persisted outputVerify saving before searching the learned vectors. Before you start Use your database bearer token. Connection setup Populate the graph and a numeric-array feature column first. The example uses three finite values per row in features. Saving embeddings requires schema DDL permission. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values feature_col names the per-row numeric-array feature column. Defaults: feature_dim 128, embedding_dim 128, hidden_dim 128 (each 1..1024), num_layers 2 (1..4), neighbor_sample_size 25 (1..50), aggregator mean (mean | max_pool | lstm), walks_per_node 10, walk_length 80, window_size 5, negative_samples 5, epochs 5, initial_lr 0.025, min_lr 0.0001, seed 0. persist defaults to false; persist=true also requires the schema DDL privilege. Graphs above 100,000 nodes are refused. FieldTypeRequired aggregatorstringOptional embedding_dimintegerOptional epochsintegerOptional feature_colstringRequired feature_dimintegerOptional hidden_dimintegerOptional initial_lrnumberOptional min_lrnumberOptional negative_samplesintegerOptional neighbor_sample_sizeintegerOptional num_layersintegerOptional persistbooleanOptional relstringRequired seedintegerOptional walk_lengthintegerOptional walks_per_nodeintegerOptional window_sizeintegerOptional Read the result embeddings maps nodes to numeric vectors. Check persisted before calling the matching similarity-search endpoint. final_loss describes training, not a guarantee of useful recommendations. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/graphsage" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "rel": "follows", "feature_col": "features", "feature_dim": 3, "embedding_dim": 3, "hidden_dim": 8, "num_layers": 2, "aggregator": "mean", "epochs": 5, "seed": 42, "persist": true }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error503 Error { "embedding_dim": 3, "feature_dim": 3, "embeddings": { "u1": [ 0.1, 0.2, 0.3 ], "u2": [ 0.2, 0.1, 0.4 ], "u3": [ 0.4, 0.2, 0.1 ] }, "final_loss": 0.42, "persisted": true, "training_pairs": 60, "vocab_size": 3 } Requires the separate features-column setup; vectors and training metrics are illustrative. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Search Node2Vec embeddings Find nodes similar to a selected node using saved Node2Vec embeddings. Search GraphSAGE embeddings Find nodes similar to a selected node using saved GraphSAGE embeddings. --- ## Search GraphSAGE embeddings | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-graphsage-topk Database endpoints Search GraphSAGE embeddings Find nodes similar to a selected node using saved GraphSAGE embeddings. GET /v1/tenants/{tenant}/graph/{schema}/graphsage/{rel}/topk Search the learned GraphSAGE representationsSaved embeddings must exist before this request can compare nodes. 01 Choose a query nodeSelect the relation, result limit and metric. 02 Compare saved representationsSearch the trained GraphSAGE embeddings. 03 Read similar node keysUse their scores within this similarity calculation. Before you start Use your database bearer token. Connection setup Train GraphSAGE embeddings with persistence before searching them. Use a node with a usable saved embedding. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired relstringRequired Query parameters FieldTypeRequired querystringRequired kintegerRequired metricstringOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Each item contains a matched node key and score from the saved GraphSAGE embeddings. k asks for a result limit; it does not guarantee that the graph contains that many usable embeddings. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/graphsage/follows/topk?query=u1&k=3&metric=cosine" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error408 Error429 Error499 Error500 Error503 Error [ { "pk": "u1", "score": 1 }, { "pk": "u2", "score": 0.9331 }, { "pk": "u3", "score": 0.6415 } ] Illustrative similarities in the persisted example vectors; actual learned embeddings differ. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Train GraphSAGE embeddings Train node embeddings from graph relationships and row features, and optionally save them for similarity search. Inspect geospatial indexes Read a schema's geospatial index definitions and current point counts. --- ## Find k shortest paths | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-k-shortest Database endpoints Find k shortest paths Returns up to k loop-free shortest paths between two nodes, ranked by cost. GET /v1/tenants/{tenant}/graph/{schema}/k-shortest Compare the best few loop-free routesThe result contains up to k routes, not every possible route. 01 Set source and targetChoose the relation, path count and optional weight column. 02 Find low-cost alternativesRank loop-free paths by cost. 03 Read nodes and costsCompare the ordered routes returned. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired sourcestringRequired targetstringRequired kintegerRequired weight_colstringOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result paths contains up to k loop-free routes, each with ordered nodes and a cost. A cost ranks the returned paths; it is not a count of all routes through the graph. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/k-shortest?rel=follows&source=u1&target=u3&k=3" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error503 Error { "paths": [ { "cost": 2, "nodes": [ "u1", "u2", "u3" ] } ] } Without weight_col, each edge costs 1. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Weighted shortest path Returns the lowest total weight of a path between two nodes, using caller-supplied edge weights. Find all simple paths Lists the simple paths from one node to another along a relation, up to a depth and path-count limit. --- ## Find communities with label propagation | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-label-propagation Database endpoints Find communities with label propagation Group connected nodes into communities with label propagation. GET /v1/tenants/{tenant}/graph/{schema}/label_propagation Group records through their neighborsCommunity labels identify groups rather than ranking them. 01 Choose the relationSet the iteration limit and random seed. 02 Propagate neighboring labelsGroup connected nodes through repeated label updates. 03 Read each node's labelMatching labels identify a detected community. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired max_iterintegerOptional seedintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Nodes sharing a label belong to the same detected community. Labels identify groups; their numeric values do not rank the groups by importance. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/label_propagation?rel=follows&max_iter=20&seed=42" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error503 Error [ { "pk": [ "u1" ], "label": 0 }, { "pk": [ "u2" ], "label": 0 }, { "pk": [ "u3" ], "label": 0 } ] Illustrates one community; label values are algorithm-dependent. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Detect communities Detects communities in a graph schema with the Louvain modularity algorithm. Count triangles Enumerates every triangle in a graph schema's self-relation. --- ## Detect communities | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-louvain Database endpoints Detect communities Detects communities in a graph schema with the Louvain modularity algorithm. GET /v1/tenants/{tenant}/graph/{schema}/louvain Find closely connected communitiesCommunity numbers are identifiers, not relevance scores. 01 Select the graphChoose its schema, relation and stopping settings. 02 Detect community structureApply Louvain grouping to the selected links. 03 Read community membershipAssociate each node with its returned group. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired tolerancenumberOptional max_levelsintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result communities maps each node to a detected community. The community number is a group identifier, not a relevance score. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/louvain?rel=follows&tolerance=0.0001&max_levels=10" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error503 Error { "communities": [ { "pk": "u1", "community": 0 }, { "pk": "u2", "community": 0 }, { "pk": "u3", "community": 0 } ] } Illustrates one community; output is algorithm-dependent. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Find connected components Labels every node in a graph schema with its connected component, treating a self-relation as undirected. Find communities with label propagation Group connected nodes into communities with label propagation. --- ## List neighbors | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-neighbors Database endpoints List neighbors Returns the one-hop neighbours of a node along a relation. GET /v1/tenants/{tenant}/graph/{schema}/neighbors Read the next connected recordsThis returns node keys; fetch rows separately for their properties. 01 Choose a source recordSupply its primary key and relation. 02 Follow one outgoing hopRead direct neighbors along that relation. 03 Use the neighbor keysOpen the matching records if you need their fields. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired pkstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result The array contains keys of nodes one hop away along the chosen relation. It does not include complete rows; read the matching records separately if you need their properties. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/neighbors?rel=follows&pk=u1" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error503 Error [ "u2" ] { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Execute Cypher Run an openCypher query and receive matching rows or write counts. Find a path Reports whether one node can reach another along a relation within a depth limit. --- ## Train Node2Vec embeddings | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-node2vec Database endpoints Train Node2Vec embeddings Train node embeddings from graph walks, and optionally save them for similarity search. POST /v1/tenants/{tenant}/graph/{schema}/node2vec Turn graph walks into node vectorsSimilarity search needs embeddings that were saved during training. 01 Select the relationChoose walk and training settings. 02 Learn from graph walksTrain a numeric representation for each visited node. 03 Check the persisted flagConfirm saved embeddings before querying them. Before you start Use your database bearer token. Connection setup Populate the schema's relations before training. Saving embeddings requires schema DDL permission; a tiny example graph demonstrates the request, not model quality. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values Defaults: walks_per_node 10, walk_length 80 (their product is capped at 10,000,000), window_size 5, negative_samples 5, dim 128 (max 1024), epochs 5, initial_lr 0.025, min_lr 0.0001 (must not exceed initial_lr), p 1.0, q 1.0, seed 0, persist false. persist=true also requires the schema DDL privilege. Graphs above 100,000 nodes are refused. FieldTypeRequired dimintegerOptional epochsintegerOptional initial_lrnumberOptional min_lrnumberOptional negative_samplesintegerOptional pnumberOptional persistbooleanOptional qnumberOptional relstringRequired seedintegerOptional walk_lengthintegerOptional walks_per_nodeintegerOptional window_sizeintegerOptional Read the result embeddings maps nodes to learned vectors. With persist: true, check persisted before using the Node2Vec similarity endpoint. Training statistics do not establish application-level result quality. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/node2vec" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "rel": "follows", "dim": 3, "walks_per_node": 10, "walk_length": 20, "epochs": 5, "seed": 42, "persist": true }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error503 Error { "dim": 3, "embeddings": { "u1": [ 0.1, 0.2, 0.3 ], "u2": [ 0.2, 0.1, 0.4 ], "u3": [ 0.4, 0.2, 0.1 ] }, "final_loss": 0.42, "persisted": true, "training_pairs": 60, "vocab_size": 3 } Synthetic learned vectors and training metrics; no model-quality or runtime claim. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Walk a graph at random Follow a seeded random walk from a node, optionally using Node2Vec bias. Search Node2Vec embeddings Find nodes similar to a selected node using saved Node2Vec embeddings. --- ## Search Node2Vec embeddings | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-node2vec-topk Database endpoints Search Node2Vec embeddings Find nodes similar to a selected node using saved Node2Vec embeddings. GET /v1/tenants/{tenant}/graph/{schema}/node2vec/{rel}/topk Find nodes with similar learned rolesRepresentation similarity differs from a direct link or shortest path. 01 Choose a query nodeUse a graph with saved Node2Vec embeddings. 02 Compare learned vectorsApply the selected metric and result limit. 03 Read similar node keysInterpret scores within this embedding search. Before you start Use your database bearer token. Connection setup Train Node2Vec embeddings with persistence before searching them. Use a node with a usable saved embedding. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired relstringRequired Query parameters FieldTypeRequired querystringRequired kintegerRequired metricstringOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Each item is a node key with a similarity score from saved Node2Vec embeddings. This compares learned graph representations; it is different from finding a direct edge or shortest path. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/node2vec/follows/topk?query=u1&k=3&metric=cosine" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error408 Error429 Error499 Error500 Error503 Error [ { "pk": "u1", "score": 1 }, { "pk": "u2", "score": 0.9331 }, { "pk": "u3", "score": 0.6415 } ] Illustrative similarities in the persisted example vectors; actual learned embeddings differ. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Train Node2Vec embeddings Train node embeddings from graph walks, and optionally save them for similarity search. Train GraphSAGE embeddings Train node embeddings from graph relationships and row features, and optionally save them for similarity search. --- ## Rank nodes with PageRank | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-pagerank Database endpoints Rank nodes with PageRank Scores a set of nodes by PageRank over a relation. GET /v1/tenants/{tenant}/graph/{schema}/pagerank Rank a selected set of linked recordsCompare scores within the same relation and node set. 01 Select the node setChoose records and the relation joining them. 02 Calculate PageRankApply damping and convergence settings. 03 Read scores by keyUse the ranking for this graph calculation. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired nodesstringRequired dampingnumberOptional max_iterintegerOptional tolnumberOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Each result pairs a node key with a PageRank score for the selected relation and node set. Compare scores within that calculation rather than treating them as a universal measure of importance. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/pagerank?rel=follows&nodes=u1%2Cu2%2Cu3&damping=0.85&max_iter=100" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error503 Error [ { "pk": "u1", "score": 0.3333333333 }, { "pk": "u2", "score": 0.3333333333 }, { "pk": "u3", "score": 0.3333333333 } ] Illustrative symmetric-cycle scores; convergence and rounding vary. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Find broken graph links Find relation edges whose source or target row is missing. Results are returned in resumable pages. Measure eigenvector centrality Score a node's influence using the influence of its connected nodes. --- ## Find a path | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-path Database endpoints Find a path Reports whether one node can reach another along a relation within a depth limit. GET /v1/tenants/{tenant}/graph/{schema}/path Check whether one record reaches anotherA truncated search cannot prove that no path exists. 01 Select source and destinationChoose the relation and maximum search depth. 02 Check bounded reachabilityFollow links within the requested depth. 03 Read reachable and truncatedThis response does not contain an ordered route. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired srcstringRequired dststringRequired max_depthintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result reachable answers the reachability question within the requested depth. Check truncated before interpreting a negative result as proof that no path exists. This response does not contain an ordered path. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/path?rel=follows&src=u1&dst=u3&max_depth=3" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error503 Error { "max_depth": 3, "reachable": true, "truncated": false } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List neighbors Returns the one-hop neighbours of a node along a relation. Breadth-first traversal Walks a relation breadth-first from a node and returns each node reached with its depth. --- ## Walk a graph at random | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-random-walk Database endpoints Walk a graph at random Follow a seeded random walk from a node, optionally using Node2Vec bias. GET /v1/tenants/{tenant}/graph/{schema}/random-walk Sample a journey through connected recordsThe walk can revisit nodes; it is not a shortest-path result. 01 Choose a start and seedSet the number of steps and optional walk bias. 02 Follow sampled linksWalk through the relation one step at a time. 03 Read the visited sequenceReuse the seed on unchanged data for reproduction. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired startstringRequired stepsintegerRequired seedintegerRequired pnumberOptional qnumberOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result walk is the sequence of visited node keys. Nodes may repeat; it is a sampled walk rather than a shortest or loop-free path. Use the same seed when reproducing a walk on unchanged data. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/random-walk?rel=follows&start=u1&steps=5&seed=42" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error503 Error { "start": "u1", "walk": [ "u1", "u2", "u3", "u1", "u2", "u3" ] } Illustrative walk for the seeded directed cycle; keep seed and graph fixed for repeatability. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Count triangles Enumerates every triangle in a graph schema's self-relation. Train Node2Vec embeddings Train node embeddings from graph walks, and optionally save them for similarity search. --- ## List reverse neighbors | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-reverse Database endpoints List reverse neighbors Returns the nodes that point to a node along a relation (its inbound edges). GET /v1/tenants/{tenant}/graph/{schema}/reverse Find records pointing into a targetReturned keys describe inbound neighbors, not complete rows. 01 Select the target recordSupply its primary key and relation. 02 Follow incoming linksFind nodes that point toward this record. 03 Read their primary keysFetch their rows separately when needed. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired pkstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result The array contains keys of nodes pointing into the selected node along this relation. These are inbound neighbors, not full row objects. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/reverse?rel=follows&pk=u2" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error502 Error503 Error [ "u1" ] { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Find paths in either direction Lists the simple paths between two nodes when each hop may follow a relation edge in either direction. Find broken graph links Find relation edges whose source or target row is missing. Results are returned in resumable pages. --- ## Count triangles | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/graph-triangles Database endpoints Count triangles Enumerates every triangle in a graph schema's self-relation. GET /v1/tenants/{tenant}/graph/{schema}/triangles Find connected sets of three recordsThe result lists node keys rather than full records. 01 Choose a self-relationSelect the graph's schema and relation. 02 Find three-node cyclesEnumerate triangles in those links. 03 Read each tripleUse the three keys to inspect its records. Before you start Use your database bearer token. Connection setup Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired relstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Each result names the three node keys of a triangle. The response describes connections in the selected self-relation, not the nodes' complete records. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 413Split or reduce the request body. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/triangles?rel=follows" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error413 Error429 Error499 Error500 Error503 Error [ { "a": [ "u1" ], "b": [ "u2" ], "c": [ "u3" ] } ] { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Find communities with label propagation Group connected nodes into communities with label propagation. Walk a graph at random Follow a seeded random walk from a node, optionally using Node2Vec bias. --- ## Check health | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/health Database endpoints Check health Reports that the engine process is alive, with a constant JSON body. GET /health Check that the engine process answersHealth is not a read- or write-readiness guarantee. 01 Send a health requestContact the engine's health endpoint. 02 Read status okConfirm that the process responded. 03 Check readiness nextUse readiness for workload-serving decisions. Before you start No bearer credential declared by the contract. Connection setup Read the result status: ok establishes that the process answered the health request. The tenants and schemas values are not live counts here. Use readiness checks before deciding whether the engine can serve your workload. Response statuses HTTP status reference StatusWhat to do 200OK Request example curl --include --request GET "${OC_BASE_URL}/health" Response example Examples use synthetic values to show the response format. Response status200 Success { "status": "ok", "tenants": null, "schemas": null } Download the OpenAPI specification for the complete response schemas. Receive a webhook delivery Verify a webhook delivery and write its mapped rows. Check readiness Reports whether the engine can serve traffic, including write and read readiness and any pressure conditions. --- ## Read vector index counts | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/index-stats Database endpoints Read vector index counts Read vector record counts for each namespace and the index as a whole. GET /v1/tenants/{tenant}/vector-indexes/{index}/stats Compare vector counts across namespacesA truncated namespace list is not the complete index inventory. 01 Select the vector indexRequest its count summary. 02 Read total and namespace countsCompare stored records at both levels. 03 Inspect truncation and pending workKeep pending counters separate from stored-record totals. Before you start Use your database bearer token. Connection setup Use the target vector index and, where required, its namespace. The examples use index demo-search and namespace demo. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Use total_record_count for the index and each namespace's record_count for its part. Check truncated before treating the namespace list as complete; pending counters have a different meaning from stored records. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/stats" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error500 Error501 Error503 Error { "index_id": "22222222-2222-4222-8222-222222222222", "total_record_count": 2, "namespaces": [ { "name": "demo", "namespace_id": "33333333-3333-4333-8333-333333333333", "record_count": 2, "pending_records": 0, "pending_new_records": 0, "dense_ids": 2, "sparse_ids": 0 } ], "position": { "domain": "wal", "value": "1042:0" }, "truncated": false } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Search an index Search a vector namespace with dense, sparse, lexical or hybrid ranking and an optional metadata filter. Delete a vector index Deletes a vector index; its namespaces are erased in the background. --- ## Import a CSV or NDJSON file | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/ingest-file Database endpoints Import a CSV or NDJSON file Upload a CSV or NDJSON file and load its rows into an existing table. POST /v1/tenants/{tenant}/ingest/files/{schema} Move a file into an existing tableVerify imported rows before switching application traffic. 01 Prepare CSV or NDJSONMatch the destination table's fields and types. 02 Upload the fileChoose format and chunk settings. 03 Check imported rowsCompare rows_ingested with the expected file contents. Before you start Use your database bearer token. Connection setup Register the destination table and prepare a CSV or NDJSON file. This is a multipart upload, not a JSON body; use curl -F file=@people.csv. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired formatstringOptional csv_has_headerbooleanOptional chunk_sizeintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body multipart/form-data Limits and accepted values Exactly one part named 'file' (binary CSV or NDJSON); other parts are ignored. Format is taken from the 'format' query parameter, else the part's content type (text/csv, application/x-ndjson, application/jsonl), else the filename extension (.csv, .ndjson, .jsonl), else NDJSON if the first non-blank byte is '{'. CSV cells are coerced to the table's column types; an empty cell becomes null. The route defines no fixed body-size limit. This is not a claim of unlimited deployment capacity. FieldTypeRequired filestringRequired Read the result rows_ingested reports imported rows and chunks reports the work units used. Confirm the row count against your file and inspect the destination before switching an application to the imported data. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/ingest/files/demo.people?format=csv&csv_has_header=true" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --form "file=@./sample.csv" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error429 Error500 Error501 Error503 Error { "format": "csv", "chunks": 1, "rows_ingested": 1, "elapsed_ms": 12 } This result matches the one-row CSV shown in the HTTP tab. Your count depends on the uploaded file; duration is illustrative. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete a row policy Deletes the row-level security policy for a role on a table. Import from PostgreSQL Copy tables from an allowed PostgreSQL source with a full or incremental sync. --- ## List grants | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/list-grants Database endpoints List grants Read the permissions and masked columns granted to each role on each object. GET /v1/tenants/{tenant}/db/grants See what each role was grantedGrant rows differ from effective access after inheritance. 01 Request stored grantsList grants in the selected tenant. 02 Read role and objectInspect privileges and masked columns on each grant. 03 Review effective access separatelyUse the permissions matrix for inherited permissions. Before you start Use your database bearer token. Connection setup Use an identity authorized to manage access in this tenant. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Each grant links a role to an object, its privilege text and masked columns. To inspect inherited effective access rather than grant rows alone, use the permissions matrix. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/grants" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error503 Error { "grants": [ { "role": "demo_reader", "object": "demo.people", "privileges": "S", "masked_columns": [] } ] } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Set a role's permissions Set a role's permissions and optional column masks for a table or all tables. This replaces the role's existing grant on that object. Remove a role's grant Revokes a role's grant on an object, removing every privilege and column mask it carried. --- ## List vector record IDs | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/list-ids Database endpoints List vector record IDs Read a page of vector record IDs in byte order, optionally restricted to a prefix. POST /v1/tenants/{tenant}/vector-indexes/{index}/records/list-ids Walk through vector record identifiersThis lists IDs without fetching vectors or metadata. 01 Select namespace and prefixSet the ID prefix and page limit if needed. 02 Read IDs in byte orderInspect one page of identifiers. 03 Continue with the cursorKeep the namespace and prefix unchanged. Before you start Use your database bearer token. Connection setup Use the target vector index and, where required, its namespace. The examples use index demo-search and namespace demo. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values prefix 1-2,048 bytes; limit 1-1,000, default 100. consistency: read_committed (default); snapshot is refused with 400. FieldTypeRequired consistencystringOptional cursorstringOptional limitintegerOptional namespacestringRequired prefixstringOptional Read the result ids contains one page in byte order. Use a returned cursor to continue, keeping the same namespace and prefix. This lists IDs without fetching vector values or metadata. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/records/list-ids" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "namespace": "demo", "prefix": "v", "limit": 20 }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "ids": [ "v1", "v2" ] } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Fetch records by filter Read a page of vector records that match a metadata filter. Count vector records Count records in a vector namespace, with an optional metadata filter. Counts are exact. --- ## List vector indexes | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/list-indexes Database endpoints List vector indexes Read the vector indexes visible to the caller, in name order. POST /v1/tenants/{tenant}/vector-indexes/list Discover the vector indexes you can accessExact-name lookup cannot be combined with prefix or cursor. 01 Choose lookup or browsingRequest one name or a page of names. 02 Read visible configurationsInspect the indexes the caller may see. 03 Continue paginated resultsUse the returned cursor for another page. Before you start Use your database bearer token. Connection setup Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values name is an exact lookup (no pages, not combinable with prefix or cursor); prefix is 1-45 bytes of [a-z0-9-]; limit 1-100, default 100. Send {} to list everything. FieldTypeRequired cursorstringOptional limitintegerOptional namestringOptional prefixstringOptional Read the result indexes contains visible index configurations. Use a returned cursor to continue a paginated request; an exact name lookup is a different form and cannot be mixed with prefix or cursor. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/list" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "limit": 20 }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "indexes": [ { "index_id": "22222222-2222-4222-8222-222222222222", "name": "demo-search", "state": "active", "dimension": 3, "metric": "cosine", "score_direction": "higher_is_better", "sparse": false, "text_fields": [], "visibility_fields": [], "embedding": null, "deletion_protection": "disabled", "tags": {}, "identifier_profile": "unicode", "compat_family": "vectors", "created_at": "2026-10-30T00:00:00.000Z" } ] } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Create a vector index Create a vector index for dense vectors, sparse vectors or text, with an empty default namespace. Read a vector index Returns the configuration of a vector index, addressed by its id or name. --- ## List vector namespaces | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/list-namespaces Database endpoints List vector namespaces Read a vector index's namespaces and record counts, one page at a time. POST /v1/tenants/{tenant}/vector-indexes/{index}/namespaces/list Browse an index's record namespacesDeleting namespaces are not currently included by this endpoint. 01 Select the parent indexOptionally narrow names by prefix. 02 Read namespace countsInspect IDs, state and record counters. 03 Follow the next cursorContinue until no next page is returned. Before you start Use your database bearer token. Connection setup Use the target vector index and, where required, its namespace. The examples use index demo-search and namespace demo. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values prefix is 1-512 bytes; limit 1-100, default 100. include_deleting: true needs manage on the index and currently answers 501. FieldTypeRequired cursorstringOptional include_deletingbooleanOptional limitintegerOptional prefixstringOptional Read the result Each namespace includes its ID, state and counters. Continue with a returned cursor when present. include_deleting is not currently served, even for a caller with manage permission. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/namespaces/list" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "limit": 20 }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "namespaces": [ { "name": "demo", "namespace_id": "33333333-3333-4333-8333-333333333333", "state": "active", "record_count": 2, "pending_records": 0, "pending_new_records": 0, "dense_ids": 2, "sparse_ids": 0, "declared_capacity": 1000, "position": { "domain": "wal", "value": "1042:0" } } ] } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Create a vector namespace Create a namespace inside a vector index and optionally declare its record capacity. Read a vector namespace Returns a namespace of a vector index with its record counts. --- ## List row policies | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/list-rls Database endpoints List row policies Lists every row-level security policy in the tenant. GET /v1/tenants/{tenant}/db/rls Review the row filters stored for rolesUse the effective-policy endpoint for a particular user's view. 01 List stored row policiesRequest policies in the selected tenant. 02 Read each predicateMatch table, role and command to its row filter. 03 Check user-specific applicationReview effective policies for the intended user and table. Before you start Use your database bearer token. Connection setup Use an identity authorized to manage access in this tenant. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result policies shows the stored table, role, command and predicate for each row policy. Use the effective-policy endpoint to see how these policies apply to a particular user. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/rls" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error503 Error { "policies": [ { "role": "demo_reader", "command": "select", "using": "score >= 20", "table": "demo.people" } ] } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Set a row policy Creates or replaces the row-level security policy that limits which rows of a table a role can read. Check a user's row policies See which row policies apply to a user on a table, without running a query as that user. --- ## List roles | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/list-roles Database endpoints List roles Lists the tenant's database roles, including the built-in system roles. GET /v1/tenants/{tenant}/db/roles Inspect roles and their inheritanceBuilt-in system roles can appear without being editable. 01 Request the role inventoryList database roles in this tenant. 02 Inspect inherited rolesSee how permissions are shared between roles. 03 Recognize system rolesCheck the system flag before planning changes. Before you start Use your database bearer token. Connection setup Use an identity authorized to manage access in this tenant. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result roles includes inherited-role names and the system flag. Built-in roles appear in this listing; seeing a role here does not mean it can be edited or deleted. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/roles" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error503 Error { "roles": [ { "name": "demo_reader", "inherits": [], "system": false, "created_unix": 1793318400 } ] } Illustrative entry; system roles or other roles may also be returned. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Create role Creates a database role, optionally inheriting the privileges of existing roles. Delete role Remove a database role. References from grants, policies, users or other roles prevent deletion unless cascade is requested. --- ## List users | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/list-users Database endpoints List users Lists the tenant's database users with their authentication method, roles and number of API keys. GET /v1/tenants/{tenant}/db/users Review database users without exposing secretsKey counts are returned, not the key values. 01 List database usersRequest accounts in the selected tenant. 02 Review authentication and rolesCheck each user's method and access assignments. 03 Inspect account statusRead disabled state and API-key count. Before you start Use your database bearer token. Connection setup Use an identity authorized to manage access in this tenant. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Each user shows its roles, disabled state and api_key_count. The response counts keys without returning their secret values. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/users" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error503 Error { "users": [ { "username": "demo_user", "auth": "api_key", "roles": [ "demo_reader" ], "disabled": false, "api_key_count": 1, "created_unix": 1793318400 } ] } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Create user Creates a database user that authenticates with either a password or a generated API key. Create another user API key Issue another API key for a database user. Existing keys remain valid. --- ## Inspect permissions | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/matrix Database endpoints Inspect permissions See each role's effective table permissions and column masks, including inherited permissions. GET /v1/tenants/{tenant}/db/matrix Understand permissions after role inheritanceThe matrix explains access without running a query as that role. 01 Choose objects to inspectSelect tables or inspect the available scope. 02 Resolve role permissionsInclude inherited privileges and column masks. 03 Review the access matrixCompare effective permissions by role and object. Before you start Use your database bearer token. Connection setup Use an identity authorized to manage access in this tenant. Path parameters FieldTypeRequired tenantstringRequired Query parameters FieldTypeRequired objectsstringOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result For each object, roles shows effective privileges and masked columns, including inherited permissions. Use this to review access; it does not execute a query as the role. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/matrix?objects=demo.people" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error503 Error { "objects": [ { "object": "demo.people", "roles": { "demo_reader": { "priv": "S", "masked": [] } } } ] } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Remove a role's grant Revokes a role's grant on an object, removing every privilege and column mask it carried. Set a row policy Creates or replaces the row-level security policy that limits which rows of a table a role can read. --- ## Abort a schema migration | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/migrations-abort Database endpoints Abort a schema migration Aborts an in-progress migration and restores the table's previous shape. POST /v1/tenants/{tenant}/migrations/{id}/abort Restore a migration's previous table shapeThis is schema-migration recovery, not a rollback of unrelated application writes. 01 Inspect the migrationUse its ID and current progress. 02 Request an abortStop the identified schema migration. 03 Check the resulting stateConfirm the migration's reported recovery outcome. Before you start Use your database bearer token. Connection setup Use the ID returned by Start a schema migration. Check its state before cutover or abort. Path parameters FieldTypeRequired tenantstringRequired idstringRequired Query parameters FieldTypeRequired forcebooleanOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Check the returned state for the abort outcome. This operates on the identified schema migration; it is not cancellation of a data-import request or a general rollback of application writes. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/migrations/%3CMIGRATION_ID%3E/abort" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error429 Error500 Error501 Error503 Error { "id": "77777777-7777-4777-8777-777777777777", "tenant": "your-tenant", "schema": "demo.people", "state": "Aborted", "diff": [ { "AddColumn": { "name": "nickname", "ty": "str", "default": "New member" } } ], "progress": { "rows_seen": 0, "rows_written": 0, "chunks_done": 0, "chunks_total": 0 }, "version_before": 1, "version_after": 2 } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Complete a schema migration Switches a table over to its migrated shape and completes the migration. Subscribe to live changes Streams the live result of a natural-language query as Server-Sent Events, re-sending it whenever the data changes. --- ## Read migration history | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/migrations-audit Database endpoints Read migration history Read the recorded state changes of the tenant's schema migrations. GET /v1/tenants/{tenant}/migrations/_audit Trace a schema migration's state changesThis history is separate from the full database audit log. 01 Request migration historyRead recorded events for the tenant. 02 Follow state changesInspect actor, state and schema versions. 03 Reconstruct the change sequenceRelate events to the migration being investigated. Before you start Use your database bearer token. Connection setup Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Each entry records a migration event with its actor, state and schema versions. This is migration history, not the database's full audit log. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/migrations/_audit" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error500 Error503 Error [ { "id": "77777777-7777-4777-8777-777777777777", "tenant": "your-tenant", "schema": "demo.people", "version_before": 1, "version_after": 2, "state": "Pending", "at_secs": 1793318400, "actor": "demo_user", "event": "submit" } ] { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Check a schema migration Check the state and progress of one online schema migration. Complete a schema migration Switches a table over to its migrated shape and completes the migration. --- ## Complete a schema migration | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/migrations-cutover Database endpoints Complete a schema migration Switches a table over to its migrated shape and completes the migration. POST /v1/tenants/{tenant}/migrations/{id}/cutover Switch to a migration's new schemaCopying progress alone does not confirm cutover. 01 Check the migration is readyInspect its current state by ID. 02 Request the cutoverSwitch the table to the migrated shape. 03 Confirm CompletedCompare the before and after schema versions. Before you start Use your database bearer token. Connection setup Use the ID returned by Start a schema migration. Check its state before cutover or abort. Path parameters FieldTypeRequired tenantstringRequired idstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result state: Completed confirms the switch to the migrated schema shape. Compare version_before and version_after; copied-row progress alone was not the cutover confirmation. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/migrations/%3CMIGRATION_ID%3E/cutover" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error429 Error500 Error501 Error503 Error { "id": "77777777-7777-4777-8777-777777777777", "tenant": "your-tenant", "schema": "demo.people", "state": "Completed", "diff": [ { "AddColumn": { "name": "nickname", "ty": "str", "default": "New member" } } ], "progress": { "rows_seen": 3, "rows_written": 3, "chunks_done": 1, "chunks_total": 1 }, "version_before": 1, "version_after": 2 } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Read migration history Read the recorded state changes of the tenant's schema migrations. Abort a schema migration Aborts an in-progress migration and restores the table's previous shape. --- ## Check a schema migration | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/migrations-get Database endpoints Check a schema migration Check the state and progress of one online schema migration. GET /v1/tenants/{tenant}/migrations/{id} Track copying separately from schema cutoverCutoverPending still needs the explicit cutover step. 01 Keep the migration IDUse the ID returned when changes were submitted. 02 Read state and progressInspect row and chunk copying work. 03 Choose the next operationCut over or investigate according to the reported state. Before you start Use your database bearer token. Connection setup Use the ID returned by Start a schema migration. Check its state before cutover or abort. Path parameters FieldTypeRequired tenantstringRequired idstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Read state before taking action. Row and chunk progress show copying work; CutoverPending still needs the cutover step. Use this endpoint to track the ID returned at submission. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/migrations/%3CMIGRATION_ID%3E" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error503 Error { "id": "77777777-7777-4777-8777-777777777777", "tenant": "your-tenant", "schema": "demo.people", "state": "CutoverPending", "diff": [ { "AddColumn": { "name": "nickname", "ty": "str", "default": "New member" } } ], "progress": { "rows_seen": 3, "rows_written": 3, "chunks_done": 1, "chunks_total": 1 }, "version_before": 1, "version_after": 2 } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List schema migrations Lists the tenant's online schema migrations that the caller may see. Read migration history Read the recorded state changes of the tenant's schema migrations. --- ## List schema migrations | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/migrations-list Database endpoints List schema migrations Lists the tenant's online schema migrations that the caller may see. GET /v1/tenants/{tenant}/migrations Find schema changes that need attentionOpen an individual migration before cutting it over or aborting it. 01 List visible migrationsRead the tenant's migrations permitted to the caller. 02 Compare targets and statesIdentify the affected schemas and progress. 03 Inspect the selected migrationUse its ID to examine current details. Before you start Use your database bearer token. Connection setup Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Each item identifies a migration, its target schema, state and progress. Open the individual migration before deciding to cut over or abort it. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/migrations" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error503 Error [ { "id": "77777777-7777-4777-8777-777777777777", "tenant": "your-tenant", "schema": "demo.people", "state": "Pending", "diff": [ { "AddColumn": { "name": "nickname", "ty": "str", "default": "New member" } } ], "progress": { "rows_seen": 0, "rows_written": 0, "chunks_done": 0, "chunks_total": 0 }, "version_before": 1, "version_after": 2 } ] { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Start a schema migration Start a background migration that changes an existing table's schema. Check a schema migration Check the state and progress of one online schema migration. --- ## Start a schema migration | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/migrations-submit Database endpoints Start a schema migration Start a background migration that changes an existing table's schema. POST /v1/tenants/{tenant}/migrations Begin a change to an existing tableAccepted changes still need progress checks and cutover. 01 Describe the schema changeSupply the table and ordered changes. 02 Submit the migrationKeep the returned migration ID. 03 Follow progress to cutoverPending does not mean the table has switched. Before you start Use your database bearer token. Connection setup Register the table first. Only one schema migration can be active on a table; keep the returned ID to check its progress. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values schema is the table id; diff is applied in order. A second migration on a table that already has one in flight answers 400. FieldTypeRequired diffobject[]Required Fields in diff FieldTypeRequired AddColumnobjectOptional Fields in AddColumn FieldTypeRequired defaultany JSONOptional namestringRequired tystringRequired FieldTypeRequired ChangeColumnTypeobjectOptional Fields in ChangeColumnType FieldTypeRequired namestringRequired new_tystringRequired FieldTypeRequired ChangeExtractionPathobjectOptional Fields in ChangeExtractionPath FieldTypeRequired namestringRequired new_pathstringRequired FieldTypeRequired DropColumnobjectOptional Fields in DropColumn FieldTypeRequired namestringRequired FieldTypeRequired RenameColumnobjectOptional Fields in RenameColumn FieldTypeRequired fromstringRequired tostringRequired FieldTypeRequired SetColumnDefaultobjectOptional Fields in SetColumnDefault FieldTypeRequired defaultany JSONOptional namestringRequired FieldTypeRequired SetColumnNullabilityobjectOptional Fields in SetColumnNullability FieldTypeRequired namestringRequired requiredbooleanRequired FieldTypeRequired schemastringRequired Read the result Save the returned migration id. Pending means the migration was accepted, not that the table has switched to its new shape. Check progress and perform cutover when ready. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/migrations" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "schema": "demo.people", "diff": [ { "AddColumn": { "name": "nickname", "ty": "str", "default": "New member" } } ] }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "id": "77777777-7777-4777-8777-777777777777", "tenant": "your-tenant", "schema": "demo.people", "state": "Pending", "diff": [ { "AddColumn": { "name": "nickname", "ty": "str", "default": "New member" } } ], "progress": { "rows_seen": 0, "rows_written": 0, "chunks_done": 0, "chunks_total": 0 }, "version_before": 1, "version_after": 2 } Synthetic migration id; state and progress are observed asynchronously. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Import from object storage Load CSV and NDJSON objects from a storage-bucket prefix into an existing table. List schema migrations Lists the tenant's online schema migrations that the caller may see. --- ## Drop a materialized view | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/mv-drop Database endpoints Drop a materialized view Drops a materialized view and everything stored for it. DELETE /v1/tenants/{tenant}/sql/materialized-views/{name} Remove a materialized view's stored resultThe source table is not dropped by this operation. 01 Confirm the view nameSelect the stored view to remove. 02 Drop the viewRemove its definition and materialized contents. 03 Read the dropped resultKeep source-table operations separate. Before you start Use your database bearer token. Connection setup Use the exact name of the view to remove. The example deletes demo_scores. Path parameters FieldTypeRequired tenantstringRequired namestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result dropped confirms removal of the named view and its stored contents. This is not a request to drop the view's source table. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request DELETE "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/sql/materialized-views/demo_scores" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error500 Error501 Error502 Error503 Error { "dropped": true, "name": "demo_scores" } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Refresh a materialized view Recomputes a materialized view from its base table and replaces its stored rows. Store a vector Stores one dense vector, with optional metadata, in a vector collection. --- ## Create a materialized view | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/mv-install Database endpoints Create a materialized view Creates a materialized view from a SQL SELECT and materializes its initial contents. POST /v1/tenants/{tenant}/sql/materialized-views Save a query result as a viewAn on-demand view needs refreshes to reflect later source changes. 01 Define the view querySupply SELECT, source table and refresh mode. 02 Materialize the initial resultStore the rows produced by that query. 03 Inspect rows and refresh timeUse the counts and timestamp to verify creation. Before you start Use your database bearer token. Connection setup Create and populate the source table before creating its view. The example reads demo.people. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values refresh_mode is "on_demand" (default; stale until refreshed) or "incremental" (maintained on every write; only filter/projection views and COUNT/SUM/AVG rollups qualify, otherwise 422). source_schema optionally names the base table as "namespace.table" and must agree with the query's FROM. auto=true chooses incremental when the query shape allows it and on_demand otherwise. 409 when the name already exists. FieldTypeRequired namestringRequired querystringRequired refresh_modestringOptional source_schemastringOptional Read the result rows_materialized reports the initial stored rows and refresh_ts identifies the refresh. An on_demand view becomes stale until refreshed; choosing it does not keep the view current automatically. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/sql/materialized-views" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "name": "demo_scores", "query": "SELECT id, score FROM demo.people", "source_schema": "demo.people", "refresh_mode": "on_demand" }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error502 Error503 Error { "name": "demo_scores", "rows_materialized": 3, "bytes_written": 128, "refresh_ts": 1793318400000 } Illustrative materialization counts and timestamp; refresh before reading current on-demand results. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Roll back a transaction Discards every write buffered in the transaction and closes it. List materialized views Lists the materialized views installed for the tenant with their refresh mode and base table. --- ## List materialized views | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/mv-list Database endpoints List materialized views Lists the materialized views installed for the tenant with their refresh mode and base table. GET /v1/tenants/{tenant}/sql/materialized-views Find stored views and their freshness settingsA listed view may still need warming or refresh. 01 List installed viewsRequest the tenant's view definitions. 02 Inspect source and refresh modeIdentify how each view relates to its base table. 03 Check the warming stateDecide whether its stored result is ready for use. Before you start Use your database bearer token. Connection setup Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Inspect each view's refresh_mode, source_schema and warming state. A listed view may still need refresh or warming before its stored rows suit your use case. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/sql/materialized-views" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error503 Error [ { "name": "demo_scores", "refresh_mode": "on_demand", "source_schema": "demo.people", "warming": false } ] { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Create a materialized view Creates a materialized view from a SQL SELECT and materializes its initial contents. Read a materialized view Returns the rows of a materialized view, filtered and masked by the caller's row-level policies. --- ## Read a materialized view | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/mv-read Database endpoints Read a materialized view Returns the rows of a materialized view, filtered and masked by the caller's row-level policies. GET /v1/tenants/{tenant}/sql/materialized-views/{name} Read a view through the caller's policiesStored view rows may be older than the base table. 01 Select the viewIdentify the materialized result to read. 02 Apply row policies and masksRestrict the stored data for this caller. 03 Read the returned rowsRefresh an on-demand view when updated contents are needed. Before you start Use your database bearer token. Connection setup Use an existing materialized view. The example targets demo_scores; on-demand views must be refreshed when you need updated rows. Path parameters FieldTypeRequired tenantstringRequired namestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result rows contains stored view data after the caller's row policies and masks. This is not necessarily a fresh read of the base table; refresh an on-demand view when you need updated contents. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/sql/materialized-views/demo_scores" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error500 Error502 Error503 Error { "name": "demo_scores", "rows": [ { "id": "u1", "score": 10 }, { "id": "u2", "score": 20 }, { "id": "u3", "score": 30 } ] } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List materialized views Lists the materialized views installed for the tenant with their refresh mode and base table. Refresh a materialized view Recomputes a materialized view from its base table and replaces its stored rows. --- ## Refresh a materialized view | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/mv-refresh Database endpoints Refresh a materialized view Recomputes a materialized view from its base table and replaces its stored rows. POST /v1/tenants/{tenant}/sql/materialized-views/{name}/refresh Recompute a view from current source rowsRefresh replaces stored contents without changing the view definition. 01 Identify the stored viewSelect the view whose contents need updating. 02 Re-run its source queryRecompute and replace the materialized rows. 03 Check count and refresh timeInspect rows_materialized and refresh_ts. Before you start Use your database bearer token. Connection setup Use an existing materialized view. The example targets demo_scores; on-demand views must be refreshed when you need updated rows. Path parameters FieldTypeRequired tenantstringRequired namestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result rows_materialized and refresh_ts describe the replacement contents. This refresh recomputes the view from its source; it does not change the view definition. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/sql/materialized-views/demo_scores/refresh" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error422 Error429 Error500 Error501 Error502 Error503 Error { "name": "demo_scores", "rows_materialized": 3, "bytes_written": 128, "refresh_ts": 1793318400000 } Illustrative materialization counts and timestamp; refresh before reading current on-demand results. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Read a materialized view Returns the rows of a materialized view, filtered and masked by the caller's row-level policies. Drop a materialized view Drops a materialized view and everything stored for it. --- ## Import from MySQL | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/mysql-ingest-sync Database endpoints Import from MySQL Copy MySQL tables into the tenant with a full or incremental sync. Missing destination tables are created. POST /v1/tenants/{tenant}/ingest/mysql/sync Copy MySQL data and keep a cursorValidate imported records before redirecting application traffic. 01 Map the source tablesChoose destination IDs, keys and sync modes. 02 Run the table syncCopy full or incremental data into the tenant. 03 Save the returned cursorUse rows_synced and new_cursor_unix_ms for follow-up checks. Before you start Use your database bearer token. Connection setup Use source credentials for a MySQL host allowed by the operator. Replace the connection placeholder before sending the request. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values conn_url is a MySQL connection URL that carries the source database credentials: a write-only secret, never echoed back. The source host must be on the server's ingest allow-list (deny-all by default). tables must contain at least one entry. FieldTypeRequired conn_urlstringRequired tablesobject[]Required Fields in tables FieldTypeRequired dest_schema_idstringRequired modestringRequired primary_keystring[]Optional Fields in primary_key FieldTypeRequired primary_keystringOptional FieldTypeRequired since_unix_msintegerOptional src_schemastringRequired src_tablestringRequired updated_at_colstringOptional Read the result Each result pairs a source table with its destination and rows_synced. Keep new_cursor_unix_ms when continuing an incremental sync. Verify the imported rows before changing application traffic. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/ingest/mysql/sync" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "conn_url": "", "tables": [ { "src_schema": "source_db", "src_table": "people", "dest_schema_id": "demo.people", "mode": "full", "primary_key": [ "id" ] } ] }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error502 Error503 Error { "results": [ { "src": "source_db.people", "dest": "demo.people", "rows_synced": 3, "new_cursor_unix_ms": 1793318400000 } ] } Assumes the source table contains the three example rows; cursor is illustrative. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Import from PostgreSQL Copy tables from an allowed PostgreSQL source with a full or incremental sync. Import from object storage Load CSV and NDJSON objects from a storage-bucket prefix into an existing table. --- ## Import from PostgreSQL | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/pg-ingest-sync Database endpoints Import from PostgreSQL Copy tables from an allowed PostgreSQL source with a full or incremental sync. POST /v1/tenants/{tenant}/ingest/postgres/sync Copy PostgreSQL tables in request orderA later failure does not undo tables copied earlier in the request. 01 Map an allowed sourceSet source tables, destination IDs and sync options. 02 Sync tables in orderProcessing stops at the first failure. 03 Review results and cursorsVerify each completed table before continuing. Before you start Use your database bearer token. Connection setup Use source credentials for a PostgreSQL host allowed by the operator. Replace the connection placeholder before sending the request. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values The host in conn_url must be on the operator's allow-list, otherwise 403. tables must not be empty; tables sync in order and the first failure stops the request. FieldTypeRequired conn_urlstringRequired tablesobject[]Required Fields in tables FieldTypeRequired dest_schema_idstringRequired modestringRequired primary_keystring[]Optional Fields in primary_key FieldTypeRequired primary_keystringOptional FieldTypeRequired since_unix_msintegerOptional src_schemastringRequired src_tablestringRequired updated_at_colstringOptional Read the result Each result reports source, destination, rows synced and a new cursor. Tables run in order and the first failure stops the request; inspect prior results instead of assuming an all-or-nothing import. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/ingest/postgres/sync" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "conn_url": "", "tables": [ { "src_schema": "public", "src_table": "people", "dest_schema_id": "demo.people", "mode": "full", "primary_key": [ "id" ] } ] }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error502 Error503 Error { "results": [ { "src": "public.people", "dest": "demo.people", "rows_synced": 3, "new_cursor_unix_ms": 1793318400000 } ] } Assumes the source table contains the three example rows; cursor is illustrative. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Import a CSV or NDJSON file Upload a CSV or NDJSON file and load its rows into an existing table. Import from MySQL Copy MySQL tables into the tenant with a full or incremental sync. Missing destination tables are created. --- ## Set a role's permissions | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/put-grant Database endpoints Set a role's permissions Set a role's permissions and optional column masks for a table or all tables. This replaces the role's existing grant on that object. POST /v1/tenants/{tenant}/db/grants Replace a role's permissions on an objectInclude every privilege and column mask that this grant should retain. 01 Choose the role and objectIdentify the table or all-table grant. 02 Supply the complete grantSet privilege text and optional masked columns. 03 Confirm granted trueReview effective access after the replacement. Before you start Use your database bearer token. Connection setup Use an identity allowed to manage grants. Create the role before granting it permissions. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values privileges is TEXT, not a list: SQL words ALL, SELECT, INSERT, UPDATE, DELETE, REFERENCES, NONE and/or letter sets from S,I,U,D,R (e.g. SIUDR, SI, "SELECT, INSERT"), separated by commas, spaces, + or |. An unrecognised token is a 400. object is a table id namespace.table or *. FieldTypeRequired masked_columnsstring[]Optional Fields in masked_columns FieldTypeRequired masked_columnsstringOptional FieldTypeRequired objectstringRequired privilegesstringRequired rolestringRequired Read the result granted: true confirms the replacement grant. privileges is text, such as SELECT or SI, not a JSON array. Include every permission and mask you want this grant to retain. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/grants" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "role": "demo_reader", "object": "demo.people", "privileges": "SELECT" }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "granted": true } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete role Remove a database role. References from grants, policies, users or other roles prevent deletion unless cascade is requested. List grants Read the permissions and masked columns granted to each role on each object. --- ## Set a row policy | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/put-rls Database endpoints Set a row policy Creates or replaces the row-level security policy that limits which rows of a table a role can read. POST /v1/tenants/{tenant}/db/rls Store a role's filter for readable rowsHere, select and all policies apply to reads. 01 Choose the role and tableIdentify whose rows should be restricted. 02 Define the row predicateSupply the using expression and command. 03 Confirm the stored policyCheck effective policy selection for the intended user. Before you start Use your database bearer token. Connection setup Use an identity authorized to manage access. Create the role and table first; the new policy replaces their existing policy. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values using is a predicate such as "owner = CURRENT_USER AND region IN ('us','eu')" and is validated at create time (invalid = 400). command defaults to select and is stored lower-cased; it is not validated, and only select and all policies are applied to reads. One policy per (table, role); a new one replaces the old. FieldTypeRequired commandstringOptional rolestringRequired tablestringRequired usingstringRequired Read the result ok: true confirms the stored policy. using is the row predicate. Only select and all policies apply to reads here; a stored command name is not proof that other operation types are enforced. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/rls" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "table": "demo.people", "role": "demo_reader", "command": "select", "using": "score >= 20" }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "ok": true } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Inspect permissions See each role's effective table permissions and column masks, including inherited permissions. List row policies Lists every row-level security policy in the tenant. --- ## Execute a query plan | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/query-exec Database endpoints Execute a query plan Executes a read query plan and returns the matching rows. POST /v1/tenants/{tenant}/query Turn a read plan into matching rowsThis endpoint accepts a plan tree, not SQL or write operators. 01 Build the read planDescribe operations in an op-tagged tree. 02 Execute the planApply its scans, filters and other read operations. 03 Read the matching rowsInterpret the result according to the chosen plan. Before you start Use your database bearer token. Connection setup Register the table your plan reads. The example scans demo.people; query plans on this endpoint are read-only. Path parameters FieldTypeRequired tenantstringRequired Query parameters FieldTypeRequired explainstringOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values A query plan node tagged by op (snake_case operator name) with operator-specific fields; nested plans use the same shape. Write operators are refused with 400. FieldTypeRequired opstringRequired Read the result The response is the rows returned by the read plan. The body is a plan tree tagged by op, not a SQL string. Write operators are rejected on this endpoint. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/query" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "op": "scan", "schema": "demo.people" }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error409 Error413 Error415 Error422 Error429 Error499 Error500 Error501 Error502 Error503 Error [ { "id": "u1", "follows_id": "u2", "score": 10 }, { "id": "u2", "follows_id": "u3", "score": 20 }, { "id": "u3", "follows_id": "u1", "score": 30 } ] { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Execute SQL Run SQL and receive rows for a query or a summary for a write or schema change. Begin a transaction Opens a multi-statement transaction at snapshot or serializable isolation and returns its id. --- ## Read query metrics | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/query-metrics Database endpoints Read query metrics Read query completion counts and mean latency from the running process, without collecting query text. GET /v1/tenants/{tenant}/query-metrics Read query activity over a time windowMetrics belong to the running process and restart with it. 01 Choose the time bucketsSet the window and bucket size. 02 Read calls and failuresInspect counts and mean latency per bucket. 03 Calculate rates carefullyUse observed_seconds; idle latency may be null. Before you start Use your database bearer token. Connection setup Use a tenant service credential or query administrator; supported windows are 60/60, 1440/600 and 10080/3600 minutes/bucket_seconds. Path parameters FieldTypeRequired tenantstringRequired Query parameters FieldTypeRequired minutesintegerRequired bucket_secondsintegerRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Read calls, failed and mean_latency_ms per bucket. Divide by observed_seconds when calculating rates. The history belongs to the local process and restarts with it; idle latency can be null. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/query-metrics?minutes=60&bucket_seconds=60" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error422 Error429 Error503 Error { "schema_version": 1, "tenant_id": "your-tenant", "from": 1793318400000, "to": 1793318460000, "bucket_seconds": 60, "collection_started_at": 1793318400000, "scope": "local-process", "retention_seconds": 604800, "buckets": [ { "at": 1793318400000, "calls": 3, "failed": 0, "mean_latency_ms": 12.5, "observed_seconds": 60 } ], "dropped_events": 0 } Illustrates a 60-minute request clipped to a process that started one minute ago; all metrics are synthetic. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Read query statistics Read query counts, latency, row counts and cache hits. Find slow queries Read recent queries and their latency, optionally filtering by a minimum duration. --- ## Read query statistics | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/query-stats Database endpoints Read query statistics Read query counts, latency, row counts and cache hits. GET /v1/tenants/{tenant}/query-stats Inspect grouped query statisticsAn empty fingerprint list is not proof every query succeeded. 01 Request query statisticsRead the process's observed query summary. 02 Inspect each fingerprintCompare calls, latency, row counts and cache hits. 03 Check the collection startUse since_unix to understand the covered history. Before you start Use your database bearer token. Connection setup Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Returns per-fingerprint statistics for the tenant's read queries (call count, latency percentiles, average rows and cache-hit rate), collected in memory since the server last started. Read the result since_unix gives the collection start and fingerprints groups observed query statistics. An empty list means there are no reported fingerprint entries, not proof that every query succeeded. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/query-stats" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error500 Error503 Error { "since_unix": 1793318400, "fingerprints": [] } Empty statistics window is valid; populated entries depend on actual executed queries. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Read usage and limits Returns the tenant's configuration, limits and live usage counters. Read query metrics Read query completion counts and mean latency from the running process, without collecting query text. --- ## Check readiness | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/ready Database endpoints Check readiness Reports whether the engine can serve traffic, including write and read readiness and any pressure conditions. GET /ready Decide whether traffic can be servedA process can be alive while reads or writes are not ready. 01 Select the readiness requirementCheck the workload you plan to send. 02 Inspect read and write readinessEvaluate the relevant readiness flags. 03 Read pressure detailsInvestigate reported storage or pressure restrictions. Before you start No bearer credential declared by the contract. Connection setup Query parameters FieldTypeRequired requirestringOptional Read the result Use read_ready and write_ready for the traffic you plan to send. pressure and storage state explain readiness restrictions; a live process alone does not establish read or write readiness. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/ready" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error503 Error { "status": "ready", "read_ready": true, "write_ready": true, "rss_mib": 128, "pressure": [], "storage": { "state": "ok" } } Illustrative healthy process; readiness is deployment-specific. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Check health Reports that the engine process is alive, with a constant JSON body. Retrieve engine version Returns the engine's version, build stamps and storage health. --- ## Report client diagnostics | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/report-client-diagnostics Database endpoints Report client diagnostics Send an opted-in SDK's call diagnostics to the database's telemetry pipeline. POST /v1/tenants/{tenant}/diagnostics Report opted-in client call metadataAccepted diagnostics do not mean the database queries succeeded. 01 Collect opted-in diagnosticsPrepare call timing, transport and outcome metadata. 02 Submit the event batchOne invalid event rejects the request. 03 Inspect accepted and droppedCheck how the telemetry pipeline handled the batch. Before you start Use your database bearer token. Connection setup Send only observed metadata from a client that has opted in. Replace the example path, version, request ID and timings; never include SQL, row data, credentials or stack traces. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values 1 to 32 events per request. A request with one invalid event is refused whole (422 invalid_diagnostics) and relays nothing. Reporting is opt-in. Check whether your installed SDK exposes a diagnostics reporter; a local request observer does not automatically send events to this endpoint. FieldTypeRequired eventsobject[]Required Fields in events FieldTypeRequired attemptintegerOptional clientstringRequired client_versionstringRequired duration_msnumberRequired error_categorystringOptional error_codestringOptional http_statusintegerOptional logical_request_idstringRequired methodstringRequired outcomestringRequired pathstringRequired request_idstringOptional transportstringOptional Read the result accepted and dropped describe diagnostic events, not successful database queries. Send only opted-in call metadata; a single invalid event rejects the request rather than partially relaying it. Response statuses HTTP status reference StatusWhat to do 202Accepted 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/diagnostics" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "events": [ { "client": "python", "client_version": "0.9.0", "method": "POST", "path": "/v1/tenants/demo/sql", "outcome": "success", "duration_ms": 12.5, "http_status": 200, "logical_request_id": "11111111-1111-4111-8111-111111111111", "attempt": 1 } ] }' Response example Examples use synthetic values to show the response format. Response status202 Success401 Error402 Error403 Error413 Error415 Error422 Error429 Error503 Error { "accepted": 1, "dropped": 0 } Illustrates enabled telemetry accepting the single submitted event; disabled telemetry instead drops it and adds telemetry:"off". { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Find slow queries Read recent queries and their latency, optionally filtering by a minimum duration. Check a background job Check the state and progress of a filtered vector-record update or delete job. --- ## Remove a role's grant | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/revoke-grant Database endpoints Remove a role's grant Revokes a role's grant on an object, removing every privilege and column mask it carried. DELETE /v1/tenants/{tenant}/db/grants Remove a complete role-and-object grantRevocation succeeds even when that grant is already absent. 01 Identify the role and objectSelect the exact permission grant. 02 Revoke the grantRemove all its privileges and column masks. 03 Review remaining effective accessOther grants and inherited roles may still apply. Before you start Use your database bearer token. Connection setup Use an identity authorized to manage access. Send the target role and object in the DELETE request's JSON body. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values Sent as a JSON body on DELETE (not a query string). Removes the whole grant row; there is no partial-privilege revoke. Succeeds even when no such grant exists. FieldTypeRequired objectstringRequired rolestringRequired Read the result revoked: true also succeeds if the grant was absent. This removes the whole role/object grant, including masks; it is not a partial removal of one privilege. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request DELETE "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/grants" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "role": "demo_reader", "object": "demo.people" }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "revoked": true } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List grants Read the permissions and masked columns granted to each role on each object. Inspect permissions See each role's effective table permissions and column masks, including inherited permissions. --- ## Check a user's row policies | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/rls-effective Database endpoints Check a user's row policies See which row policies apply to a user on a table, without running a query as that user. GET /v1/tenants/{tenant}/db/rls/effective Explain a user's applicable row policiesThis inspection does not execute a query or return visible rows. 01 Select user and tableChoose the access combination to investigate. 02 Evaluate policy selectionInspect restricted, superuser and policy-applies flags. 03 Read the explanationUse it to understand the applicable row filters. Before you start Use your database bearer token. Connection setup Use an identity authorized to manage access in this tenant. Path parameters FieldTypeRequired tenantstringRequired Query parameters FieldTypeRequired userstringRequired tablestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Check restricted, is_superuser and each policy's applies flag. This explains policy selection for the requested user/table; it does not run a query or return the rows they would see. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/rls/effective?user=demo_user&table=demo.people" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error503 Error { "user": "demo_user", "table": "demo.people", "is_superuser": false, "restricted": true, "policies": [ { "role": "demo_reader", "command": "select", "using": "score >= 20", "applies": true } ] } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List row policies Lists every row-level security policy in the tenant. Delete a row policy Deletes the row-level security policy for a role on a table. --- ## Create another user API key | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/rotate-user-key Database endpoints Create another user API key Issue another API key for a database user. Existing keys remain valid. POST /v1/tenants/{tenant}/db/users/{username}/api-key Issue another key for a database userExisting keys remain valid after this request. 01 Identify the database userChoose the account needing another API key. 02 Issue an additional keyGenerate a credential for that user. 03 Store the returned key securelyUpdate the intended application without exposing the secret. Before you start Use your database bearer token. Connection setup Use an identity authorized to manage access and the intended username. This creates an additional key; older keys remain valid. Path parameters FieldTypeRequired tenantstringRequired usernamestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Store the returned api_key securely. This creates an additional key for the database user; it does not invalidate older keys despite the operation's rotation name. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/db/users/demo_user/api-key" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error429 Error500 Error501 Error503 Error { "api_key": "" } Credential placeholder; rotate clients to the actual returned key. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List users Lists the tenant's database users with their authentication method, roles and number of API keys. Delete user Deletes a database user and all of its credentials. --- ## Delete a row | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/row-delete Database endpoints Delete a row Deletes one row by primary key outside a transaction; deleting a missing row succeeds with deleted set to false. DELETE /v1/tenants/{tenant}/rows/{schema}/{pk} Delete one record by its primary keyA missing row is a successful request with deleted set to false. 01 Select the table and keyIdentify the exact row to remove. 02 Request row deletionDelete outside a transaction. 03 Check the deleted flagDistinguish a removed row from an already absent one. Before you start Use your database bearer token. Connection setup Use the intended table and primary key. The example deletes u1 from demo.people. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired pkstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result deleted: true means a row was removed. deleted: false is a successful request for a key that was already absent, so do not count every successful response as one deleted row. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request DELETE "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/rows/demo.people/u1" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error429 Error500 Error501 Error503 Error { "deleted": true } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Update a row conditionally Write a row by primary key, with an optional version check through If-Match. Execute SQL Run SQL and receive rows for a query or a summary for a write or schema change. --- ## Retrieve a row | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/row-get Database endpoints Retrieve a row Fetches one row by its primary key. GET /v1/tenants/{tenant}/rows/{schema}/{pk} Open a single record by its keyThis returns one row rather than a filtered list. 01 Select the tableUse the registered schema ID. 02 Supply the primary keyLocate the exact record to read. 03 Read its column valuesKeep a returned version for a later conditional write. Before you start Use your database bearer token. Connection setup Use an existing table and primary key. Save _oc_row_version if you plan a conditional update. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired pkstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result The body is the row's column values. If a row version is returned, keep it for a conditional write. The lookup uses one primary key; it is not a filtered list query. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/rows/demo.people/u1" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error500 Error503 Error { "id": "u1", "follows_id": "u2", "score": 10 } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Write a batch Writes many rows in one request, from a JSON array or a newline-delimited JSON stream. Update a row conditionally Write a row by primary key, with an optional version check through If-Match. --- ## Update a row conditionally | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/row-put-cas Database endpoints Update a row conditionally Write a row by primary key, with an optional version check through If-Match. PUT /v1/tenants/{tenant}/rows/{schema}/{pk} Update only the row version you readWithout If-Match, this request is an unconditional upsert. 01 Read the current rowKeep the version associated with that record. 02 Send a conditional writeSupply the expected version through If-Match. 03 Check success or conflictOn 409, read and reconcile the newer row. Before you start Use your database bearer token. Connection setup For a conditional update, read the row and use its _oc_row_version in If-Match. Without that header, the request is an unconditional upsert. Do not combine If-Match with expect=insert. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired pkstringRequired Query parameters FieldTypeRequired expectstringOptional chunkintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values The full row as a JSON object keyed by column name; its primary key must match the path. Without an If-Match header this is an unconditional upsert. If-Match: (bare or quoted) requires the row to be at version n (its _oc_row_version); If-Match: * requires the row to exist. A stale version answers 409 write_conflict with current_version; a missing row answers 412 precondition_failed. Weak or list-valued If-Match is refused (400), as is ?expect=insert combined with If-Match. ?expect=insert alone makes the write insert-only. ?chunk is accepted but only affects NDJSON ingest. Honors Idempotency-Key. FieldTypeRequiredDescription FieldsobjectOptionalThe full row as a JSON object keyed by column name; its primary key must match the path. Without an If-Match header this is an unconditional upsert. If-Match: (bare or quoted) requires the row to be at version n (its _oc_row_version); If-Match: * requires the row to exist. A stale version answers 409 write_conflict with current_version; a missing row answers 412 precondition_failed. Weak or list-valued If-Match is refused (400), as is ?expect=insert combined with If-Match. ?expect=insert alone makes the write insert-only. ?chunk is accepted but only affects NDJSON ingest. Honors Idempotency-Key. Read the result version is the row version after a successful write. A stale If-Match returns 409; read the current row and reconcile your change rather than overwriting it blindly. Without If-Match, the request is an unconditional upsert. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 412Refresh the version or ETag before writing again. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request PUT "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/rows/demo.people/u1" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --header "If-Match: ${OC_ROW_VERSION}" \ --data-binary '{ "id": "u1", "follows_id": "u2", "score": 11 }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error412 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "ok": true, "version": 2 } version and a quoted ETag appear only when If-Match was sent; an unconditional upsert returns ok without version. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "write_conflict", "current_version": 3 } Re-read the row and deliberately apply the update against its latest version. Resolve the conflict before retrying. { "error": "precondition_failed" } The If-Match precondition required an existing row. Refresh the version or ETag before writing again. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Retrieve a row Fetches one row by its primary key. Delete a row Deletes one row by primary key outside a transaction; deleting a missing row succeeds with deleted set to false. --- ## Write a row | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/rows-put Database endpoints Write a row Insert a row or replace the row with the same primary key. POST /v1/tenants/{tenant}/rows/{schema} Insert or replace a row by keyUse expect=insert when an existing key should fail instead of being replaced. 01 Prepare the row fieldsMatch the registered table's columns and primary key. 02 Write the rowIts key determines insertion or replacement. 03 Check the write resultRead ok before continuing with dependent work. Before you start Use your database bearer token. Connection setup Register the destination table first. The example writes one row to demo.people. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired expectstringOptional chunkintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values One row keyed by column name; the table's manifest defines the columns. With ?expect=insert an existing primary key is rejected with 409. Honors Idempotency-Key. FieldTypeRequiredDescription FieldsobjectOptionalOne row keyed by column name; the table's manifest defines the columns. With ?expect=insert an existing primary key is rejected with 409. Honors Idempotency-Key. Read the result ok: true confirms the write request. The primary key decides which row is inserted or replaced. Use expect=insert if an existing key should fail rather than be replaced. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/rows/demo.people" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "id": "u1", "follows_id": "u2", "score": 10 }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "ok": true } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete all schemas Deletes every table in the tenant and irreversibly purges all of their data. Write a batch Writes many rows in one request, from a JSON array or a newline-delimited JSON stream. --- ## Write a batch | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/rows-put-batch Database endpoints Write a batch Writes many rows in one request, from a JSON array or a newline-delimited JSON stream. POST /v1/tenants/{tenant}/rows/{schema}/_batch Write rows with the right batch boundaryNDJSON commits in chunks; later failures can leave earlier chunks written. 01 Choose JSON array or NDJSONMatch the request format to your ingestion workflow. 02 Send the row batchValidate rows against the destination table. 03 Inspect inserted and errorCheck partial progress before retrying a failed stream. Before you start Use your database bearer token. Connection setup Register the destination table first. The example writes three linked rows to demo.people. Path parameters FieldTypeRequired tenantstringRequired schemastringRequired Query parameters FieldTypeRequired expectstringOptional chunkintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values A JSON array (up to 64 MiB) is written atomically. Send Content-Type application/x-ndjson, application/jsonl or application/ndjson to stream one JSON row per line instead, committed in chunks of ?chunk rows (default 1000, max 10000). With ?expect=insert a duplicate primary key is rejected with 409. Honors Idempotency-Key. FieldTypeRequiredDescription Fieldsobject[]OptionalA JSON array (up to 64 MiB) is written atomically. Send Content-Type application/x-ndjson, application/jsonl or application/ndjson to stream one JSON row per line instead, committed in chunks of ?chunk rows (default 1000, max 10000). With ?expect=insert a duplicate primary key is rejected with 409. Honors Idempotency-Key. Array itemobjectOptionalOne row keyed by column name. Read the result inserted reports the rows written. JSON-array and NDJSON requests have different commit boundaries: an NDJSON stream commits in chunks, so a later failure can leave earlier chunks written. Response statuses HTTP status reference StatusWhat to do 200OK 207See the error body 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/rows/demo.people/_batch" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '[ { "id": "u1", "follows_id": "u2", "score": 10 }, { "id": "u2", "follows_id": "u3", "score": 20 }, { "id": "u3", "follows_id": "u1", "score": 30 } ]' Response example Examples use synthetic values to show the response format. Response status200 Success207 Partial result400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "inserted": 3 } The displayed JSON array writes all three rows atomically. { "inserted": 2, "error": "Example streaming failure after committed chunks." } 207 applies to a separate NDJSON streaming request, not the displayed atomic JSON array; two rows stay committed in this illustrative failure. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Write a row Insert a row or replace the row with the same primary key. Retrieve a row Fetches one row by its primary key. --- ## Import from object storage | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/s3-ingest-sync Database endpoints Import from object storage Load CSV and NDJSON objects from a storage-bucket prefix into an existing table. POST /v1/tenants/{tenant}/ingest/s3/sync Load supported objects from a bucket prefixThis route does not implement incremental mode. 01 Choose bucket and prefixSelect CSV or NDJSON objects and an existing table. 02 Load the matching objectsApply the requested format and chunk settings. 03 Review each object's outcomeInspect errors, empty objects and total imported rows. Before you start Use your database bearer token. Connection setup Register the destination table and configure server-side access to an allowed storage bucket. Replace SOURCE_BUCKET; storage credentials do not go in this request. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values schema is the destination table id and must exist. prefix defaults to '' (bucket root). format overrides per-object extension detection (csv or ndjson). csv_has_header defaults to true; chunk_size defaults to 5000. mode is one of: full (default), incremental (not yet supported, returns 400). The bucket must be on the server's ingest allow-list (deny-all by default); storage credentials are server-side and never sent in the request. FieldTypeRequired bucketstringRequired chunk_sizeintegerOptional csv_has_headerbooleanOptional formatstringOptional modestringOptional prefixstringOptional schemastringRequired Read the result Inspect both the total counters and each per_object result, including its error. Unsupported and empty objects are counted separately. Incremental mode is not implemented for this route. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/ingest/s3/sync" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "bucket": "", "schema": "demo.people", "prefix": "people/", "format": "ndjson", "mode": "full", "chunk_size": 1000 }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error413 Error415 Error422 Error429 Error500 Error502 Error503 Error { "objects_listed": 1, "objects_ingested": 1, "objects_unsupported_format": 0, "objects_empty": 0, "rows_ingested": 3, "large_object_warning": false, "per_object": [ { "key": "people/example.ndjson", "bytes": 122, "format": "ndjson", "rows_ingested": 3, "error": null } ] } Assumes the configured source bucket has people/example.ndjson containing the three compact JSON rows, separated by newlines with no trailing newline. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Import from MySQL Copy MySQL tables into the tenant with a full or incremental sync. Missing destination tables are created. Start a schema migration Start a background migration that changes an existing table's schema. --- ## Delete a schema | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/schemas-delete Database endpoints Delete a schema Deletes one table and irreversibly purges all of its rows, indexes and related data. DELETE /v1/tenants/{tenant}/schemas/{id} Remove a table and all its dataThis operation is irreversible, not just removal of a schema description. 01 Verify the table IDCheck the precise table targeted for removal. 02 Delete the tablePurge its rows, indexes and related data. 03 Inspect the removal totalsReview reported deleted rows and keys. Before you start Use your database bearer token. Connection setup Check the table ID and the purge_rows option before deleting data. The example targets demo.people. Path parameters FieldTypeRequired tenantstringRequired idstringRequired Query parameters FieldTypeRequired purge_rowsbooleanOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result The result reports removed rows and keys and marks the operation irreversible. This deletes the table's data and indexes, not just its schema definition. Response statuses HTTP status reference StatusWhat to do 200OK 204No content 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request DELETE "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/schemas/demo.people" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success204 Success400 Error401 Error402 Error403 Error404 Error409 Error429 Error500 Error501 Error502 Error503 Error { "schema": "demo.people", "rows_deleted": 3, "keys_removed": 12, "irreversible": true } 200 illustrates purge_rows=true; the default request can return 204 on an empty table or 409 on a protected non-empty table. HTTP/1.1 204 No Content { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Retrieve a schema Returns the registered TOML manifest for one table. Delete all schemas Deletes every table in the tenant and irreversibly purges all of their data. --- ## Delete all schemas | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/schemas-delete-all Database endpoints Delete all schemas Deletes every table in the tenant and irreversibly purges all of their data. DELETE /v1/tenants/{tenant}/schemas Remove every table in one tenantEvery selected tenant table and its data is irreversibly purged. 01 Verify the tenant scopeConfirm the operation covers all of its tables. 02 Delete all table schemasRemove their rows, indexes and related data. 03 Inspect the removed IDsReview deleted table and row counts. Before you start Use your database bearer token. Connection setup This operation targets every table in the tenant. Check the tenant before sending it. Path parameters FieldTypeRequired tenantstringRequired Query parameters FieldTypeRequired purge_rowsbooleanOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result deleted and ids report the removed tables, with rows_deleted for their data. This applies to every table in the selected tenant and is irreversible. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request DELETE "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/schemas" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error429 Error500 Error501 Error502 Error503 Error { "complete": true, "deleted": 1, "ids": [ "demo.people" ], "irreversible": true, "rows_deleted": 3 } Destructive purge example; key and row counts depend on the database. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete a schema Deletes one table and irreversibly purges all of its rows, indexes and related data. Write a row Insert a row or replace the row with the same primary key. --- ## Retrieve a schema | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/schemas-get Database endpoints Retrieve a schema Returns the registered TOML manifest for one table. GET /v1/tenants/{tenant}/schemas/{id} Read the definition behind a tableThe response is TOML, not JSON or table records. 01 Select a registered tableUse its schema ID. 02 Retrieve its manifestRead the table's TOML definition. 03 Inspect fields and relationshipsCheck columns, primary key and declared links. Before you start Use your database bearer token. Connection setup Use the ID of a registered table, such as demo.people. Path parameters FieldTypeRequired tenantstringRequired idstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result The response is a TOML manifest, not a JSON row or a table's data. It describes the primary key, columns and declared relationships used by subsequent writes and queries. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/schemas/demo.people" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error500 Error503 Error namespace = "demo" table = "people" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "follows_id" ty = "str" [[columns]] name = "score" ty = "i64" [[relations]] name = "follows" from_col = "follows_id" bidirectional = true [relations.target] namespace = "demo" table = "people" pk = "id" Illustrative TOML; canonical responses may include synthesized defaults such as the primary-key index. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List schemas Lists the table ids registered for the tenant that the caller may see. Delete a schema Deletes one table and irreversibly purges all of its rows, indexes and related data. --- ## List schemas | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/schemas-list Database endpoints List schemas Lists the table ids registered for the tenant that the caller may see. GET /v1/tenants/{tenant}/schemas Discover the tables visible to your credentialThis lists schema IDs rather than table records. 01 List the tenant's schemasRequest the table inventory available to this caller. 02 Choose a returned IDIdentify the table you need. 03 Open its definition or rowsUse that ID in the appropriate endpoint. Before you start Use your database bearer token. Connection setup Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result The array contains table IDs such as demo.people, limited to those visible to the caller. Pass an ID to the schema-detail or row endpoints; the listing does not contain records. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/schemas" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error502 Error503 Error [ "demo.people" ] { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Register a schema Registers a new table from a TOML manifest. Retrieve a schema Returns the registered TOML manifest for one table. --- ## Register a schema | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/schemas-register Database endpoints Register a schema Registers a new table from a TOML manifest. POST /v1/tenants/{tenant}/schemas Define a new table before writing rowsAn existing table ID returns 409; changing it requires a migration. 01 Prepare the TOML manifestDefine namespace, table, primary key and columns. 02 Register the tableValidate and store its new schema. 03 Keep the returned IDUse it to insert records and run queries. Before you start Use your database bearer token. Connection setup Choose a new table ID and prepare its TOML manifest. The example creates demo.people; an existing ID returns 409. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body text/plain; charset=utf-8 Limits and accepted values A TOML table manifest; the Content-Type header is not checked. Registering an id that already exists answers 409 (class schema_already_exists). Honors Idempotency-Key. FieldTypeRequiredDescription FieldsstringOptionalA TOML table manifest; the Content-Type header is not checked. Registering an id that already exists answers 409 (class schema_already_exists). Honors Idempotency-Key. Read the result Save the returned id for row and query requests. Registration defines the table but does not insert rows. An existing ID returns 409; use a migration to change a table already in use. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/schemas" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: text/plain; charset=utf-8" \ --data-binary 'namespace = "demo" table = "people" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "follows_id" ty = "str" [[columns]] name = "score" ty = "i64" [[relations]] name = "follows" from_col = "follows_id" bidirectional = true [relations.target] namespace = "demo" table = "people" pk = "id" ' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error413 Error429 Error500 Error501 Error502 Error503 Error { "id": "demo.people", "tenant": "your-tenant" } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Schema already exists", "class": "schema_already_exists" } Illustrates the schema_already_exists class; choose a new table ID. Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. API errors Read the HTTP status and response body, identify the cause, and decide what to fix before retrying. List schemas Lists the table ids registered for the tenant that the caller may see. --- ## Search an index | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/search Database endpoints Search an index Search a vector namespace with dense, sparse, lexical or hybrid ranking and an optional metadata filter. POST /v1/tenants/{tenant}/vector-indexes/{index_id}/search Combine the search evidence your task needsHybrid scores differ from raw dense-vector scores. 01 Choose search inputsSupply dense, sparse, lexical or combined query evidence. 02 Rank within a namespaceApply the requested filter and fusion settings. 03 Inspect hits and completenessRead ranking_method and components before interpreting the result. Before you start Use your database bearer token. Connection setup Use the index_id returned when the index was created. Insert records into the target namespace before searching it. Path parameters FieldTypeRequired tenantstringRequired index_idstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values mode: semantic, lexical, hybrid or dense_with_text_filter. k is 1 up to the engine's limit (default 10,000). include_components defaults to true, the other include_* to false. Not yet served (501): expected_generation, timeout_ms, text_fields, a projection on a plan with a lexical leg, fusion weighted_sum and mode dense_with_text_filter. Unknown fields at any depth answer 400 unknown_request_field. FieldTypeRequiredDescription denseobjectOptionalQuery by vector or by the id of a stored record. quality: exact, fast or high_recall (default). Fields in dense FieldTypeRequired candidatesintegerOptional qualitystringOptional record_idstringOptional vectornumber[]Optional Fields in vector FieldTypeRequired vectornumberOptional FieldTypeRequiredDescription expected_generationstringOptional— filterobjectOptional— filter_exprobjectOptional— fusionobjectOptionalmethod: rrf (optional rrf_k, default 60) or weighted_sum (weights required; currently answers 501). Fields in fusion FieldTypeRequired methodstringRequired rrf_kintegerOptional weightsobjectOptional Fields in weights FieldTypeRequired densenumberRequired sparsenumberRequired FieldTypeRequiredDescription include_componentsbooleanOptional— include_metadatabooleanOptional— include_sparsebooleanOptional— include_valuesbooleanOptional— kintegerRequired— lexicalobjectOptionalmatch: terms (default) or phrase. query is at most 4,096 bytes and must not be blank. Fields in lexical FieldTypeRequired candidatesintegerOptional fieldstringRequired matchstringOptional querystringRequired FieldTypeRequired metadata_fieldsstring[]Optional Fields in metadata_fields FieldTypeRequired metadata_fieldsstringOptional FieldTypeRequiredDescription modestringRequired— namespacestringRequired— require_completebooleanOptional— sparseobjectOptionalscorer: cosine or dot. At most 1,024 non-zero entries. Fields in sparse FieldTypeRequired candidatesintegerOptional indicesinteger[]Required Fields in indices FieldTypeRequired indicesintegerOptional FieldTypeRequired scorerstringOptional valuesnumber[]Required Fields in values FieldTypeRequired valuesnumberOptional FieldTypeRequired text_fieldsstring[]Optional Fields in text_fields FieldTypeRequired text_fieldsstringOptional FieldTypeRequired timeout_msintegerOptional Read the result hits contains ranked records; ranking_method and per-leg components explain the scores. Check completeness before interpreting an underfilled answer. A hybrid score is not the same quantity as a raw dense-vector score. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/%3CINDEX_ID%3E/search" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "namespace": "demo", "mode": "semantic", "k": 5, "dense": { "vector": [ 0.1, 0.2, 0.3 ], "quality": "high_recall" }, "include_metadata": true }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "index_id": "22222222-2222-4222-8222-222222222222", "namespace": "demo", "mode": "semantic", "k": 5, "returned": 2, "ranking_method": "dense_similarity", "hits": [ { "id": "v1", "rank": 1, "score": 1, "metadata": { "category": "outdoor" }, "components": [ { "leg": "dense", "rank": 1, "score": 1 } ] }, { "id": "v2", "rank": 2, "score": 0.9331, "metadata": { "category": "indoor" }, "components": [ { "leg": "dense", "rank": 2, "score": 0.9331 } ] } ], "completeness": { "value": "exhausted" }, "legs": [ { "leg": "dense", "scorer": "cosine", "score_direction": "higher_is_better", "index_kind": "hnsw", "candidates_requested": 5, "candidates_returned": 2, "completeness": { "value": "exhausted" } } ], "read": { "position": { "domain": "wal", "value": "1042:0" }, "restore_epoch": { "counter": 0 } } } Synthetic index IDs, positions and scores; two stored records cannot fill k=5. { "error": { "code": "unknown_request_field", "message": "Unrecognized search field.", "status": 400, "retryable": false } } Illustrative message; code and envelope follow the documented vector-index contract. Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Update a vector index Change a vector index's tags or deletion protection. Read vector index counts Read vector record counts for each namespace and the index as a whole. --- ## Find slow queries | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/slow-queries Database endpoints Find slow queries Read recent queries and their latency, optionally filtering by a minimum duration. GET /v1/tenants/{tenant}/slow-queries Investigate reported slow operationsAn empty result covers this collection history, not all past database activity. 01 Set the duration thresholdChoose the minimum latency to inspect. 02 Read matching query entriesExamine the recent operations that meet the threshold. 03 Compare query and latencyUse the evidence to investigate the workload. Before you start Use your database bearer token. Connection setup Path parameters FieldTypeRequired tenantstringRequired Query parameters FieldTypeRequired threshold_msintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result entries reports observed queries meeting threshold_ms since collection began. An empty list means none were reported under that threshold and history, not that the database has never run slowly. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/slow-queries?threshold_ms=100" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error500 Error503 Error { "since_unix": 1793318400, "threshold_ms": 100, "entries": [] } No query exceeded the requested 100 ms threshold in this illustrative window. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Read query metrics Read query completion counts and mean latency from the running process, without collecting query text. Report client diagnostics Send an opted-in SDK's call diagnostics to the database's telemetry pipeline. --- ## Execute SQL | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/sql-exec Database endpoints Execute SQL Run SQL and receive rows for a query or a summary for a write or schema change. POST /v1/tenants/{tenant}/sql Run SQL and inspect its result kindMissing write counts are unknown; inspect all outcomes before retrying a batch. 01 Prepare SQL and parametersBind values rather than inserting them into SQL text. 02 Execute the statement or batchSend the required session ID when using a session. 03 Read rows or write resultsCheck kind and any nested or failed outcomes. Before you start Use your database bearer token. Connection setup For this example, register demo.people and insert the quickstart rows. params binds $1 to the first array value. Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values params binds $1, $2 and later placeholders in array order. It cannot be combined with a multi-statement batch. A batch holds at most 256 statements. DDL and explicit transaction boundaries affect its atomicity; do not assume every statement rolls back together. See SQL compatibility. session_id pins the statement to the transaction a BEGIN opened, equivalent to the X-OC-Session-Id header. Optional headers: X-OC-Session-Id, X-OC-Statement-Timeout-Ms (408 on expiry), X-OC-Query-Id (client-chosen ULID, usable for cancellation; 409 if already running), X-OC-DB-User for database-user identity. FieldTypeRequired paramsany JSON[]Optional Fields in params FieldTypeRequired paramsany JSONOptional FieldTypeRequired session_idstringOptional sqlstringRequired Read the result Check kind first. A select returns rows and column metadata; writes report the counts the engine confirms. Batches can contain nested outcomes or stop after a failed statement, so inspect the whole result before retrying. Missing write counts mean unknown. Response statuses HTTP status reference StatusWhat to do 200OK 202Accepted 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/sql" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "sql": "SELECT id, score FROM demo.people WHERE score >= $1 ORDER BY id LIMIT 10", "params": [ 10 ] }' Response example Examples use synthetic values to show the response format. Response status200 Success202 Success400 Error401 Error402 Error403 Error404 Error408 Error409 Error413 Error415 Error422 Error429 Error499 Error500 Error501 Error502 Error503 Error { "kind": "select", "columns": [ "id", "score" ], "rows": [ { "id": "u1", "score": 10 }, { "id": "u2", "score": 20 }, { "id": "u3", "score": 30 } ] } { "kind": "droptable_accepted", "schema": "demo.people", "status": "accepted" } 202 belongs to a DROP TABLE statement, not the SELECT request shown here; inspect the actual returned reclamation/status fields. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete a row Deletes one row by primary key outside a transaction; deleting a missing row succeeds with deleted set to false. Execute a query plan Executes a read query plan and returns the matching rows. --- ## Begin a transaction | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/tx-begin Database endpoints Begin a transaction Opens a multi-statement transaction at snapshot or serializable isolation and returns its id. POST /v1/tenants/{tenant}/tx/begin Open a snapshot for related operationsThis transaction HTTP API is marked as preview. 01 Choose the isolation levelRequest snapshot or serializable behavior. 02 Begin the transactionReceive a transaction ID and read snapshot marker. 03 Reuse the transaction IDKeep subsequent reads and writes in the same transaction. Before you start Use your database bearer token. Connection setup Keep the returned tx_id for later requests. Finish each open transaction with commit or rollback. Path parameters FieldTypeRequired tenantstringRequired Query parameters FieldTypeRequired isolationstringOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values The body is optional and may be empty. isolation is "snapshot_isolation" (default) or "serializable"; it may instead be sent as ?isolation=, and the two must agree. Misspellings such as isolation_level are refused with 400. Serializable is refused (501) on a sharded database. FieldTypeRequired isolationstringOptional Read the result Save tx_id and use it in subsequent transaction requests. read_ts is the snapshot marker, not a row count. The _preview marker identifies this transaction API as preview behavior. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/tx/begin" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "isolation": "snapshot_isolation" }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error413 Error415 Error422 Error429 Error501 Error503 Error { "tx_id": "11111111-1111-4111-8111-111111111111", "read_ts": 100, "isolation": "snapshot_isolation", "_preview": true } Synthetic transaction id and read timestamp; substitute the returned id in later calls. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Execute a query plan Executes a read query plan and returns the matching rows. Retrieve transaction status Returns the current state, snapshot tick and isolation level of a transaction. --- ## Commit a transaction | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/tx-commit Database endpoints Commit a transaction Atomically commits every write buffered in the transaction, enforcing foreign-key, check and unique constraints. POST /v1/tenants/{tenant}/tx/{tx_id}/commit Make buffered transaction writes durable togetherA lost commit response requires checking the outcome before repeating work. 01 Identify the open transactionUse the ID holding your buffered writes. 02 Commit and check constraintsApply the writes atomically when validation succeeds. 03 Read committed and log positionConfirm the result before treating writes as complete. Before you start Use your database bearer token. Connection setup Begin a transaction and replace TX_ID with its returned tx_id. Finish the transaction with commit or rollback. Path parameters FieldTypeRequired tenantstringRequired tx_idstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result committed: true confirms the transaction's buffered writes were committed. lsn identifies the returned log position. A timeout does not establish failure; check the outcome before repeating a commit or its writes. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/tx/%3CTX_ID%3E/commit" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error429 Error500 Error501 Error503 Error { "committed": true, "tx_id": "11111111-1111-4111-8111-111111111111", "lsn": { "segment": 1, "offset": 1042 }, "_preview": true } Illustrates a WAL-backed commit; lsn can be null on multi-writer databases. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "tx_conflict" } The transaction is terminal; retry the whole workflow from tx_begin after resolving contention. Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete a transactional row Buffers the deletion of one row, addressed by primary key, in the transaction. Roll back a transaction Discards every write buffered in the transaction and closes it. --- ## Query in a transaction | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/tx-query Database endpoints Query in a transaction Runs a read-only query plan inside the transaction at its snapshot, including the transaction's own buffered writes. POST /v1/tenants/{tenant}/tx/{tx_id}/query Query the snapshot plus your pending writesThese reads do not make buffered writes visible to other transactions. 01 Choose the transaction IDUse the transaction's existing read snapshot. 02 Supply a read-only planQuery stored data plus this transaction's buffered changes. 03 Read the returned rowsFinish the transaction separately with commit or rollback. Before you start Use your database bearer token. Connection setup Begin a transaction and replace TX_ID with its returned tx_id. Finish the transaction with commit or rollback. Path parameters FieldTypeRequired tenantstringRequired tx_idstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values A query plan tree tagged by op, e.g. {"op":"scan","schema":"ns.table"}, optionally wrapped in filter, project, sort, limit, distinct, aggregate, window, join, set-operation or CTE nodes. Plans that read outside a full-table scan (index scans, count fast paths, graph traversals) and write plans are refused with 400. FieldTypeRequired opstringRequired Read the result rows includes data visible at the transaction's snapshot plus its own buffered writes. This does not mean those writes are committed or visible to another transaction. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/tx/%3CTX_ID%3E/query" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "op": "scan", "schema": "demo.people" }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error499 Error500 Error501 Error503 Error { "tx_id": "11111111-1111-4111-8111-111111111111", "rows": [ { "id": "u1", "follows_id": "u2", "score": 10 }, { "id": "u2", "follows_id": "u3", "score": 20 }, { "id": "u3", "follows_id": "u1", "score": 30 } ], "_preview": true } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Retrieve transaction status Returns the current state, snapshot tick and isolation level of a transaction. Read a transactional row Reads one row by primary key at the transaction's snapshot, seeing the transaction's own buffered writes first. --- ## Roll back a transaction | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/tx-rollback Database endpoints Roll back a transaction Discards every write buffered in the transaction and closes it. POST /v1/tenants/{tenant}/tx/{tx_id}/rollback Discard the transaction's pending changesThis does not undo writes previously sent outside this transaction. 01 Identify the transactionUse the ID holding the unwanted buffered writes. 02 Roll back the transactionDiscard the writes and close it. 03 Confirm rolled_backTreat the transaction as finished after confirmation. Before you start Use your database bearer token. Connection setup Begin a transaction and replace TX_ID with its returned tx_id. Finish the transaction with commit or rollback. Path parameters FieldTypeRequired tenantstringRequired tx_idstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result rolled_back: true confirms the transaction's buffered writes were discarded and the transaction closed. It does not undo operations previously sent outside that transaction. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/tx/%3CTX_ID%3E/rollback" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error429 Error503 Error { "rolled_back": true, "tx_id": "11111111-1111-4111-8111-111111111111", "_preview": true } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Commit a transaction Atomically commits every write buffered in the transaction, enforcing foreign-key, check and unique constraints. Create a materialized view Creates a materialized view from a SQL SELECT and materializes its initial contents. --- ## Delete a transactional row | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/tx-row-delete Database endpoints Delete a transactional row Buffers the deletion of one row, addressed by primary key, in the transaction. DELETE /v1/tenants/{tenant}/tx/{tx_id}/rows/{schema}/{pk} Stage one row removal before committingBuffered deletion is not yet a committed deletion. 01 Choose transaction and rowSupply the transaction ID, table and primary key. 02 Buffer the deletionStage removal within this transaction. 03 Commit or roll backApply the change or discard it deliberately. Before you start Use your database bearer token. Connection setup Begin a transaction and replace TX_ID with its returned tx_id. Finish the transaction with commit or rollback. Path parameters FieldTypeRequired tenantstringRequired tx_idstringRequired schemastringRequired pkstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result buffered: true means the deletion is staged in this transaction. It is not a committed deletion; finish with commit or rollback. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request DELETE "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/tx/%3CTX_ID%3E/rows/demo.people/u1" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error429 Error500 Error501 Error503 Error { "tx_id": "11111111-1111-4111-8111-111111111111", "op": "delete", "buffered": true, "_preview": true } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Write a transactional row Buffers an insert-or-replace of one row in the transaction; it becomes visible to others only after commit. Commit a transaction Atomically commits every write buffered in the transaction, enforcing foreign-key, check and unique constraints. --- ## Read a transactional row | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/tx-row-get Database endpoints Read a transactional row Reads one row by primary key at the transaction's snapshot, seeing the transaction's own buffered writes first. GET /v1/tenants/{tenant}/tx/{tx_id}/rows/{schema}/{pk} Read a record within your transactionThis view may differ from a read outside the transaction. 01 Choose transaction and recordSupply its transaction ID, table and primary key. 02 Read the transaction's viewPrefer its pending changes over the saved snapshot row. 03 Inspect the nested rowRead column values under the row property. Before you start Use your database bearer token. Connection setup Begin a transaction and replace TX_ID with its returned tx_id. Finish the transaction with commit or rollback. Path parameters FieldTypeRequired tenantstringRequired tx_idstringRequired schemastringRequired pkstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result The record is nested under row and reflects the transaction's snapshot and its own pending changes. It may differ from a read made outside the transaction. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/tx/%3CTX_ID%3E/rows/demo.people/u1" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error429 Error500 Error501 Error503 Error { "tx_id": "11111111-1111-4111-8111-111111111111", "row": { "id": "u1", "follows_id": "u2", "score": 10 }, "_preview": true } Before the transaction writes a replacement row; after tx_row_put, read-your-own-write returns score 11. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Query in a transaction Runs a read-only query plan inside the transaction at its snapshot, including the transaction's own buffered writes. Write a transactional row Buffers an insert-or-replace of one row in the transaction; it becomes visible to others only after commit. --- ## Write a transactional row | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/tx-row-put Database endpoints Write a transactional row Buffers an insert-or-replace of one row in the transaction; it becomes visible to others only after commit. POST /v1/tenants/{tenant}/tx/{tx_id}/rows/{schema} Stage a row write for later commitShape checks happen now; constraints are checked at commit. 01 Prepare a valid rowUse the transaction ID and registered table. 02 Buffer insertion or replacementKeep the write inside the transaction. 03 Finish with commit or rollbackOther transactions see the change only after commit. Before you start Use your database bearer token. Connection setup Begin a transaction and replace TX_ID with its returned tx_id. Finish the transaction with commit or rollback. Path parameters FieldTypeRequired tenantstringRequired tx_idstringRequired schemastringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values The row as a JSON object keyed by column name, including its primary key. Columns are user-defined by the table. Shape and types are validated now (400); constraints are enforced at commit. FieldTypeRequiredDescription FieldsobjectOptionalThe row as a JSON object keyed by column name, including its primary key. Columns are user-defined by the table. Shape and types are validated now (400); constraints are enforced at commit. Read the result buffered: true means the row passed shape/type validation and was staged. Constraints are checked at commit; this response alone does not confirm a committed write. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/tx/%3CTX_ID%3E/rows/demo.people" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "id": "u1", "follows_id": "u2", "score": 11 }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "tx_id": "11111111-1111-4111-8111-111111111111", "op": "put", "buffered": true, "_preview": true } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Read a transactional row Reads one row by primary key at the transaction's snapshot, seeing the transaction's own buffered writes first. Delete a transactional row Buffers the deletion of one row, addressed by primary key, in the transaction. --- ## Retrieve transaction status | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/tx-status Database endpoints Retrieve transaction status Returns the current state, snapshot tick and isolation level of a transaction. GET /v1/tenants/{tenant}/tx/{tx_id} Check where a transaction standsKeep the same transaction ID throughout the operation sequence. 01 Identify the transactionUse the ID returned by begin. 02 Read its current stateInspect status, isolation level and snapshot tick. 03 Choose the next actionContinue or finish according to its reported state. Before you start Use your database bearer token. Connection setup Begin a transaction and replace TX_ID with its returned tx_id. Finish the transaction with commit or rollback. Path parameters FieldTypeRequired tenantstringRequired tx_idstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Check state for the transaction's current status and isolation for its chosen mode. read_ts identifies its snapshot. Use the same tx_id throughout the operation sequence. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/tx/%3CTX_ID%3E" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error503 Error { "tx_id": "11111111-1111-4111-8111-111111111111", "read_ts": 100, "isolation": "snapshot_isolation", "_preview": true, "state": "active" } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Begin a transaction Opens a multi-statement transaction at snapshot or serializable isolation and returns its id. Query in a transaction Runs a read-only query plan inside the transaction at its snapshot, including the transaction's own buffered writes. --- ## Update vector records | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/update Database endpoints Update vector records Change one vector record by ID, or update matching metadata in a background job. POST /v1/tenants/{tenant}/vector-indexes/{index}/records/update Change one record or matching metadataA filtered update runs as background work instead of a single-record write. 01 Choose ID or filterSelect the intended record or matching record set. 02 Specify the exact changesChoose metadata merge, removal or replacement deliberately. 03 Inspect receipt or job progressKeep revision tokens and follow background outcomes. Before you start Use your database bearer token. Connection setup Use an existing record or a matching filter. For a conditional single-record update, send its revision_token as if_revision_token. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values Exactly one selector: id, or a filter (filter_expr is the native filter expression, filter the legacy metadata filter; send at most one); otherwise 400 exactly_one_selector. By id: metadata_remove holds 1-1,024 unique keys; an unknown id answers 404 record_not_found; a stale if_revision_token answers 409; dry_run: true is refused with 400. By filter: only metadata_merge and/or metadata_remove; an empty filter is refused (400 filter_empty_for_mutation); dry_run: true counts the matches and writes nothing. A filtered job updates at most 100,000 records, then ends limit_reached. One running and 100 retained filtered jobs per namespace; beyond either, 429 job_limit_reached (retryable; details.bound, details.limit). A filtered job needs a key of at least 32 bytes (403 key_scope_insufficient). The job is read at GET .../jobs/{job_id} and stopped at POST .../jobs/{job_id}/cancel. FieldTypeRequired dry_runbooleanOptional filterobjectOptional filter_exprobjectOptional idstringOptional if_revision_tokenstringOptional metadata_mergeobjectOptional metadata_removestring[]Optional Fields in metadata_remove FieldTypeRequired metadata_removestringOptional FieldTypeRequiredDescription metadata_replaceobjectOptional— namespacestringRequired— sparse_valuesobjectOptionalUnique indices in any order, with one value per index. Fields in sparse_values FieldTypeRequired indicesinteger[]Required Fields in indices FieldTypeRequired indicesintegerOptional FieldTypeRequired valuesnumber[]Required Fields in values FieldTypeRequired valuesnumberOptional FieldTypeRequired text_removestring[]Optional Fields in text_remove FieldTypeRequired text_removestringOptional FieldTypeRequired text_setobjectOptional valuesnumber[]Optional Fields in values FieldTypeRequired valuesnumberOptional Read the result For a single ID, inspect its returned receipt and revision token. A filter update starts background work instead; follow the job's progress. Metadata merge, removal and replacement are different operations, so choose only the intended change. Response statuses HTTP status reference StatusWhat to do 200OK 202Accepted 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/records/update" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "namespace": "demo", "id": "v1", "metadata_merge": { "category": "camping" } }' Response example Examples use synthetic values to show the response format. Response status200 Success202 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "receipt": { "tenant": "your-tenant", "index_id": "22222222-2222-4222-8222-222222222222", "namespace_id": "33333333-3333-4333-8333-333333333333", "incarnation_id": "66666666-6666-4666-8666-666666666666", "restore_epoch": { "counter": 0, "nonce_prefix": "" }, "position": { "domain": "wal", "value": "1042:0" }, "durability_scope": "local_fsync", "records": [ { "id": "v1", "state": "searchable", "rev": 1, "revision_token": "" } ] } } { "job_id": "55555555-5555-4555-8555-555555555555", "receipt": { "tenant": "your-tenant", "index_id": "22222222-2222-4222-8222-222222222222", "namespace_id": "33333333-3333-4333-8333-333333333333", "incarnation_id": "66666666-6666-4666-8666-666666666666", "restore_epoch": { "counter": 0, "nonce_prefix": "" }, "position": { "domain": "wal", "value": "1042:0" }, "durability_scope": "local_fsync", "records": [] } } 202 illustrates a filter-based mutation; the displayed id-based request returns 200 instead. { "error": { "code": "exactly_one_selector", "message": "Supply exactly one record selector.", "status": 400, "retryable": false } } Illustrative message; code and envelope follow the documented vector-index contract. Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": { "code": "record_not_found", "message": "The selected record was not found.", "status": 404, "retryable": false } } Illustrative message; code and envelope follow the documented vector-index contract. Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": { "code": "job_limit_reached", "message": "The namespace has reached its concurrent job limit.", "status": 429, "retryable": true, "details": { "bound": "running", "limit": 1 } } } Illustrative message; code and envelope follow the documented vector-index contract. Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Count vector records Count records in a vector namespace, with an optional metadata filter. Counts are exact. Delete vector records Delete vector records by ID, by metadata filter, or across a whole namespace. --- ## Insert or replace vector records | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/upsert Database endpoints Insert or replace vector records Insert or replace up to 1,000 vector records. A missing namespace is created. POST /v1/tenants/{tenant}/vector-indexes/{index}/records/upsert Store vector records in a namespaceA missing namespace is created by this operation. 01 Prepare up to 1,000 recordsSupply IDs and their configured vector or text fields. 02 Insert or replace by IDWrite records into the selected namespace. 03 Review the per-record receiptKeep revision tokens for later conditional changes. Before you start Use your database bearer token. Connection setup Create the vector index first. The example uses three-dimensional values in demo-search; the vector field is values, not embedding. Path parameters FieldTypeRequired tenantstringRequired indexstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values records: 1-1,000 with distinct ids; any invalid record refuses the whole batch with per-item errors. expected_generation is refused with 400 (use if_revision_token); dry_run: true is refused with 400. FieldTypeRequired dry_runbooleanOptional expected_generationintegerOptional namespacestringRequired recordsobject[]Required Fields in records FieldTypeRequiredDescription idstringRequired— if_revision_tokenstringOptional— metadataobjectOptional— sparse_valuesobjectOptionalUnique indices in any order, with one value per index. Fields in sparse_values FieldTypeRequired indicesinteger[]Required Fields in indices FieldTypeRequired indicesintegerOptional FieldTypeRequired valuesnumber[]Required Fields in values FieldTypeRequired valuesnumberOptional FieldTypeRequired textobjectOptional valuesnumber[]Optional Fields in values FieldTypeRequired valuesnumberOptional Read the result upserted_count reports accepted records and namespace_created shows whether the request created the namespace. Inspect per-record state and revision tokens in the receipt before planning conditional updates. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector-indexes/demo-search/records/upsert" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "namespace": "demo", "records": [ { "id": "v1", "values": [ 0.1, 0.2, 0.3 ], "metadata": { "category": "outdoor" } }, { "id": "v2", "values": [ 0.2, 0.1, 0.4 ], "metadata": { "category": "indoor" } } ] }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "upserted_count": 2, "namespace_created": false, "receipt": { "tenant": "your-tenant", "index_id": "22222222-2222-4222-8222-222222222222", "namespace_id": "33333333-3333-4333-8333-333333333333", "incarnation_id": "66666666-6666-4666-8666-666666666666", "restore_epoch": { "counter": 0, "nonce_prefix": "" }, "position": { "domain": "wal", "value": "1042:0" }, "durability_scope": "local_fsync", "records": [ { "id": "v1", "state": "searchable", "rev": 1, "revision_token": "" }, { "id": "v2", "state": "searchable", "rev": 1, "revision_token": "" } ] } } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete a vector namespace Deletes a namespace and erases its records in the background. Fetch vector records Read up to 1,000 vector records by ID from one namespace. --- ## Read usage and limits | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/usage Database endpoints Read usage and limits Returns the tenant's configuration, limits and live usage counters. GET /v1/tenants/{tenant}/usage Compare current usage with declared limitsA null capacity value is unknown, not unlimited. 01 Request tenant usageRead configuration, limits and live counters. 02 Compare units and scopeSeparate overall used counters from per-table usage. 03 Plan from known capacityInterpret each limit using its reported unit. Before you start Use your database bearer token. Connection setup Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result used contains current counters and schemas contains per-table usage. Read each value with its unit; a null capacity value is unknown here, not an unlimited allowance. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/usage" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error502 Error503 Error { "tenant": "your-tenant", "meter": {}, "used": { "store_keys": 20, "storage_bytes": 512, "graph_nodes": 3, "graph_edges": 3, "graph_counts_reconciled": true, "max_connections": null, "vector_counter_lost_bumps": 0, "ask_in_flight": 0, "vector_embeddings": 2, "reactive_subscriptions": 0 }, "schemas": [ { "schema": "demo.people", "rows": 3, "bytes": 256, "segments": 1 } ], "addon_calls": [] } Illustrative counters for a standalone seeded tenant with no tier configuration; meter:{} means healthy. Storage and key counts are synthetic, not measured. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Retrieve capabilities Check which features, indexes, SQL operations and wire protocols this engine reports as supported. Read query statistics Read query counts, latency, row counts and cache hits. --- ## Delete a vector | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/vector-delete Database endpoints Delete a vector Deletes one vector from a vector table by id; deleting an id that does not exist still succeeds with deleted set to false. DELETE /v1/tenants/{tenant}/vector/{table}/{vec_id} Remove one stored vector by IDAn already absent ID returns deleted false without failing the request. 01 Select collection and vector IDCheck the index type and optional repair setting. 02 Request vector removalDelete that vector from the collection. 03 Inspect the deleted flagDistinguish a removal from an already missing vector. Before you start Use your database bearer token. Connection setup Use the collection and vector ID you intend to remove. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired vec_idstringRequired Query parameters FieldTypeRequired indexstringOptional repairbooleanOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result deleted is false when the vector was already absent. That is still a successful removal request; it is not evidence that a vector existed before the call. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request DELETE "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector/demo_vectors/v1" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error429 Error503 Error { "deleted": true } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Build an IVF-PQ index Train a compressed IVF-PQ index from the vectors already stored in a table. Delete vectors in bulk Delete up to 10,000 vectors and report which IDs were deleted or not found. --- ## Delete vectors in bulk | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/vector-delete-bulk Database endpoints Delete vectors in bulk Delete up to 10,000 vectors and report which IDs were deleted or not found. POST /v1/tenants/{tenant}/vector/{table}/delete-bulk Remove a selected set of vectorsDuplicate input IDs count once in the outcome. 01 Choose up to 10,000 IDsSelect the collection and index type. 02 Delete the listed vectorsRemove only the specified vector identifiers. 03 Compare deleted and missing countsAccount for duplicates when reconciling totals. Before you start Use your database bearer token. Connection setup Choose the collection, index type and vector IDs to remove. The example deletes only its listed IDs. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values ids: at most 10,000, each non-empty and at most 1024 bytes; duplicates count once. index: hnsw (default) | ivf | ivf_pq. repair (HNSW only, default false) runs one graph-repair sweep after the batch. FieldTypeRequired idsstring[]Required Fields in ids FieldTypeRequired idsstringOptional FieldTypeRequired indexstringOptional repairbooleanOptional Read the result deleted_count and missing_count distinguish removed vectors from absent IDs. Duplicate input IDs count once, so totals need not equal the length of an input list containing duplicates. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector/demo_vectors/delete-bulk" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "ids": [ "v1", "v2" ], "index": "hnsw" }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error503 Error { "deleted_count": 2, "missing_count": 0 } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete a vector Deletes one vector from a vector table by id; deleting an id that does not exist still succeeds with deleted set to false. Create a vector index Create a vector index for dense vectors, sparse vectors or text, with an empty default namespace. --- ## Store a vector | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/vector-put Database endpoints Store a vector Stores one dense vector, with optional metadata, in a vector collection. POST /v1/tenants/{tenant}/vector/{table}/put Store an embedding for later comparisonGenerate the embedding separately; success returns an empty 201 response. 01 Prepare the numeric vectorMatch its component count to the collection dimension. 02 Assign an ID and metadataKeep a link to the source item. 03 Store it in the collectionUse matching metric and index settings. Before you start Use your database bearer token. Connection setup Use a collection with the intended dimension and distance metric. The example uses three-dimensional vectors and cosine distance; use real embeddings for meaningful search. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values metric: cosine | dot | l2 | manhattan (alias l1), defaulting to the collection's declared distance, else cosine; quantization: none | scalar | binary; index: hnsw (default) | ivf | ivf_pq (IVF needs installed centroids). `embedding` must have `dim` components. Success is 201 with an empty body. FieldTypeRequired dimintegerRequired embedderstringOptional embeddingnumber[]Required Fields in embedding FieldTypeRequired embeddingnumberOptional FieldTypeRequired idstringRequired indexstringOptional metadataobjectOptional metricstringOptional quantizationstringOptional Read the result Success is 201 with an empty body. The vector must contain exactly dim numeric components; indexing an embedding is separate from generating one from text. Response statuses HTTP status reference StatusWhat to do 201Created 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector/demo_vectors/put" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "id": "v1", "embedding": [ 0.1, 0.2, 0.3 ], "dim": 3, "metric": "cosine", "metadata": { "category": "outdoor" } }' Response example Examples use synthetic values to show the response format. Response status201 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error503 Error HTTP/1.1 201 No response body specified by the contract. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Drop a materialized view Drops a materialized view and everything stored for it. Store vectors in bulk Stores up to 100,000 dense vectors in a vector collection as one atomic batch. --- ## Store vectors in bulk | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/vector-put-bulk Database endpoints Store vectors in bulk Stores up to 100,000 dense vectors in a vector collection as one atomic batch. POST /v1/tenants/{tenant}/vector/{table}/put_bulk Load vectors as one atomic batchSend a vectors envelope with shared configuration, not a bare array. 01 Match the shared configurationUse compatible dimension, metric and index settings. 02 Supply the vector batchInclude each vector's ID, embedding and optional metadata. 03 Check the inserted totalRead accepted count and processing time. Before you start Use your database bearer token. Connection setup Use a collection whose dimension matches the vectors. Send the vectors envelope shown in the example, not a bare array. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values Envelope object, not a bare array. More than 100,000 vectors is a 413; an empty `vectors` list answers inserted 0. metric / quantization / index take the same values as the single put. `expected_generation` makes the write conditional on the collection's index generation (409 on mismatch). FieldTypeRequired dimintegerRequired embedderstringOptional expected_generationstringOptional indexstringOptional metricstringOptional quantizationstringOptional vectorsobject[]Required Fields in vectors FieldTypeRequired embeddingnumber[]Required Fields in embedding FieldTypeRequired embeddingnumberOptional FieldTypeRequired idstringRequired metadataobjectOptional Read the result inserted reports the accepted vectors and elapsed_ms reports processing time. The body needs a vectors envelope with shared configuration; it is not a bare array of embeddings. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector/demo_vectors/put_bulk" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "dim": 3, "metric": "cosine", "vectors": [ { "id": "v1", "embedding": [ 0.1, 0.2, 0.3 ], "metadata": { "category": "outdoor" } }, { "id": "v2", "embedding": [ 0.2, 0.1, 0.4 ], "metadata": { "category": "indoor" } } ] }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error503 Error { "inserted": 2, "elapsed_ms": 3 } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Store a vector Stores one dense vector, with optional metadata, in a vector collection. Store a sparse vector Store a sparse vector's indices, values and dimension, with optional metadata. --- ## Store a sparse vector | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/vector-put-sparse Database endpoints Store a sparse vector Store a sparse vector's indices, values and dimension, with optional metadata. POST /v1/tenants/{tenant}/vector/{table}/put_sparse Store only the populated vector positionsIndices and values must align, with every index below the dimension. 01 Choose the sparse positionsList only the dimensions carrying values. 02 Pair positions with valuesKeep both arrays the same length. 03 Save the sparse vectorSupply its ID, dimension and optional metadata. Before you start Use your database bearer token. Connection setup Match the lengths of indices and values, and keep every index below dim. The example uses dimension 3. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values `indices` and `values` must be the same length, every index must be below `dim`, and every value finite; indices need not be sorted (duplicates are summed). Success is 201 with an empty body. FieldTypeRequired dimintegerRequired idstringRequired indicesinteger[]Required Fields in indices FieldTypeRequired indicesintegerOptional FieldTypeRequired metadataobjectOptional valuesnumber[]Required Fields in values FieldTypeRequired valuesnumberOptional Read the result Success is 201 with an empty body. Each entry pairs an indices position with the value at the same array position; omitted dimensions are not sent as dense zeros. Response statuses HTTP status reference StatusWhat to do 201Created 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector/demo_vectors/put_sparse" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "id": "v1", "dim": 3, "indices": [ 0, 2 ], "values": [ 0.4, 0.8 ], "metadata": { "category": "outdoor" } }' Response example Examples use synthetic values to show the response format. Response status201 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error503 Error HTTP/1.1 201 No response body specified by the contract. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Store vectors in bulk Stores up to 100,000 dense vectors in a vector collection as one atomic batch. List vector tables Lists the tenant's vector tables with their live vector counts. --- ## Find nearest vectors | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/vector-topk Database endpoints Find nearest vectors Returns the k stored vectors nearest to a query vector, optionally filtered by metadata. POST /v1/tenants/{tenant}/vector/{table}/topk Find embeddings nearest to a queryScores depend on the distance metric; k is a result limit. 01 Prepare a compatible query vectorMatch the stored embeddings' dimension and metric. 02 Search with optional filtersLimit candidates to the metadata you need. 03 Read IDs and scoresUse each ID to retrieve the source data. Before you start Use your database bearer token. Connection setup Store dense vectors in the collection before searching it. The example uses demo_vectors; scores depend on your data and distance metric. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values The query vector field is `query` (not `vector`). mode: fast | high_recall (default); index: hnsw (default) | ivf | ivf_pq; nprobe (1-256) applies to ivf / ivf_pq; refine_k_factor (1-64) applies to ivf_pq with raw vectors kept; engine "bruteforce" forces an exact scan. k above the server ceiling (default 4096) is a 400. `filter` is a strict-equality metadata map ({field: value}); `filter_expr` is the typed operator filter (e.g. {"tag": {"$eq": "a"}}) and cannot be combined with a non-empty `filter`; `require_complete: true` turns an underfilled filtered answer into a 422. FieldTypeRequired dimintegerRequired embedderstringOptional filterobjectOptional filter_exprobjectOptional indexstringOptional kintegerRequired metricstringOptional modestringOptional nprobeintegerOptional querynumber[]Required Fields in query FieldTypeRequired querynumberOptional FieldTypeRequired refine_k_factorintegerOptional require_completebooleanOptional Read the result Each hit contains a vector ID and score. Interpret the score using the requested metric and use the ID to retrieve source data. A requested k is a limit, not a guarantee that enough matching records exist. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 408Reduce query work or adjust the timeout. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector/demo_vectors/topk" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "query": [ 0.1, 0.2, 0.3 ], "dim": 3, "metric": "cosine", "k": 5 }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error408 Error409 Error413 Error415 Error422 Error429 Error499 Error500 Error501 Error503 Error [ { "id": "v1", "score": 1 } ] Illustrates a collection with only the quickstart vector v1; scores depend on your data. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. List vector tables Lists the tenant's vector tables with their live vector counts. Search dense + sparse Search dense and sparse vectors together, then combine the rankings with Reciprocal Rank Fusion. --- ## Explain a vector search | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/vector-topk-explain Database endpoints Explain a vector search Run a vector search and inspect the search settings used for its results. POST /v1/tenants/{tenant}/vector/{table}/topk_explain Inspect why a vector search behaved differentlyThe explanation reports the configuration used for this search. 01 Supply the query and settingsChoose dimension, metric, filters and execution options. 02 Run the explained searchRetrieve ranked hits with their configuration. 03 Compare config with expectationsInvestigate unexpected rankings using the actual settings. Before you start Use your database bearer token. Connection setup Store dense vectors in the collection before searching it. The example uses demo_vectors; scores depend on your data and distance metric. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values Same body as the vector top-k search. query must be finite numbers of length dim. metric: cosine|dot|l2|manhattan. filter: equality map {field: value} (explicit null is 400). filter_expr: typed filter expression; not combinable with a non-empty filter. require_complete=true turns an underfilled filtered answer into 422. mode: fast | high_recall (default). engine: hnsw | bruteforce (internal tuning knob). index: hnsw (default) | ivf | ivf_pq. nprobe: 1..256 cells for ivf/ivf_pq. refine_k_factor: ivf_pq exact re-rank over-fetch factor. FieldTypeRequired dimintegerRequired embedderstringOptional filterobjectOptional filter_exprobjectOptional indexstringOptional kintegerRequired metricstringOptional modestringOptional nprobeintegerOptional querynumber[]Required Fields in query FieldTypeRequired querynumberOptional FieldTypeRequired refine_k_factorintegerOptional require_completebooleanOptional Read the result hits is the ranked result and config shows the search configuration used. Use it to check dimensions, metric and execution choices when investigating unexpected rankings. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 408Reduce query work or adjust the timeout. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector/demo_vectors/topk_explain" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "query": [ 0.1, 0.2, 0.3 ], "dim": 3, "metric": "cosine", "k": 5 }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error408 Error409 Error413 Error415 Error422 Error429 Error499 Error500 Error501 Error503 Error { "config": { "dim": 3, "engine": "exact_scan", "index": "hnsw", "k": 5, "metric": "cosine" }, "hits": [ { "id": "v1", "score": 1 }, { "id": "v2", "score": 0.9331 } ] } Illustrates a small-table exact-scan path; engine and tuning fields depend on the collection. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Search sparse vectors Returns the k stored sparse vectors most similar to a sparse query vector, optionally filtered by metadata. Build an IVF-PQ index Train a compressed IVF-PQ index from the vectors already stored in a table. --- ## Search dense + sparse | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/vector-topk-hybrid Database endpoints Search dense + sparse Search dense and sparse vectors together, then combine the rankings with Reciprocal Rank Fusion. POST /v1/tenants/{tenant}/vector/{table}/topk_hybrid Combine dense and sparse rankingsMatching IDs connect both representations to the same source item. 01 Prepare both query representationsSupply dense coordinates and sparse positions with values. 02 Combine ranked candidatesUse Reciprocal Rank Fusion across the two searches. 03 Read the fused resultInterpret its score as fusion, not cosine similarity. Before you start Use your database bearer token. Connection setup Index dense and sparse vectors under the same record IDs before combining their search results. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values rrf_k defaults to 60; candidates (per-leg overfetch) defaults to max(4k, 40) and is never below k. dense_mode: fast | high_recall. `filter` is a strict-equality metadata map ({field: value}); `filter_expr` is the typed operator filter (e.g. {"tag": {"$eq": "a"}}) and cannot be combined with a non-empty `filter`; `require_complete: true` turns an underfilled filtered answer into a 422. FieldTypeRequired candidatesintegerOptional dense_dimintegerRequired dense_metricstringOptional dense_modestringOptional dense_querynumber[]Required Fields in dense_query FieldTypeRequired dense_querynumberOptional FieldTypeRequired filterobjectOptional filter_exprobjectOptional kintegerRequired require_completebooleanOptional rrf_kintegerOptional sparse_dimintegerRequired sparse_query_indicesinteger[]Required Fields in sparse_query_indices FieldTypeRequired sparse_query_indicesintegerOptional FieldTypeRequired sparse_query_valuesnumber[]Required Fields in sparse_query_values FieldTypeRequired sparse_query_valuesnumberOptional Read the result The returned score comes from Reciprocal Rank Fusion of dense and sparse rankings. It is not a cosine score. Both representations need matching record IDs to describe the same source item. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 408Reduce query work or adjust the timeout. 409Resolve the conflict before retrying. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector/demo_vectors/topk_hybrid" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "dense_dim": 3, "dense_query": [ 0.1, 0.2, 0.3 ], "dense_metric": "cosine", "sparse_dim": 3, "sparse_query_indices": [ 0, 2 ], "sparse_query_values": [ 0.4, 0.8 ], "k": 5, "rrf_k": 60 }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error408 Error409 Error413 Error415 Error422 Error429 Error499 Error500 Error501 Error503 Error [ { "id": "v1", "score": 0.0327868852 }, { "id": "v2", "score": 0.0161290323 } ] Illustrative RRF ranking with v1 in both legs; exact ranks and scores depend on the indexed corpus. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Find nearest vectors Returns the k stored vectors nearest to a query vector, optionally filtered by metadata. Search sparse vectors Returns the k stored sparse vectors most similar to a sparse query vector, optionally filtered by metadata. --- ## Search sparse vectors | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/vector-topk-sparse Database endpoints Search sparse vectors Returns the k stored sparse vectors most similar to a sparse query vector, optionally filtered by metadata. POST /v1/tenants/{tenant}/vector/{table}/topk_sparse Compare weighted features in sparse vectorsQuery positions and values must use the same dimension as stored data. 01 Pair query indices and valuesDescribe the populated features of the query. 02 Search with optional metadata filtersCompare against stored sparse vectors. 03 Inspect similar vector IDsRead each returned similarity score. Before you start Use your database bearer token. Connection setup Store sparse vectors in the collection before searching. The example uses demo_vectors. Path parameters FieldTypeRequired tenantstringRequired tablestringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values `filter` is a strict-equality metadata map ({field: value}); `filter_expr` is the typed operator filter (e.g. {"tag": {"$eq": "a"}}) and cannot be combined with a non-empty `filter`; `require_complete: true` turns an underfilled filtered answer into a 422. FieldTypeRequired dimintegerRequired filterobjectOptional filter_exprobjectOptional kintegerRequired query_indicesinteger[]Required Fields in query_indices FieldTypeRequired query_indicesintegerOptional FieldTypeRequired query_valuesnumber[]Required Fields in query_values FieldTypeRequired query_valuesnumberOptional FieldTypeRequired require_completebooleanOptional Read the result Each hit identifies a stored sparse vector and its similarity score. Pair query indices with query values and keep the dimension consistent with the stored data. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 408Reduce query work or adjust the timeout. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector/demo_vectors/topk_sparse" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "dim": 3, "k": 5, "query_indices": [ 0, 2 ], "query_values": [ 0.4, 0.8 ] }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error408 Error413 Error415 Error422 Error429 Error499 Error500 Error501 Error503 Error [ { "id": "v1", "score": 1 } ] Illustrative sparse similarity; only v1 was seeded in the sparse fixture. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Search dense + sparse Search dense and sparse vectors together, then combine the rankings with Reciprocal Rank Fusion. Explain a vector search Run a vector search and inspect the search settings used for its results. --- ## List vector tables | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/vectors-list Database endpoints List vector tables Lists the tenant's vector tables with their live vector counts. GET /v1/tenants/{tenant}/vectors Find vector collections and their live sizesCollection-style vector tables differ from project vector-index namespaces. 01 List the tenant's vector tablesRequest the collection inventory. 02 Read collection names and countsInspect the number of live vectors in each. 03 Choose a collection operationUse its name in collection-style vector endpoints. Before you start Use your database bearer token. Connection setup Path parameters FieldTypeRequired tenantstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result tables contains vector-table names and live vector counts. Use these names for collection-style vector endpoints; this listing is separate from project vector-index namespaces. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 429Honor Retry-After when present; back off. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vectors" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error429 Error502 Error503 Error { "complete": true, "tables": [ { "table": "demo_vectors", "vectors": 2 } ] } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Store a sparse vector Store a sparse vector's indices, values and dimension, with optional metadata. Find nearest vectors Returns the k stored vectors nearest to a query vector, optionally filtered by metadata. --- ## Retrieve engine version | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/version Database endpoints Retrieve engine version Returns the engine's version, build stamps and storage health. GET /v1/version Identify the running engine buildVersion information does not prove access, feature enablement or readiness. 01 Request engine identityContact the version endpoint. 02 Read version and build stampsCapture the implementation currently running. 03 Check readiness and capabilities separatelyUse their endpoints for serving and support decisions. Before you start No bearer credential declared by the contract. Connection setup Read the result The version and build information help identify the running engine. They are not a successful authentication test or a promise that a feature is enabled; use capabilities and readiness for those checks. Response statuses HTTP status reference StatusWhat to do 200OK Request example curl --include --request GET "${OC_BASE_URL}/v1/version" Response example Examples use synthetic values to show the response format. Response status200 Success { "version": "", "store_backend": "mem" } Replace the opaque version placeholder with the returned engine version; this example illustrates an in-memory process without build stamps. Download the OpenAPI specification for the complete response schemas. Check readiness Reports whether the engine can serve traffic, including write and read readiness and any pressure conditions. Retrieve capabilities Check which features, indexes, SQL operations and wire protocols this engine reports as supported. --- ## Subscribe to live changes | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/watch-sse Database endpoints Subscribe to live changes Streams the live result of a natural-language query as Server-Sent Events, re-sending it whenever the data changes. GET /v1/tenants/{tenant}/watch Keep an application updated with query resultsThis requires configured natural-language query support. 01 Supply the natural-language queryChoose schemas and the polling interval. 02 Open the event streamKeep the Server-Sent Events connection active. 03 Apply each data eventReplace results when updates arrive; ignore keep-alive comments. Before you start Use your database bearer token. Connection setup Requires configured natural-language compilation and an allowed model provider; consumes the deployment’s applicable resources. Uses natural-language compilation and its deployment-specific provider/entitlement setup; use curl -N with Accept: text/event-stream. Path parameters FieldTypeRequired tenantstringRequired Query parameters FieldTypeRequired nlstringRequired schemasstringOptional poll_msintegerOptional Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result This is a long-lived Server-Sent Events response, not a single JSON document. Parse each data: event as a new result and treat keep-alive comments as stream maintenance. Natural-language query availability still depends on configuration. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --no-buffer --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/watch?nl=Show%20all%20people&schemas=demo.people&poll_ms=1000" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Accept: text/event-stream" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error500 Error503 Error data: [{"id":"u1","follows_id":"u2","score":10},{"id":"u2","follows_id":"u3","score":20},{"id":"u3","follows_id":"u1","score":30}] : keep-alive Default message events carry JSON row arrays. A terminal failure is event: error with data containing an error object; there is no snapshot event name in this contract. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Abort a schema migration Aborts an in-progress migration and restores the table's previous shape. Configure a webhook Map incoming JSON payloads to table rows, with optional HMAC signature verification. --- ## Delete a webhook | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/webhook-delete Database endpoints Delete a webhook Deletes a webhook registration, so later deliveries to that hook are refused. DELETE /v1/tenants/{tenant}/webhooks/{hook_id} Stop future deliveries to a webhookRows written by previous deliveries remain in the database. 01 Identify the hook registrationCheck its exact ID. 02 Delete the registrationRemove the hook's saved configuration. 03 Refuse later deliveriesFuture requests to that hook are no longer accepted. Before you start Use your database bearer token. Connection setup Use the ID of the registration to remove. Later deliveries to that hook will be refused. Path parameters FieldTypeRequired tenantstringRequired hook_idstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result The response identifies the deleted registration. Future deliveries to that hook are refused; this does not remove rows written by earlier deliveries. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request DELETE "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/webhooks/demo-people" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error500 Error503 Error { "deleted": "demo-people" } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Read a webhook Read a webhook's configuration. The signing-secret setting is named, but its value is not returned. Receive a webhook delivery Verify a webhook delivery and write its mapped rows. --- ## Read a webhook | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/webhook-get Database endpoints Read a webhook Read a webhook's configuration. The signing-secret setting is named, but its value is not returned. GET /v1/tenants/{tenant}/webhooks/{hook_id} Inspect how a webhook maps incoming dataThe signing-secret setting is named without exposing its value. 01 Select the registered hookUse the webhook ID. 02 Read its saved configurationInspect destination schema and field mappings. 03 Check signature settingsSee how deliveries are verified without reading the secret. Before you start Use your database bearer token. Connection setup Use the registered hook's ID. This request returns the secret setting's name, not the secret value. Path parameters FieldTypeRequired tenantstringRequired hook_idstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Read the result Read the destination schema and field mappings to see how payloads become rows. The response names the signing-secret environment variable without exposing its value. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/webhooks/demo-people" \ --header "Authorization: Bearer ${OC_TOKEN}" Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error429 Error500 Error503 Error { "hook_id": "demo-people", "config": { "schema": "demo.people", "field_mapping": { "id": "$.event.id", "follows_id": "$.event.follows_id", "score": "$.event.score" }, "idempotency_key_path": "$.delivery_id", "signature": { "header": "X-Docs-Signature", "secret_env_var": "OC_DOCS_WEBHOOK_SECRET", "format": "hex_sha256" } } } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Configure a webhook Map incoming JSON payloads to table rows, with optional HMAC signature verification. Delete a webhook Deletes a webhook registration, so later deliveries to that hook are refused. --- ## Configure a webhook | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/webhook-put Database endpoints Configure a webhook Map incoming JSON payloads to table rows, with optional HMAC signature verification. PUT /v1/tenants/{tenant}/webhooks/{hook_id} Define how deliveries become table rowsWithout a signature block, the hook accepts unsigned deliveries. 01 Prepare the destination tableRegister the schema before configuring the hook. 02 Map payload fieldsConnect JSON paths to destination columns. 03 Save verification settingsConfigure signing when needed; send only the secret setting's name. Before you start Use your database bearer token. Connection setup Register the destination table first. For the signed example, configure OC_DOCS_WEBHOOK_SECRET on the server and send only its setting name. Path parameters FieldTypeRequired tenantstringRequired hook_idstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values schema is the destination table id (namespace.table) and must already exist. field_mapping maps each destination column name to a JSONPath-style expression (e.g. $.event.id, $.items[0].id) and must have at least one entry. Without a signature block the hook accepts unsigned deliveries. FieldTypeRequiredDescription array_pathstringOptional— field_mappingobjectRequired— idempotency_key_pathstringOptional— schemastringRequired— signatureobjectOptionalformat is one of: hex_sha256 (default), stripe_t1. secret_env_var is the NAME of a setting on the database server that holds the shared secret; the secret value itself is never sent or returned. Fields in signature FieldTypeRequired formatstringOptional headerstringRequired secret_env_varstringRequired Read the result The response is the saved mapping configuration. field_mapping maps destination columns to payload paths. Without a signature block, the hook accepts unsigned deliveries; choose that behavior deliberately. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request PUT "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/webhooks/demo-people" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "schema": "demo.people", "field_mapping": { "id": "$.event.id", "follows_id": "$.event.follows_id", "score": "$.event.score" }, "idempotency_key_path": "$.delivery_id", "signature": { "header": "X-Docs-Signature", "secret_env_var": "OC_DOCS_WEBHOOK_SECRET", "format": "hex_sha256" } }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error413 Error415 Error422 Error429 Error500 Error503 Error { "schema": "demo.people", "field_mapping": { "id": "$.event.id", "follows_id": "$.event.follows_id", "score": "$.event.score" }, "idempotency_key_path": "$.delivery_id", "signature": { "header": "X-Docs-Signature", "secret_env_var": "OC_DOCS_WEBHOOK_SECRET", "format": "hex_sha256" } } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Subscribe to live changes Streams the live result of a natural-language query as Server-Sent Events, re-sending it whenever the data changes. Read a webhook Read a webhook's configuration. The signing-secret setting is named, but its value is not returned. --- ## Receive a webhook delivery | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/database/webhook-receive Database endpoints Receive a webhook delivery Verify a webhook delivery and write its mapped rows. POST /v1/tenants/{tenant}/webhooks/{hook_id} Verify a delivery and write mapped rowsFor signed hooks, calculate the signature over the exact body bytes. 01 Send the original payloadUse the configured hook and required signature header. 02 Verify and map its fieldsApply the saved signature and column mappings. 03 Inspect rows_ingestedHandle missing parent records according to the returned retry guidance. Before you start Use your database bearer token. Connection setup Create the hook first. For this signed example, add X-Docs-Signature as the hex HMAC-SHA256 of the exact body bytes; the example does not include a signature value. Path parameters FieldTypeRequired tenantstringRequired hook_idstringRequired Headers FieldTypeRequiredDescription x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key. x-oc-db-keystringOptionalAPI key of the x-oc-db-user user. Request body application/json Limits and accepted values Arbitrary JSON payload from the sending service (read as raw bytes and parsed as JSON; Content-Type is not checked). With array_path set, the value at that path must be an array (or null = zero rows); otherwise the whole payload is one record. Signature header value: hex_sha256 = hex of HMAC-SHA256(secret, body); stripe_t1 = 't=,v1=' over '.'. A mapped row naming a missing foreign-key parent is refused with 503 + Retry-After: 5 so the sender redelivers. FieldTypeRequiredDescription FieldsobjectOptionalArbitrary JSON payload from the sending service (read as raw bytes and parsed as JSON; Content-Type is not checked). With array_path set, the value at that path must be an array (or null = zero rows); otherwise the whole payload is one record. Signature header value: hex_sha256 = hex of HMAC-SHA256(secret, body); stripe_t1 = 't=,v1=' over '.'. A mapped row naming a missing foreign-key parent is refused with 503 + Retry-After: 5 so the sender redelivers. Receives a delivery for a registered webhook: when the hook has a signature block, the request must carry an HMAC-SHA256 signature of the raw body in the configured header (a missing or invalid signature returns 401), the JSON payload is mapped through the hook's field mapping, and the resulting rows are written to the destination table; the request also passes the standard bearer-token check. Read the result rows_ingested reports mapped rows accepted from this delivery. For a signed hook, calculate the signature over the exact raw body bytes. A foreign-key parent missing at delivery time can return 503 with a retry delay. Response statuses HTTP status reference StatusWhat to do 200OK 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 503Honor Retry-After when present; check write outcomes. Request example curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/webhooks/demo-people" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --header "X-Docs-Signature: ${OC_WEBHOOK_SIGNATURE}" \ --data-binary '{ "delivery_id": "demo-delivery-001", "event": { "id": "u1", "follows_id": "u2", "score": 10 } }' Response example Examples use synthetic values to show the response format. Response status200 Success400 Error401 Error402 Error403 Error404 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "hook_id": "demo-people", "rows_ingested": 1 } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Download the OpenAPI specification for the complete response schemas. Delete a webhook Deletes a webhook registration, so later deliveries to that hook are refused. Check health Reports that the engine process is alive, with a constant JSON body. --- ## API errors | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/errors API errors Read the HTTP status and response body, identify the cause, and decide what to fix before retrying. Read the HTTP status and the response body together. The status identifies the kind of failure; the body may explain which input, permission or resource caused it. Diagnose before repeating a requestA lost write response can leave the outcome uncertain. 01 Read the HTTP statusDistinguish rejected input from access or service failures. 02 Inspect the responseFind the field, permission or resource involved. 03 Decide the next actionFix the cause; verify uncertain writes before retrying. 2xx: Read the result. 202 can acknowledge work that is still running. For a partial-write 207, inspect both inserted and error. 4xx: Check the request or access. For 429, honor Retry-After. 5xx: Check the outcome before retrying a write; it may already have applied. Read the error body The error value can be a message string or an object. Optional fields vary by route; do not assume a universal error code. Synthetic examples show the envelope, not guaranteed error messages or class names. { "error": "Example invalid request", "class": "example_error_class" } Find the status code Each endpoint lists its own documented status codes. StatusWhat to do 400Correct the request before retrying. 401Check the credential and Authorization header. 402Check feature access or available credits. 403Check tenant access, roles and permissions. 404Check the resource ID and API route. 408Reduce query work or adjust the timeout. 409Resolve the conflict before retrying. 412Refresh the version or ETag before writing again. 413Split or reduce the request body. 415Send the required Content-Type. 422Correct the values or unsupported combination. 429Honor Retry-After when present; back off. 499The client cancelled the request. 500Check the outcome before retrying a write. 501Check deployment support for this operation. 502Check service availability and the write outcome. 503Honor Retry-After when present; check write outcomes. Response status400 Error401 Error402 Error403 Error404 Error408 Error409 Error412 Error413 Error415 Error422 Error429 Error499 Error500 Error501 Error502 Error503 Error { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "precondition_failed" } The If-Match precondition required an existing row. Refresh the version or ETag before writing again. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Handle errors in your application Parse the body safely and preserve the HTTP status. Do not retry writes automatically. Check the endpoint's retry contract and whether the first request already changed data. Row idempotency // Node.js 20+ · handle both error shapes and empty responses. const response = await fetch(url, options); const text = await response.text(); let body; try { body = text ? JSON.parse(text) : null; } catch { body = text; } if (!response.ok) { const error = body && typeof body === 'object' ? body.error : body; const message = typeof error === 'string' ? error : error?.message ?? 'Request failed'; console.error(response.status, message); // Retry only when the operation and outcome make it safe. throw new Error(message); } if (response.status === 207) { // Partial NDJSON write: inspect inserted and error; committed rows remain. console.log(body); } else { console.log(body); } API authentication Use the URL and credential supplied by Connect, and distinguish application access from explicit endpoint and control-plane requests. Register a schema Registers a new table from a TOML manifest. --- ## API quickstart | OriginChainDB docs Canonical source: https://originchaindb.com/docs/api/quickstart API quickstart Create a sample table, write three rows and query them through the explicit database HTTP API. Create a small table, write three rows and query them. These examples use the explicit tenant-path API contract: complete the explicit endpoint setup first. Create a table and read it backUse a test database; these requests create sample records. 01 Define demo.peopleSet its columns, primary key and follows relation. 02 Add three peopleWrite records with IDs, scores and links. 03 Read matching rowsRun SQL with a bound score parameter. Start with steps 1–3. Choose one request-language tab at each step; the tabs are alternative ways to send the same request. Then try graph, text or vector queries using the optional examples below. These requests create synthetic data; run them in a test database you control. Download the cURL workflow 1. Create a schema Register demo.people: id identifies a person, score is a number and follows_id points to another person. The follows relation gives graph queries a name for that connection. This step defines the shape; it does not add people yet. Expected response: 200 — created. 409 indicates table already exists. Endpoint reference curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/schemas" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: text/plain; charset=utf-8" \ --data-binary 'namespace = "demo" table = "people" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "follows_id" ty = "str" [[columns]] name = "score" ty = "i64" [[relations]] name = "follows" from_col = "follows_id" bidirectional = true [relations.target] namespace = "demo" table = "people" pk = "id" ' View success & error examples Response status200 Success400 Error401 Error402 Error403 Error409 Error413 Error429 Error500 Error501 Error502 Error503 Error { "id": "demo.people", "tenant": "your-tenant" } { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "Schema already exists", "class": "schema_already_exists" } Illustrates the schema_already_exists class; choose a new table ID. Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. 2. Add three connected rows Use the schema from step 1. The JSON array writes three rows together: each has its own id, and follows_id refers to another row. For this JSON-array endpoint, all three rows are accepted together or the write fails; this does not describe every batch format. Expected response: 200 — inserted: 3. 400 indicates invalid row or field. Endpoint reference curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/rows/demo.people/_batch" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '[ { "id": "u1", "follows_id": "u2", "score": 10 }, { "id": "u2", "follows_id": "u3", "score": 20 }, { "id": "u3", "follows_id": "u1", "score": 30 } ]' View success & error examples Response status200 Success207 Partial result400 Error401 Error402 Error403 Error404 Error409 Error413 Error415 Error422 Error429 Error500 Error501 Error503 Error { "inserted": 3 } The displayed JSON array writes all three rows atomically. { "inserted": 2, "error": "Example streaming failure after committed chunks." } 207 applies to a separate NDJSON streaming request, not the displayed atomic JSON array; two rows stay committed in this illustrative failure. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. 3. Query with SQL Query the rows from step 2. $1 takes the value 10 from params, so the statement returns id and score for people scoring at least 10. Read columns with rows to identify the returned values; changing the parameter changes the filter without rewriting SQL. Expected response: 200 — query result. 400 indicates invalid SQL or schema. Endpoint reference curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/sql" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "sql": "SELECT id, score FROM demo.people WHERE score >= $1 ORDER BY id LIMIT 10", "params": [ 10 ] }' View success & error examples Response status200 Success202 Success400 Error401 Error402 Error403 Error404 Error408 Error409 Error413 Error415 Error422 Error429 Error499 Error500 Error501 Error502 Error503 Error { "kind": "select", "columns": [ "id", "score" ], "rows": [ { "id": "u1", "score": 10 }, { "id": "u2", "score": 20 }, { "id": "u3", "score": 30 } ] } { "kind": "droptable_accepted", "schema": "demo.people", "status": "accepted" } 202 belongs to a DROP TABLE statement, not the SELECT request shown here; inspect the actual returned reclamation/status fields. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Optional: follow graph relationships 4. Follow relationships Use the schema and rows from steps 1–2. Start at u1, follow the follows relation and visit nodes up to two links away. The result describes reachable nodes; it is not a ranked text or similarity search. Expected response: 200 — reachable nodes. 400 indicates invalid relation. Endpoint reference curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/graph/demo.people/bfs?rel=follows&pk=u1&max_depth=2" \ --header "Authorization: Bearer ${OC_TOKEN}" View success & error examples Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error429 Error499 Error500 Error503 Error [ { "depth": 1, "pk": "u2" }, { "depth": 2, "pk": "u3" } ] Illustrative traversal entries; the versioned canary proves u3 at depth 2, not this full response or its ordering. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Optional: index and search text 5. Index a document Add the words in a short description to the demo_docs.body text index, using document ID p1. This is separate from the people table above. Indexing makes words searchable; storing source text for display is a separate operation. Expected response: 201 — indexed. 400 indicates invalid input. Endpoint reference curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/fts/demo_docs/body" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "doc_id": "p1", "text": "Trail mug with insulated steel" }' View success & error examples Response status201 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error502 Error503 Error HTTP/1.1 201 No response body specified by the contract. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "An upstream service returned an invalid response." } Check service availability and the write outcome. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. 6. Search by keyword Search the text indexed in step 5 for trail. Each hit identifies a matching document and its ranking score; use doc_id to relate the hit to your source. k=5 caps the returned hits rather than guaranteeing five matches. Expected response: 200 — ranked matches. 400 indicates invalid search parameters. Endpoint reference curl --include --request GET "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/fts/demo_docs/body?q=trail&mode=bm25&k=5" \ --header "Authorization: Bearer ${OC_TOKEN}" View success & error examples Response status200 Success400 Error401 Error402 Error403 Error404 Error408 Error413 Error429 Error499 Error500 Error501 Error503 Error [ { "doc_id": "p1", "score": 0.2877 } ] Illustrative BM25 score; values depend on corpus statistics. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The requested resource was not found." } Check the resource ID and API route. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. Optional: store and search vectors 7. Store an embedding Store a three-number embedding under ID v1 in demo_vectors. These hand-written numbers demonstrate the request shape; they do not represent real text meaning. For an application, generate stored and query embeddings with the same model and dimension. Expected response: 201 — stored. 400 indicates invalid vector dimensions. Endpoint reference curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector/demo_vectors/put" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "id": "v1", "embedding": [ 0.1, 0.2, 0.3 ], "dim": 3, "metric": "cosine", "metadata": { "category": "outdoor" } }' View success & error examples Response status201 Success400 Error401 Error402 Error403 Error409 Error413 Error415 Error422 Error429 Error500 Error503 Error HTTP/1.1 201 No response body specified by the contract. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. 8. Search by similarity Search the vectors from step 7 with cosine similarity. The query uses the same three dimensions as the stored vector. Read each returned ID and score; a real semantic search needs meaningful embeddings, not the illustrative numbers used here. Expected response: 200 — nearest vectors. 400 indicates invalid query vector. Endpoint reference curl --include --request POST "${OC_BASE_URL}/v1/tenants/${OC_TENANT}/vector/demo_vectors/topk" \ --header "Authorization: Bearer ${OC_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary '{ "query": [ 0.1, 0.2, 0.3 ], "dim": 3, "metric": "cosine", "k": 5 }' View success & error examples Response status200 Success400 Error401 Error402 Error403 Error408 Error409 Error413 Error415 Error422 Error429 Error499 Error500 Error501 Error503 Error [ { "id": "v1", "score": 1 } ] Illustrates a collection with only the quickstart vector v1; scores depend on your data. { "error": "Invalid request: check the fields and values." } Correct the request before retrying. { "error": "Missing or invalid bearer credential." } Check the credential and Authorization header. { "error": "This operation requires available credits or feature access." } Check feature access or available credits. { "error": "The credential does not have access to this operation." } Check tenant access, roles and permissions. { "error": "The request exceeded its time limit." } Reduce query work or adjust the timeout. { "error": "The request conflicts with the current resource state." } Resolve the conflict before retrying. { "error": "The request body exceeds the allowed size." } Split or reduce the request body. { "error": "The request Content-Type is not supported." } Send the required Content-Type. { "error": "The supplied values cannot be processed." } Correct the values or unsupported combination. { "error": "Too many requests. Retry after backing off." } Honor Retry-After when present; back off. { "error": "The client cancelled the request." } The client cancelled the request. { "error": "The server could not complete the request." } Check the outcome before retrying a write. { "error": "This operation is not supported by this deployment." } Check deployment support for this operation. { "error": "The service is temporarily unavailable." } Honor Retry-After when present; check write outcomes. 9. Handle an error On a bearer-protected deployment, a missing token should return 401. Add a valid token, then retry. Error handling guide # Negative example: authentication is intentionally omitted. curl --include "$OC_BASE_URL/v1/tenants/$OC_TENANT/schemas" Responses illustrate contract shapes; runtime values and deployment support can differ. Existing versioned checks cover a subset of workflows. API reference Find the request, fields and response examples for each OriginChainDB API operation. API authentication Use the URL and credential supplied by Connect, and distinguish application access from explicit endpoint and control-plane requests. --- ## Natural language (Ask) | OriginChainDB docs Canonical source: https://originchaindb.com/docs/ask Natural language (Ask) Ask turns a plain-language question into a database query. Start with one question about a known table, then check the query and the returned rows. Ask first tries built-in rules to match your question to the database schema: the names and types of its tables and fields. If those rules cannot resolve it, Ask can use the language model configured on your instance. It can reuse a saved query plan for a repeated question. From a question to database rowsAsk executes a query; showing its plan is not a dry run. 01 Choose the tablesLimit the question to the data you need. 02 Ask in plain languageName the fields, filters or totals you want. 03 Inspect the executed planCheck which tables and conditions it used. 04 Verify the answerCompare returned rows with records you already know. 1. Ask a question. Send the question in nl. Use schemas to name the tables it should consider. If you omit it, Ask considers the catalog available to the active database identity. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/ask" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "nl": "last 10 orders where status is pending", "schemas": ["shop.orders"] }' FieldRequiredNotes nlyesThe question in plain English. Aim for one sentence - multi-step questions are best split. schemasnoArray of schema names to consider. Omitting it allows all schemas but is slower for large catalogs. show_plannoWhen true, the response includes the executed plan tree. Ambiguous column references. "Top customers by amount" doesn't say whether "amount" is per-order or aggregated. Be specific: "top customers by total order amount". Not scoping schemas. If you know the question is only about orders, pass schemas=["shop.orders"] - the compiler is faster and less likely to pick the wrong table. Sensitive data in questions. If you fall back to the LLM, the question gets sent to whatever LLM is configured. Don't put PII or secrets in the question. 2. Inspect the plan. Set show_plan: true to see how Ask reads the data. A query plan lists steps such as scanning a table, filtering rows and calculating totals. Check that it uses the intended table and conditions before reusing the question in an application. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/ask" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "nl": "top 5 customers by total spend", "schemas": ["shop.orders", "shop.customers"], "show_plan": true }' { "rows": [ { "customer_id": "c_3", "total": 124900 }, { "customer_id": "c_7", "total": 98200 }, ... ], "cache": "miss", "plan": { "kind": "Aggregate", "by": ["customer_id"], ... } } For the operator catalog (Scan, Filter, HashJoin, Aggregate, etc.), see the query reference. 3. The plan cache. Every response includes a cache field with one of three values: ValueWhat happened "hit"Cached plan was reused. Fast. "miss"First time seeing this question (or close to it). Compiled fresh, then cached. "skip"Cache was bypassed, usually because schemas were modified since the entry was cached. Plan reuse depends on schema and authorization context. Do not re-register a schema just to clear the cache; use show_plan to inspect the query and verify its rows against an explicit query. Lemmatization (planned) Previous Page Ask your first question Next Page --- ## Authenticate and manage access | OriginChainDB docs Canonical source: https://originchaindb.com/docs/auth Authenticate and manage access Use the database URL and credential offered in Connect. Some deployments also require a database user and key so that user's permissions can be checked. Give a request the right accessConnection credentials and database permissions serve different purposes; configure both when required. 01 Copy the connection credentialUse the complete address and token supplied in Connect. 02 Set database permissionsUse the required database identity and only the grants it needs. 03 Send credentials from your serverKeep tokens outside browser code and URLs. 04 Test the access boundaryCheck a permitted request and a request that should be refused. 1. Create an instance token Open Connect on the target instance in the console. Where access tokens are supported, use Your tokens or Organization tokens, depending on who owns the credential. Otherwise use the instance credential offered by Connect. Save a new secret when it is shown; it cannot be revealed later. Personal instance tokens inherit the member's effective access. A read-only token cannot write, and choosing read/write cannot exceed the member's role or grants. Tokens are scoped to their instance and tenant; a valid token does not grant access to every database. Use the permission controls shown by your console rather than inferring access from a token prefix. Choose the credential for the task: Instance token: authenticates requests to the database HTTP API. Organization API key: authenticates supported management operations. Database identity: identifies a database user and its permissions. HTTP uses that user's API key; a per-user SQL connection uses its login password. These credentials are not interchangeable. See SQL client connections for database tools. 2. Make an authenticated request For the current connection, copy the complete OC_URL and credential from Connect. Keep the URL's path unchanged. The connection example shows a first SQL request. Using the explicit host-and-tenant API instead? Use the values supplied for that API. Do not derive them by trimming or editing OC_URL. # Use the explicit endpoint settings supplied for your deployment. export OC_BASE_URL="https://YOUR_INSTANCE_HOST" export OC_TENANT="YOUR_TENANT_ID" # Set OC_BEARER from your secret manager; do not commit it to this file. : "${OC_BEARER:?Set OC_BEARER first}" curl --fail-with-body "$OC_BASE_URL/v1/tenants/$OC_TENANT/schemas" \ -H "Authorization: Bearer $OC_BEARER" This Bash example lists the schemas you are allowed to see. An empty list is valid for a new database. The tenant ID is not the instance ID. Engine requests under /v1/tenants/… use Authorization: Bearer …. Public health and capability discovery routes are exceptions. Check the SDK directory before choosing a client version. StatusWhat to check 401The token is missing, malformed, unknown, expired or revoked. Check the secret and the credential type. 403The caller is authenticated but cannot perform this operation. Check tenant scope, read/write access, database grants and row policies. Creating a new token does not increase the member's permissions. 404Check the host, route and object name. Some restricted resources are deliberately hidden; this status alone does not prove that an instance was deleted. Database permissions over HTTP Bearer authentication and database-user authorization are separate checks. When database identity is required, include X-OC-DB-User and X-OC-DB-Key as well as the bearer token. The key is the database user’s API key, not a SQL login password or an organization API key. Obtain the identity from your administrator and load its key from a secret manager. curl --fail-with-body "$OC_BASE_URL/v1/tenants/$OC_TENANT/schemas" \ -H "Authorization: Bearer $OC_BEARER" \ -H "X-OC-DB-User: $OC_DB_USER" \ -H "X-OC-DB-Key: $OC_DB_KEY" Identity requirements depend on the instance configuration. A bearer-only request must not be used as proof that database-user row policies or masks were applied. If identity is required and missing, fix the credentials instead of weakening the requirement. Confirm both an allowed operation and a denied operation with the intended application identity. Use the authentication options documented for your installed client version. Source code for a newer SDK is not proof that its package has been published. The HTTP example above shows the identity headers directly. Keep database secrets on your server. 3. Store credentials safely Load tokens from a secret manager or server environment. Keep them out of browser bundles, mobile application packages, URLs, screenshots and logs. Use the least privilege required, and an expiry where your token-creation workflow offers it. A database identity or token may have less than full access, but its secret still lets another person act with that access. 4. Rotate and confirm Create a replacement token with the required access and save it securely. Update your application's secret and reload its clients or restart the application. Run a small request using the replacement and confirm the expected result. Revoke the old token. Check the console's confirmation state; if propagation is pending, use the offered check or retry action. Confirm the old credential is refused. A successful management request alone is not proof that every running engine has applied the change. Removing a member revokes their personal instance tokens across the organization's instances. Review the Team page for any confirmations still pending. Shared organization API keys require a separate review. 5. If a token leaks Revoke it immediately, check the propagation status, replace it in affected applications and review activity. Remove exposed copies from repositories and logs, including history where appropriate. Contact security@originchaindb.com with the instance, time and request IDs; never send the secret. Search use cases Previous Page Database users Next Page --- ## Choose how to query your data | OriginChainDB docs Canonical source: https://originchaindb.com/docs/choosing Choose how to query your data Start with the question your application needs to answer. Use the table below to choose a query method and see what data to prepare. Choose a query by the questionEach query model needs its own preparation; sharing record IDs connects the results. 01 Identify what mattersExact values, similar meaning, words or relationships? 02 Choose the query modelUse SQL, vector, full-text or graph for that question. 03 Prepare its dataCreate the required fields, indexes or relationships. 04 Check known matchesStart with results you can verify by hand. Match the question to a tool QuestionUsePrepare first Which orders are paid? What is the total by customer?SQLTyped rows, appropriate indexes and tested joins or aggregates. Which documents mean something similar?Vector searchEmbeddings from one model with matching dimensions and metric. Where does this phrase or product code appear?Full-text searchIndexed text and an appropriate analyzer. Use a structured filter when an identifier must match exactly. Who is connected to this account? Can one node reach another?Graph traversalA declared relation or supported edge mapping. How can someone ask about data in plain English?AskRegistered schemas, permission-scoped context and review of the compiled plan. Understand what is kept in sync A row write maintains the indexes attached to that row operation, including its declared graph relations. Explicit vector-table and full-text document calls are separate operations. Generating an embedding is also separate work; use a configured run or schedule, or your application. Use one stable source ID across the models and track incomplete index work. There is no blanket guarantee that a sequence of row, vector and full-text HTTP calls commits as one transaction. See write boundaries. Combine models when the question needs it Combine word and meaning search: run full-text and vector queries, combine their rankings in your application, then fetch the matching records. Test with questions your users actually ask. Combine links and filters: follow a graph relationship to get record IDs, then use SQL to select the fields and rows you need. Give an AI answer supporting evidence: retrieve relevant content, keep its source IDs and pass only permitted content to the model. This is retrieval-augmented generation (RAG). See the RAG guide. Check feature scope SQL supports more than simple filters: supported CTE, join, window, ORDER BY and HAVING shapes exist. Each has limits; use the SQL guide and GET /v1/capabilities for your deployed engine. Ask’s compiler does not automatically expose every SQL feature. Check permissions for each API under the application’s database identity. Sharing a record ID or bearer token is not proof that every query surface applies identical access rules. Start with one working query Run the first-query quickstart, then add a vector or graph workflow when your application needs it. Use representative data to measure relevance, latency and result correctness before adding another query model. Import records in the console Previous Page SQL overview Next Page --- ## CLI quickstart | OriginChainDB docs Canonical source: https://originchaindb.com/docs/cli CLI quickstart Set up an engine profile, run a parameterized query and choose your next CLI task. Use oc to query a database from your terminal. Start with an engine profile; add a separate management profile only if you need account or organization commands. Run a query with the CLIThese steps use the CLI preview and its engine profile, not a console management login. 01 Install the approved previewCheck the archive and the reported CLI version. 02 Create an engine profileSupply the endpoint and credentials required by this CLI version. 03 Check the connectionRun doctor before sending database commands. 04 Run a small queryInspect both the returned output and the exit code. Before you start These instructions are for CLI preview 0.6.0-dev.20261020, supplied as an approved archive. Install the CLI first. Ask your administrator for the engine HTTPS origin, tenant ID, database username, transport bearer and database-user key. This CLI preview uses those settings; the new SDK's OC_URL / OC_TOKEN setup is a separate contract. 1. Check the executable oc version oc help Put global options such as --profile and --output before the command. 2. Load your credentials Use a secret manager or a hidden prompt. Choose your shell: $env:OC_BEARER = Read-Host 'Engine transport bearer' -MaskInput $env:OC_DB_KEY = Read-Host 'Database-user key' -MaskInput 3. Save the connection settings Replace the three placeholders with your engine settings: oc --profile development init --non-interactive --endpoint ENGINE_ORIGIN --tenant TENANT_ID --db-user DB_USER oc --profile development --output table doctor --target engine Prefer prompts? Run oc init. Setup checks health and schema access before saving, and keeps existing profiles. A successful check does not grant permission to query every table. Keep credentials for another terminal oc --profile development credentials save --kind engine This stores them in your OS credential store, not the profile file. Clear the temporary environment variables and run doctor in a fresh process to check the saved credentials. See credential-store requirements. 4. Run a query List available schemas, then send a query that needs no table: oc --profile development schema list oc --profile development --output table sql --query 'SELECT $1 AS value' --params '[7]' The query should show a value column containing 7. It creates no rows. If schema listing is empty, this constant-value query still does not need a table. $1 binds the first parameter. Single quotes keep the shell from expanding it. Use schema show SCHEMA_IDENTIFIER to inspect an identifier returned by schema list. For longer SQL, save a UTF-8 file and run oc --profile development sql --file query.sql. Choose your next task Use the terminal menu Run oc ui for SQL, graph, vector, full-text and administration menus. Use b to go back, q to quit and :cancel to cancel. oc ui --render --plain previews the menu without contacting a server. Open an SQL session oc --profile development sql shell End SQL with an unquoted semicolon. Use \status to inspect a tracked transaction, \r to clear input and \q to quit. See sessions and recovery before using transactions or query history. Search an existing index Use oc --profile development search indices to list Elasticsearch-compatible indexes. Then send a search request. Results contain one page; partial results return exit code 4. Follow relationships Use oc graph query for Cypher, or neighbors, bfs and path for traversals. You need existing graph data and a registered relation. Graph commands. Search vectors Use oc vector list, then query with a JSON embedding. The embedding must match the stored dimension and model; the CLI does not generate one. Vector commands. Search text fields Use oc fts search TABLE FIELD --text 'search words'. Native full-text search uses a table and field, while oc search uses an Elasticsearch-compatible index. Full-text commands. Add account access when needed Management login is optional and requires a console that supports this CLI preview's approval flow. It does not grant SQL access. oc --profile work login --browser --endpoint https://app.originchaindb.com --org YOUR_ORG_UUID oc --profile work whoami oc --profile work --output table db list Compare the code shown in the terminal and browser before approving. The engine profile development remains separate from management profile work. Management login options. Organization administration Use a separately approved org:admin management profile and the required organization permissions. Existing read-only tokens remain read-only. Administration commands. Create or change a role Read permission list before choosing capability keys. Role updates can replace the entire permission list. Role options. Invite or update a member Use team invite to send an invitation and team set-role for an existing member. An invitation sends email; membership begins after acceptance. Team options. Use scripts and completion Use JSON for automation and check the exit code before consuming output. A command can return partial results and still fail. Output and exit codes · Shell completion. SQL is not automatically retried. After a timeout, check whether the statement took effect before sending it again. Remove local access oc --profile development credentials remove --kind engine oc connection remove development oc --profile work logout Log out any administrative profile too, then clear temporary environment credentials. These commands remove local settings; they do not delete the database or revoke remote credentials. Revoke remote access separately in the console. Update or uninstall the executable. Go Create a reusable Go client, pass request contexts and handle database results. Install and update Verify an approved CLI archive, add oc to your path and manage updates. --- ## Install the CLI | OriginChainDB docs Canonical source: https://originchaindb.com/docs/cli/install Install the CLI Verify an approved CLI archive, add oc to your path and manage updates. Install oc from the archive supplied for your operating system. Verify the package before running it, then check the installed version. Install a verified CLI buildThe approved preview archive is separate from a public stable release. 01 Choose your platform archiveUse the supplied release and its trusted checksum. 02 Verify the downloadCheck the SHA-256 before running the installer. 03 Install and check PATHMake the oc executable available to your shell. 04 Confirm the versionRun oc version; database access is checked separately. Get the right package Preview 0.6.0-dev.20261020 requires an approved archive, install.py and SHA256SUMS. A public stable download is not available yet. PlatformTarget Windows x64windows-amd64 Linux x64 / ARM64linux_amd64 / linux_arm64 macOS Intel / Apple Silicondarwin_amd64 / darwin_arm64 There is no Windows ARM64 or universal Mac package in this preview. Verify and install Have all three items ready: the archive for your platform, the supplied installer and the trusted archive digest. The digest identifies the bytes you expect; the executable's reported version identifies the program that actually runs. Use Python 3.9 or newer. Replace TRUSTED_SHA256 with the digest supplied through your trusted package-delivery channel, not a value from an unverified download. python install.py --archive originchaindb-cli-0.6.0-dev.20261020-windows-amd64.zip --sha256 TRUSTED_SHA256 The installer checks the hash and executable, keeps a recovery copy and does not need administrator access. To choose a directory without changing PATH: python3 install.py --archive PACKAGE --sha256 TRUSTED_SHA256 --directory INSTALL_DIRECTORY --no-path Use python on Windows. Quote paths that contain spaces. Check the installation On Windows, open a new terminal after installation; the installer normally updates user PATH. On Linux and macOS, follow the PATH instruction it prints or use the executable's full path. oc version oc help oc ui --render --plain Check that oc version matches the preview you installed. If it reports another version, another oc executable may be earlier on PATH. The last command shows the menu offline. These checks verify the local installation, not database access. Continue with connection setup when they work. Save credentials securely Operating systemStoreBefore saving WindowsCredential ManagerUse your normal user session. macOSKeychainUnlock your user Keychain. LinuxSecret ServiceInstall secret-tool and unlock the store. Debian and Ubuntu provide secret-tool in libsecret-tools. The CLI does not fall back to a plaintext file. In headless jobs, supply environment credentials through your secret manager. Account administration Management commands need the preview's compatible console login flow. Organization changes also need a separately approved org:admin token and matching permissions. Database queries still use an engine profile. Update a verified release Use the updater only when a signed release manifest and publisher key have been supplied. Check first, then install: oc update --manifest MANIFEST_HTTPS_URL --public-key TRUSTED_ED25519_PUBLIC_KEY --check oc update --manifest MANIFEST_HTTPS_URL --public-key TRUSTED_ED25519_PUBLIC_KEY This preview requires --public-key. The updater verifies signature, expiry, version, platform, size and SHA-256 over HTTPS. It refuses redirects and concurrent updates. A manifest URL is not evidence that a stable release exists. Recover or uninstall Recover: close CLI processes, restore the previous executable reported by the updater and run oc version. After a Windows crash, that backup may have a .previous suffix. Unlock: remove a stale update lock only after confirming that no update is running. Downgrade: restore a known-good executable manually. Uninstall: remove saved credentials and profiles, then delete the executable, recovery copies and unused PATH entry. Revoke remote credentials separately. Build from source With Go 1.23 or newer, run these commands from an approved CLI source checkout: go build -o oc ./cmd/oc ./oc help On Windows, use go build -o oc.exe ./cmd/oc and ./oc.exe help. Source builds are unsigned. See the checkout's RELEASING.md for packaging and the developer checks before distributing a build. CLI overview Set up an engine profile, run a parameterized query and choose your next CLI task. Command reference Find commands for connection profiles, SQL, search, organization access and scripts. --- ## CLI command reference | OriginChainDB docs Canonical source: https://originchaindb.com/docs/cli/reference CLI command reference Find commands for connection profiles, SQL, search, organization access and scripts. Reference for preview 0.6.0-dev.20261020. Put global flags before the command, and use oc COMMAND --help for that command's options. oc --profile development --output json --timeout 60s sql --file query.sql In the example, --profile chooses the connection, --output chooses the format and --timeout limits the request. sql is the command; --file is an option for that command. Keep this order when combining options. Find the command you needEngine commands and management commands use different connection profiles. 01 Choose the taskFind the command for queries, profiles or management. 02 Select the right profileMatch the profile type to the command. 03 Add flags and argumentsPut global flags before the command. 04 Read the resultUse structured output and the exit code in scripts. Find a command TaskCommands Inspect the CLIhelp, version Set up and check accessinit, doctor, health, server-version Save engine profilesconnection add, list, show, use, remove Manage local credentialscredentials save, credentials remove Query structured datasql, sql shell, schema list, schema show Query relationshipsgraph query, neighbors, reverse, bfs, path, dijkstra Query embeddingsvector list, put, query, explain, sparse, hybrid Search table fieldsfts index, fts search Search compatible indexessearch indices, query, count, mapping, settings, analyze Access your accountlogin, whoami, logout, db list, db show Manage roles and memberspermission list, role, team Work interactivelyui, completion Replace the executableupdate Database lifecycle, billing, bulk import, member removal and SQL autocomplete are outside this preview's command set. Terminal menu oc ui opens the menu. Add --plain to disable color, or --render to print it offline. Enter a menu number; b goes back, q quits and :cancel cancels. SQL, graph, vector and full-text actions use the engine profile. Roles, team and database discovery use the management profile. Changes require confirmation; SQL and Cypher can write data. Query history is off. Set up and check a profile Engine setup Load OC_BEARER and OC_DB_KEY, then run oc init for prompts, or: oc --profile development init --non-interactive --endpoint ENGINE_ORIGIN --tenant TENANT_ID --db-user DB_USER oc --profile development --output table doctor --target engine oc --profile development doctor --target engine --offline Setup checks health and schema access before saving. Existing names are not overwritten and failed setup leaves configuration unchanged. Schema access does not imply table permissions. OptionEffect --token-env NAME, --key-env NAMEChoose credential variable names. --ca-cert FILETrust a private certificate authority. doctor --target engine / managementCheck one connection family. doctor --offlineCheck local configuration without a request. Browser approval and saved credentials Use a console that supports this preview's CLI approval flow: oc --profile work login --browser --endpoint https://app.originchaindb.com --org YOUR_ORG_UUID Compare the 12-character code and approve within 10 minutes. Default approval is read-only database metadata access for 30 days. Use --no-browser to open the URL yourself. Console and management API must share an origin. oc --profile work credentials save --kind management oc --profile development credentials save --kind engine oc --profile work credentials remove --kind management Saving verifies access and uses the OS credential store. A saved item is bound to endpoint, identity and variable names; changing them invalidates it. Stored profiles do not silently fall back to environment credentials. Management login and database discovery For a compatible console's personal CLI token, load OC_CLI_TOKEN through a hidden prompt or secret manager. Then: oc --profile work login --endpoint https://app.originchaindb.com --org YOUR_ORG_UUID oc --profile work whoami oc --profile work --output table db list oc --profile work db show DATABASE_UUID --token-env NAME changes the token variable. login --store also saves it in the OS credential store. This management profile authorizes organization metadata, not database SQL. Run oc --profile work logout to remove its local login; revoke the remote token separately. Engine connections and configuration oc connection add development --endpoint ENGINE_ORIGIN --tenant TENANT_ID --db-user DB_USER oc connection list oc connection show development oc connection use development oc --profile development health oc --profile development server-version The first connection becomes active. connection remove NAME removes its local configuration. HTTPS and certificate verification are required except for loopback HTTP; redirects are refused. SettingSelection order Config file--config FILE, then OC_CONFIG, then the OS default. Profile--profile NAME, then OC_PROFILE, then the saved selection. Default config paths OSPath Windows%AppData%/originchain/config.json Linux$XDG_CONFIG_HOME/originchain/config.json or ~/.config/originchain/config.json macOS~/Library/Application Support/originchain/config.json Profiles store metadata and variable names, not credential values. Use a separate --config FILE with older CLI versions that cannot read management profiles. SQL and schemas oc schema list oc schema show SCHEMA_IDENTIFIER oc --output table sql --query 'SELECT $1 AS value' --params '[7]' oc sql --file query.sql oc --output csv sql --file report.sql > report.csv Use the identifier returned by schema list. --params accepts a positional JSON array. Single quotes protect $1 from the shell; a UTF-8 file avoids complex quoting. --file - reads standard input. A SQL result can contain rows, metadata or write counts. An empty row list is not the same as a failed command; check the exit code and the full JSON outcome when scripting. For one-shot transactions, run oc sql --query BEGIN and pass its returned session_id through --session SESSION_ID on every later statement, including COMMIT or ROLLBACK. SQL shell and recovery oc --profile development sql shell An unquoted semicolon submits buffered SQL as one request. Use --manual for procedure bodies, then submit with \g. Shell commandAction \gSubmit the buffer. \rClear pending input, including unfinished quotes. \statusShow the tracked transaction and pending input. \helpShow shell help. \qDiscard input and exit; roll back a known open transaction. The shell tracks a successful BEGIN until confirmed COMMIT or ROLLBACK. Normal quit or EOF rolls back a known open transaction; DDL and other immediately applied operations may persist. EOF does not submit unfinished input. On an error or Ctrl+C, the shell stops without retrying. Recover a reported session with oc sql --session ID. Cancellation does not prove a write stopped. Output and opt-in query history The shell defaults to tables; global --output json, jsonl or csv overrides it. Prompts go to stderr. oc sql shell --history-file ./my-sql-history.jsonl History is off unless requested. It records submitted SQL verbatim, including literals, up to 10 MiB. Unix files use mode 0600; Windows uses directory ACLs. Submission is not proof of success, and history is never replayed. Shell completion Completion covers commands, flags and saved profiles, not SQL or file paths. Choose your shell and load the generated script: oc completion powershell | Set-Content -Encoding utf8 ./oc-completion.ps1 . ./oc-completion.ps1 Add the source line to your shell profile to load it on startup. Completion honors OC_CONFIG and --config FILE. Graph and Cypher These examples assume a social.users schema, a follows relation and the keys shown. Substitute your own graph data. oc graph query --file query.cypher --schema social.users --params '{"name":"Alice"}' oc graph neighbors social.users --rel follows --pk alice oc graph reverse social.users --rel follows --pk carol oc graph bfs social.users --rel follows --pk alice --max-depth 3 oc graph path social.users --rel follows --src alice --dst carol --max-depth 3 oc graph dijkstra social.users --rel follows --src alice --dst carol --weights '{}' Use exactly one of --query or --file; --file - reads stdin. --params is a JSON object of named Cypher values. --schema supplies the default for unlabelled patterns. Depth is 1–64, default 3; path checks reachability. Dijkstra takes engine edge-weight JSON. Cypher may write and is not automatically retried. Vector operations oc vector list oc vector put embeddings --file vector.json oc vector query embeddings --file nearest.json oc vector explain embeddings --file nearest.json oc vector sparse embeddings --file sparse.json oc vector hybrid embeddings --file hybrid.json For a three-dimensional cosine table, vector.json contains: {"id":"one","embedding":[1,0,0],"dim":3,"metric":"cosine"} And nearest.json contains: {"query":[1,0,0],"dim":3,"k":10,"metric":"cosine"} The CLI accepts --file FILE or --query JSON_OBJECT; --file - reads stdin. Supply actual embeddings that match the stored model, dimension and metric. Sparse and hybrid inputs use the engine's corresponding request objects. A successful empty write is printed as {"ok":true}. Native full-text search Use a table and field with oc fts: oc fts index documents body --file document.json oc fts search documents body --text 'account setup' --mode bm25 --limit 10 oc fts search documents body --text 'account AND setup' --mode boolean oc fts search documents body --text 'account setup' --mode phrase document.json supplies the document ID and text: {"doc_id":"one","text":"Account setup instructions"} BM25 is the default mode. --limit is 1–1000, default 10; search text is limited to 10,000 UTF-8 bytes. Indexing accepts --query JSON_OBJECT or --file FILE and is not automatically retried. Elasticsearch-compatible search Use one lowercase index name with oc search: oc search indices oc search query articles --file search.json oc search count articles oc search mapping articles oc search settings articles oc search analyze articles --text 'account setup' Example search.json: {"size":10,"query":{"match":{"title":"account setup"}}} count also accepts --file or --query; analyze accepts --analyzer NAME. Results contain one page with no automatic scrolling or PIT traversal. Organization roles and members These commands require a compatible console, separate org:admin approval and the necessary role permissions. They do not grant engine access. oc --profile admin login --browser --scope org:admin --endpoint https://app.originchaindb.com --org YOUR_ORG_UUID oc --profile admin permission list oc --profile admin role list oc --profile admin team list Roles Use capability keys from permission list and the returned role UUID: oc --profile admin role create --name Analyst --permissions view-instances,read-data --yes oc --profile admin role update ROLE_UUID --name 'Project analyst' --permissions view-instances,read-data --yes oc --profile admin role delete ROLE_UUID --confirm ROLE_UUID --permissions KEYS replaces the complete list; omit it to keep the list, or use --permissions= to clear it. You can grant only capabilities you hold. Editing or deleting a custom role requires an owner. A role assigned to members cannot be deleted. Organization roles are separate from SQL grants. Team members oc --profile admin team invite --email colleague@example.com --role read_only --yes oc --profile admin team set-role MEMBER_UUID --role ROLE_UUID --yes Inviting sends email; membership starts after acceptance. Use member UUIDs from team list and either a built-in role key or custom-role UUID. The last owner cannot be demoted. Member removal uses the console. Output, limits and exit codes Choose table when reading output yourself and json when a script needs the complete outcome. Formats that keep only rows or hits can leave out information needed to diagnose a batch or partial result. FormatUse json (default)Complete response, metadata and batch outcomes. jsonlOne SQL row or search hit per line; otherwise the full object. csvSQL rows or search hits; nested values stay JSON in cells. tableReadable terminal output with control characters escaped. SQL tables and CSV keep column order; missing cells are null. Use JSON when you need metadata or exact integer digits. Schema show includes the manifest string. CLI limitValue UTF-8 input/request1 MiB Response32 MiB Default / maximum timeout30 seconds / 10 minutes These are CLI limits, not a database-wide capacity claim. ExitMeaning 0Success, help or version. 2Invalid arguments, configuration or input. 3Missing credentials, HTTP 401 or HTTP 403. 4Server/protocol failure, oversized response, stopped SQL batch, unknown SQL outcome or partial search. 5Network, TLS, timeout, redirect or output-write failure. 130Canceled request. Partial search and stopped SQL batches can print results and still return 4. Check the exit code before using output. Never replay uncertain SQL simply because the command failed. Install and update Verify an approved CLI archive, add oc to your path and manage updates. CLI troubleshooting Identify configuration, credential and query failures without blindly retrying writes. --- ## CLI troubleshooting | OriginChainDB docs Canonical source: https://originchaindb.com/docs/cli/testing CLI troubleshooting Identify configuration, credential and query failures without blindly retrying writes. Start with the failing profile. A successful management login does not prove that database queries have the right connection or permissions. Find where a CLI check failsA successful offline check does not prove that a database request can succeed. 01 Check the installed versionConfirm which CLI build you are testing. 02 Run offline diagnosticsCheck the selected profile without contacting the database. 03 Run online diagnosticsTest the connection and required credentials. 04 Try a bounded readFix the first failed check before testing a real query. Check the selected profile oc version oc --profile development --output table doctor --target engine For account commands, use oc --profile work doctor --target management instead. To inspect local settings without any server request: oc --profile development doctor --target engine --offline Read the first failed check and its suggested fix before changing credentials or connection settings. CheckWhat success establishes oc versionThe executable can run locally. Offline doctorThe selected profile's local settings can be checked without a server request. Online engine doctorThe configured engine passes the connection and access checks it performs. Your actual queryThe requested operation works with that data and credential. A pass at one stage does not establish the next. For example, local configuration can be valid while a table permission is missing. Fix the reported problem SymptomWhat to check next oc is not foundOpen a new terminal. Check the install directory and PATH. Missing engine credentialsLoad OC_BEARER and OC_DB_KEY, or save engine credentials for the selected profile. Credential store unavailableUnlock Keychain or Secret Service. Linux also needs secret-tool. Saved credentials fail after editing a profileRestore the original endpoint/identity or save credentials for the new settings. HTTP 401Check the selected credential, expiry and revocation. Use the matching engine or management login. HTTP 403Check database identity, organization, scope and role permissions. A new login does not grant missing access. TLS errorConfirm the HTTPS origin. Use --ca-cert FILE for the correct private CA instead of disabling verification. Login succeeds but SQL failsSelect an engine profile. Management tokens authorize account operations, not SQL. Partial search or stopped batchInspect returned results and exit code 4; earlier work may have succeeded. SQL timeout or interruptionCheck whether the statement took effect before resubmitting it. Cancellation is not proof of rollback. Verify command syntax oc init --help oc doctor --help oc sql --help Put global flags first: oc --profile development --output json --timeout 60s sql --file query.sql Use a SQL file to avoid shell quoting problems. For support, include the CLI version, command family, exit code and request ID when available. Remove tokens, database-user keys and private query data from shared logs. Exit codes · Recover a SQL session Check a source build These checks are for CLI contributors, not required for normal installation. From an approved source checkout: go test ./... -count=1 go vet ./... go build -o oc ./cmd/oc ./oc ui --render --plain On Windows, build oc.exe and run ./oc.exe. To check OS credential storage and shell completion: python3 scripts/verify_native.py Use python on Windows. Unix checks need the supported shells and an unlocked credential store. Passing these local checks does not establish live database compatibility. Run an isolated engine check Use a disposable loopback engine with OC_DB_RBAC_ENFORCE_WRITES=1. Set OC_SMOKE_DISPOSABLE=1, OC_SMOKE_URL and OC_SMOKE_TOKEN in the test process environment, then run: python3 scripts/smoke.py --binary ./oc --receipt smoke.json The script writes test data. Keep it off shared or production databases. Inspect the receipt, stop the disposable engine and remove its temporary data and credentials when finished. Command reference Find commands for connection profiles, SQL, search, organization access and scripts. --- ## Compatible with the MySQL wire protocol | OriginChainDB docs Canonical source: https://originchaindb.com/docs/compatibility/mysql-wire SQL clients & compatibility Compatible with the MySQL wire protocol This page records the earlier MySQL-compatible listener and its tested subset. It is retained to help readers understand existing integrations, not to offer a new connection method. Use HTTPS for new application connections, or a separate read-only PostgreSQL database login for supported clients. MySQL retirement changes are not a claim that every existing production listener has been disabled. Confirm an existing listener’s state with the team. Review a legacy MySQL connectionThis adapter is historical; use HTTPS for new writes or the supported PostgreSQL login for reads. 01 Identify the existing integrationCheck whether it still uses the historical MySQL adapter. 02 Confirm the actual listenerObtain its endpoint and access contract from the operator. 03 Verify TLS and identityDo not infer a working secure listener from a capability flag. 04 Test a supported readCompare results before choosing a replacement connection. What this is, and what it is not This adapter implements part of a network protocol. It does not run MySQL server software or provide full MySQL behavior. The SQL and catalog limits below still apply. The historical adapter supports the version-10 handshake, ordinary text queries and a prepared-statement subset. A prepared statement sends query structure separately from bound values. Test unsupported constructs as well as successful requests. Row-level security and column masking are applied inside the engine, below the wire, so a MySQL session sees exactly the rows and columns your policies allow - the same ones an HTTP call under that identity would see. Connect First find out whether your instance has a listener at all. Ask the capabilities endpoint: curl -s -H "Authorization: Bearer $OC_TOKEN" \ "https://$OC_HOST/v1/capabilities" | jq '.wire.mysql' # Until a listener is configured for your instance: # { "available": false } # # "available" reports that CONFIGURATION IS COMPLETE. It is a precondition # for starting a listener, not an observation of a bound socket - so when it # turns true, still check the port and a real login before you rely on it. Once it is enabled, connect the way you would connect to anything speaking this protocol: # The port follows the convention MySQL clients expect. The host and port # your instance is actually published on are shown in the console once the # listener is enabled - use those, not this default. mysql --host "$OC_MYSQL_HOST" --port 3306 \ --user "$OC_DB_USER" --password \ --ssl-mode=REQUIRED \ --database "$OC_DB" The authentication plugin depends on which credential model your listener runs: mysql_native_password for a shared credential, caching_sha2_password for per-user login. Both are what a stock client already negotiates, so you do not configure the plugin - you configure the model, and the plugin follows. TLS, and why a certificate is not optional The listener implements the standard TLS upgrade: it advertises TLS support in the handshake, a capable client answers by asking to upgrade before it authenticates, and the rest of the session runs inside TLS. That is exactly what --ssl-mode=REQUIRED does, so stock clients interoperate without special handling. a shared-credential listener fails open The historical shared-credential listener could start without a certificate and serve plaintext. Do not use it without verified TLS. Database permissions do not protect data while it crosses an unencrypted network. The historical per-user listener requires TLS and refuses to start without a certificate. Still configure the client to verify the server certificate. Credential models, and which one you will be on There are two, and the choice is not a preference - it is decided by whether your tenant has any database authorization to enforce: a database RBAC grant or a row-level security policy. Either one is enough; a row-security policy is not the lighter case. ModelWhat the client sendsYou are on it when sharedOne listener-wide password. Every session arrives as the same identity.Your tenant has no database RBAC grants and no row-level security policies at all. A shared credential cannot express a per-user grant or evaluate a per-user row policy, so the engine refuses to combine the two rather than serve them loosely. per-userEach database user authenticates with its own password, and its own grants apply for the session.Your tenant has any database RBAC grant, or any row-level security policy. This is the only model that can serve it. TLS is mandatory here, and the session is read-only. a per-user listener is read-only A per-user MySQL session refuses every write. Not some writes, and not writes your grants happen to disallow - the listener marks the session read-only when it admits an authenticated identity, before any grant is consulted, because there is no write-parity bridge on this adapter. INSERT, UPDATE, DELETE and DDL all come back refused, and no configuration turns this on. A tenant with database grants or row policies must use the authorization-capable login model. In this historical adapter, that model remains read-only. The write examples below belong to the historical shared-credential model. For new application writes, use the supported HTTPS API. The currently offered PostgreSQL database login is read-only. If a tenant requires per-user authorization but has no database user with a password, neither historical model can accept a login. Resolve the identity requirements with your administrator. A worked example: Sequelize over mysql2 The example records Sequelize 6.37 with mysql2 3.24 on the historical shared-credential listener. It demonstrates a declared single-table model. It does not establish current production support or automatic schema reflection. Connect and define import mysql2 from "mysql2"; import { Sequelize, DataTypes } from "sequelize"; // Verified against the shipping engine with Sequelize 6.37 over mysql2 3.24. const sequelize = new Sequelize(process.env.OC_DB, process.env.OC_DB_USER, process.env.OC_DB_PASSWORD, { host: process.env.OC_MYSQL_HOST, port: 3306, dialect: "mysql", dialectModule: mysql2, // Ask for TLS explicitly. A listener with no certificate will happily // serve you in cleartext instead of refusing - see "TLS" above. dialectOptions: { ssl: { minVersion: "TLSv1.2", rejectUnauthorized: true } }, logging: false, }); // Describe the table in code. Do NOT call sequelize.sync() and do not rely on // queryInterface.describeTable() - both introspect with SHOW, which is refused. const Order = sequelize.define( "Order", { id: { type: DataTypes.STRING, primaryKey: true }, customer: DataTypes.STRING, total_cents: DataTypes.INTEGER, status: DataTypes.STRING, }, { tableName: "orders", timestamps: false, freezeTableName: true }, ); await sequelize.authenticate(); Insert, select, update, delete // INSERT await Order.create({ id: "o_1", customer: "c_7", total_cents: 4200, status: "open" }); // SELECT with a filter and an ordering const open = await Order.findAll({ where: { status: "open" }, order: [["total_cents", "DESC"]], limit: 10, }); // UPDATE await Order.update({ status: "shipped" }, { where: { id: "o_1" } }); // DELETE, bounded by a WHERE await Order.destroy({ where: { id: "o_1" } }); Transactions Transactions are real, not acknowledged-and-ignored. A block that commits persists, and a block that rolls back leaves nothing behind - both were exercised. // Both outcomes were exercised against the engine: a transaction that // commits, and one that rolls back leaving no trace. const tx = await sequelize.transaction(); try { await Order.create({ id: "o_2", customer: "c_7", total_cents: 900, status: "open" }, { transaction: tx }); await Order.update({ status: "paid" }, { where: { id: "o_2" }, transaction: tx }); await tx.commit(); } catch (err) { await tx.rollback(); throw err; } More recipes, one per page, are under MySQL examples. The catalog surface Catalog queries let a tool inspect tables and fields. The historical adapter supports the information_schema views listed below, but refuses SHOW commands. A tool that depends on SHOW may fail even when ordinary reads work. Answered: the information_schema views Five views are served, by the same shared catalog the other wire protocols read: tables, columns, table_constraints, key_column_usage and referential_constraints. They are ordinary queries, so they work from any client: -- Answered by the shared catalog, the same one the other wire -- protocols and the HTTP API read. SELECT table_name FROM information_schema.tables WHERE table_schema = 'shop'; SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'orders'; Refused: every SHOW form mysql> SHOW TABLES; ERROR 1235 (42000): MySQL `SHOW …` metadata commands are not supported — the engine keeps no MySQL information schema. -- Refusing is the deliberate choice. The shared front door carries a -- PostgreSQL "SHOW " shim that would otherwise answer ANY SHOW with a -- single fabricated row reading x = 'on' - so SHOW TABLES would return a -- confident, wrong answer instead of an error. SHOW TABLES, SHOW DATABASES, SHOW COLUMNS, SHOW CREATE TABLE, SHOW INDEX, SHOW WARNINGS and SHOW VARIABLES LIKE … all return an error. We would rather hand you an error you can act on than a fabricated row you would believe. Session variables are handled separately and honestly: the ones a connector reads at startup are answered with their true values, and one that does not exist is refused with the unknown-variable error rather than a made-up value. SET NAMES is accepted as a no-op, because every official connector opens with one. Limits Every one of these returns a clear error naming the construct. None of them silently returns a different answer. the one that decides adoption Test both metadata queries and application queries. The historical adapter does not establish support for ORM associations or automatic schema management. For new work, use HTTPS or the currently offered read-only PostgreSQL login. Not supportedWhy, and what to write instead SHOW …No MySQL information schema is kept. Query the information_schema views listed above instead. REPLACE INTOIts delete-then-insert semantics reset unmentioned columns to defaults, which is not what the engine's upsert does. Use INSERT … ON DUPLICATE KEY UPDATE, which is translated. INSERT IGNORESilently swallowing errors is not a behaviour we will emulate. Handle the conflict explicitly. Multi-table DMLDELETE t1, t2 FROM …, DELETE … USING …, DELETE … ORDER BY / LIMIT and joined UPDATEs. The engine models single-table DML; a DELETE bounded by WHERE works. GROUP_CONCAT, SUBSTRING_INDEXNo engine equivalent to map them onto. Most other common scalar functions are translated or pass through unchanged. User variables (@x)The engine has nowhere to keep session-scoped user variables. Keep the value in your application. Multi-statement queriesSend one statement per query. Do not enable your driver's multi-statement option. Double-quoted strings"x" is parsed as an identifier, not a string. Spell strings with single quotes - 'x' - which is what clients do anyway. Chunked parameter sendsA prepared statement whose parameter was streamed in chunks is refused rather than executed with an incomplete value. Bind the value in one go. Trademark MySQL is a registered trademark of Oracle Corporation and/or its affiliates. OriginChainDB is not affiliated with, endorsed by, or sponsored by Oracle Corporation. OriginChainDB implements a compatible wire protocol so that existing MySQL clients can connect to it; it does not distribute MySQL software. Connect MySQL or SQL Server Previous Page SQL Server compatibility Next Page --- ## Oracle SQL dialect | OriginChainDB docs Canonical source: https://originchaindb.com/docs/compatibility/oracle-dialect SQL clients & compatibility Oracle SQL dialect OriginChainDB supports a subset of Oracle-style SQL syntax. This is query-language compatibility, not an Oracle network connection: Oracle Net, SQL*Plus and Oracle client libraries cannot connect directly. Use the HTTPS SQL endpoint for supported statements. A PostgreSQL client can provide the currently offered read-only database-login path. Check each construct’s limits before moving an Oracle query; a compatible spelling does not establish full Oracle behavior. Check Oracle-style SQL before moving itOracle-style syntax support does not provide an Oracle Net connection. 01 Choose a statementStart with a small query from your application. 02 Check supported constructsReview functions, types and any preview restrictions. 03 Send it through HTTPSUse the supported SQL endpoint and its credentials. 04 Compare the resultCheck nulls, empty strings and returned data types. How to connect. There is no Oracle-specific endpoint. Use the HTTPS SQL endpoint for supported reads and writes. Copy its complete address and credential instructions from Connect. The currently offered PostgreSQL login is a separate, read-only connection. Copy its actual host, port, username and password from Database login; do not infer them from an HTTPS URL. Test the Oracle-style SELECT statements your client sends against the supported subset. See Connect a SQL client. MySQL and SQL Server are not offered as new connection choices in the redesigned console. The command below is a PostgreSQL reference example; replace its connection values with the ones for your deployment. # A PostgreSQL client, talking Oracle SQL. Nothing Oracle-specific here. psql "host= port=5432 dbname=postgres \ user= password= sslmode=require" => SELECT NVL(region, 'unknown') AS region FROM sales.orders MINUS SELECT NVL(region, 'unknown') FROM sales.returns; What the three tiers mean. A familiar SQL spelling can still have different behavior. Use the categories below to identify supported syntax and its limits, then compare results on a small dataset before moving a workload. Generally available — shipped, and Oracle-equivalent within the scope named in the row. Preview — shipped and reachable, but deliberately narrower than Oracle. The served shape is described; everything outside it is refused with a 400 that names the construct, never answered approximately. Not supported — not accepted today. The rewrite that gets you the same answer is in the row. A preview feature supports only the shape listed. Keep a query that tests each important boundary as part of your migration checks. Generally available. These behave as Oracle does within the scope described. Two dialect-wide differences apply throughout and are worth internalising once: a zero-length string is not NULL here (Oracle treats '' as NULL), and a chosen operand is returned with its own type rather than coerced to the first argument’s type — so keep the operands of one call in one type. ConstructWhat ships, and its scope CREATE SEQUENCE nextval() / currval()CREATE SEQUENCE [IF NOT EXISTS] name [START WITH n] [INCREMENT BY n], then nextval('name') / currval('name') in an INSERT/UPDATE value position or as a bare FROM-less SELECT. The counter is durable before use — flushed to disk before the value is handed out — so a crash never re-issues an id, and a refused statement burns no value. Refused at CREATE, each by name: CYCLE, MINVALUE/MAXVALUE, OWNED BY, AS , INCREMENT BY 0. Oracle’s CACHE/NOCACHE has no analogue: every value here is durable, which is the NOCACHE behaviour. seq.NEXTVAL seq.CURRVALThe Oracle pseudocolumn spelling, any case, routing to the same durable counter as the function spelling. It inherits every restriction of that spelling deliberately — same permitted call sites, same read-only and replica gating. INSERT ... SELECT seq.NEXTVAL FROM t is therefore still refused: that is the table-scanning case, and per-row sequence generation is not what this surface does. NVL(a, b)Yields a when it is not NULL, else b — the same result as COALESCE(a, b), which also ships. Wrong arity is refused at translate time rather than answered NULL, because a NULL is indistinguishable from a legitimate result. Carries the two dialect-wide differences above. NVL2(a, b, c)Yields b when a is not NULL, else c; only the branch actually taken is evaluated. CASE WHEN a IS NOT NULL THEN b ELSE c END is the portable spelling and is also served. MINUSOracle’s MINUS and standard EXCEPT are the same operator, so the word is rewritten and the statement is then the EXCEPT the set-operation path has always served — it adds no narrowing of its own. The rewrite applies only outside string literals, quoted identifiers and comments, so SELECT 'a MINUS b' keeps its value and a column named "MINUS" keeps its name. FROM DUALThe clause is recognised on a single un-joined, un-aliased factor named dual or sys.dual (any case) and stripped, so SELECT 1 FROM dual behaves exactly like the FROM-less spelling — constants, arithmetic, scalar functions, CASE, CAST, and WHERE / ORDER BY / LIMIT over the one synthetic row. The residual: recognition is textual, so a table genuinely named dual is reached only by shapes that read table content (a column reference, *, GROUP BY, a join, an alias). Avoid naming a table dual. Preview. Shipped and reachable, narrower than Oracle. Each row names the shape that is served; outside it the statement is refused rather than translated into a different question. ConstructServed shape — and where it stops ROWNUMThe row cap ports: WHERE ROWNUM <= n becomes a limit, a projected ROWNUM rn numbers the returned rows from 1, and the nested Oracle pagination idiom (... WHERE ROWNUM <= 20) WHERE rn > 10) returns the window it returns in Oracle. Oracle’s counter semantics are preserved rather than approximated: ROWNUM > 1 matches nothing, as in Oracle, and is never lowered to an offset. Refused (because ROWNUM is assigned before the sort and before grouping, so the obvious lowering would silently change the answer): a cap in the same block as ORDER BY, or alongside DISTINCT / GROUP BY / HAVING / an aggregate / a window function; a cap on a level that already has LIMIT/OFFSET/FETCH; ROWNUM under an OR, compared to a column, or used in GROUP BY / HAVING / ORDER BY / a join condition. For “top n by x” use ORDER BY x FETCH FIRST n ROWS ONLY. CONNECT BY START WITHSTART WITH ... CONNECT BY [PRIOR] col = col over a single relation is rewritten to the equivalent recursive query and does the hierarchy walk. Refused by name, never executed with the clause dropped: LEVEL, SYS_CONNECT_BY_PATH, CONNECT_BY_ROOT, CONNECT_BY_ISLEAF, ORDER SIBLINGS BY, joins or multiple relations, and any relationship that is not a single PRIOR-anchored equality. Carry depth as a column of your own until LEVEL lands. WITH RECURSIVEThe standard-SQL replacement for CONNECT BY, executed to a fixed point. UNION ALL only, exactly one recursive CTE per statement, no CTE column list, no aggregate over the recursive relation in the outer projection. Two caps you will meet first: 100 iterations of depth and 1,000,000 accumulated rows; crossing either returns a 400 naming the cap. There is no CYCLE clause — carry the visited set as a column. SUBSTRFor positive offsets it agrees with Oracle exactly — SUBSTR('abcdef', 2, 3) is 'bcd'. A negative start offset is refused with a 400 naming the divergence rather than answered, because Oracle counts it from the end of the string and these are PostgreSQL semantics. For the last N characters write SUBSTR(s, LENGTH(s) - (N - 1), N). INSTRThe 2-argument form ships and is Oracle-equivalent: the 1-based position of the first occurrence, 0 when absent. The 3rd and 4th arguments (start position, occurrence number) are refused rather than evaluated with the extras ignored — a query using them needs restructuring, not a rename. DECODEShips with the Oracle semantic that trips hand-rewrites: DECODE compares NULL-equals-NULL, so a NULL search term matches a NULL input. (If you rewrite to CASE instead, remember WHEN x = NULL is never true — that arm must become WHEN x IS NULL.) Narrower in one way: there is no implicit conversion of search terms to the first term’s datatype, so DECODE(1, '1', 'y', 'n') is 'y' in Oracle and does not match that arm here. Nothing is silently converted or silently matched — the ambiguous case is refused. Keep the input, search terms and results in one type per call. SYSDATE SYSTIMESTAMPBoth spellings ship (SYSDATE and SYSDATE()), folded to an ISO-8601 value at translate time on the same path as NOW(), so one statement sees one value. The difference to carry across: the engine answers in UTC, where Oracle’s SYSDATE is the database server’s local time. TO_DATEConstant arguments only — both the value and the format model must be quoted literals. Format models served: 'YYYY-MM-DD', 'DD-MON-YYYY', 'YYYY/MM/DD', 'MM/DD/YYYY'. Where it binds cleanly is the direct comparison, bare column on one side: WHERE d >= TO_DATE('2026-01-01', 'YYYY-MM-DD'). Express a date restriction as a range over the bare column rather than through Oracle’s TRUNC(d) = TO_DATE(...) idiom, which does not give the same answer here. TO_CHAR, TO_NUMBER and TO_TIMESTAMP do not ship — supply ISO-8601 text. (+) outer joinOne shape: a single SELECT over exactly two comma-joined tables, every (+) marking the same table, each marked predicate a plain t1.col = t2.col(+). It is rewritten to a LEFT OUTER JOIN with the marked table as the optional side, and unmarked conjuncts move to the residual WHERE — which is Oracle-faithful, not a shortcut. Everything else is refused: three or more relations, a mix with explicit JOIN syntax, marks on both sides of one equality, a mark against a constant or inside a function, and WITH/GROUP BY/HAVING/DISTINCT alongside it. Refusing matters here because the natural fallback — drop the marks and join — is an INNER join, which silently returns fewer rows. The anti-join AND t2.id IS NULL is also refused, the same refusal the hand-written ANSI spelling gets. MERGE INTOOne narrow shape: MERGE INTO t USING (VALUES ...) AS s (c1, ...) ON t.pk = s.k WHEN MATCHED THEN UPDATE SET ... WHEN NOT MATCHED THEN INSERT .... It is lowered onto the same upsert plan as INSERT ... ON CONFLICT, inheriting its conflict-target rules and its access gate. Refused: a USING source that is a table or subquery, conditional WHEN ... AND, WHEN MATCHED THEN DELETE, BY SOURCE/BY TARGET, more than one clause of a kind, and an ON that is not a conjunction of equalities covering exactly the primary key or one unique index. A set-based MERGE driven by a query has to be restructured. Not supported. Not accepted today. Each row carries the rewrite that gets you the same answer, so you can plan the port rather than discover the gap at cutover. ConstructWhat to write instead PIVOT / UNPIVOTBuild the cross-tab with conditional aggregates — SUM(CASE WHEN k = 'a' THEN v END) AS a, ... with a GROUP BY — which is served over a single table and over a join. What is not expressible is the dynamic form, where the output columns come from the data: the engine plans a fixed projection, so those column names must be known when the statement is written. ROWIDRow identity here is the declared primary key, which every registered table has; row version for optimistic concurrency is the value the If-Match surface uses. Note that an Oracle ROWID is a physical address and is not stable across a reorganisation, so code that persisted one was already relying on something no primary key provides — that logic needs revisiting, not translating. (The row-cap uses of ROWNUM are a separate construct and do port — see Preview above.) Flashback queryAS OF TIMESTAMP, AS OF SCN and VERSIONS BETWEEN are not accepted, and no session setting makes a SELECT read an earlier state. Historical recovery here is an operator-driven point-in-time restore against a recovery point, which produces a restored database rather than answering a query mid-session — a different tool for a different job. See Operations. PL/SQL properAnonymous BEGIN blocks submitted as statements, packages, %ROWTYPE / %TYPE anchored declarations, BULK COLLECT / FORALL and autonomous transactions are not accepted. Stored procedures do ship in a different shape — see below. Oracle Net (TNS)Not planned — a decision rather than a gap. The engine’s SQL wire protocol is PostgreSQL’s, so an Oracle-shaped application connects through a PostgreSQL driver and its SQL is what has to be portable, which is what the rest of this page is about. There is no TNS listener, no Oracle Net negotiation and no OCI surface. Do not read this row as work that is queued. Stored procedures: the boundary. The engine reference describes a preview subset shaped like PL/pgSQL, PostgreSQL’s procedural language. It is not Oracle PL/SQL: packages cannot be copied across unchanged. Use the supported HTTPS path for creation and write-capable calls, and verify availability on your instance. What ships. CREATE PROCEDURE name(p1 TYPE, ...) AS BEGIN ... END, invoked with CALL. A CALL outside a client transaction runs the whole body atomically: an uncaught failure discards every prior statement in the body. Control flow: DECLARE, assignment, IF/ELSIF/ELSE, CASE, LOOP, WHILE, FOR over a range and FOR over a query, EXIT/CONTINUE, RETURN, RAISE, PERFORM, dynamic EXECUTE, and nested BEGIN ... END scopes. SELECT ... INTO [STRICT], binding the first row’s columns positionally. Cursors, including a client-returning fetch: DECLARE c CURSOR FOR / OPEN c FOR, then FETCH ... INTO to bind locals, or FETCH without INTO to deliver rows to the caller. Forward fetch only. RETURN QUERY and RETURN NEXT to build a result set for the caller. EXCEPTION WHEN ... THEN handlers on any block, with the block’s own writes rolled back before the handler runs. A client CALL cannot collect OUT parameters. Return values to the caller with RETURN QUERY or a client-returning FETCH instead. CALL arguments are literals. No packages, no %ROWTYPE / %TYPE anchored declarations, no BULK COLLECT / FORALL, and no anonymous blocks submitted as a statement. No COMMIT inside a body, and no autonomous transactions — the body commits as one unit at the end. Catchable conditions are OTHERS, no_data_found, too_many_rows and integrity_constraint_violation. A finer SQLSTATE name is refused at CREATE rather than silently caught as OTHERS. Loops are capped at 100,000 iterations, and a CALL expands to a bounded statement budget — a RETURN NEXT loop is not the way to return a large result set; RETURN QUERY is. No loop labels, no FOREACH ... IN ARRAY, no dynamic cursors, and no backward fetch directions. A CALL issued inside a client BEGIN…COMMIT joins that transaction rather than opening its own, which forfeits the body’s all-or-nothing property: on a failure the body’s earlier statements stay in your transaction and a later COMMIT persists them. Roll back explicitly if that is not what you want. Identifier case: the first thing that will bite you. Oracle folds unquoted names to uppercase. OriginChainDB folds them to lowercase. A quoted name keeps its exact case, so a query for an uppercase quoted name differs from its lowercase spelling. Choose one naming convention before importing a schema. Check table names first when a migrated query reports a missing object. A per-tenant identifier case-resolution setting — which would let an instance resolve identifiers the way Oracle does — is in development and is not available on any instance today. Do not plan a migration around it. The workaround below is the supported answer for now, and it is a good habit regardless. What to do today: pick one convention and never leave it. Preferred — unquoted everywhere. Strip the double quotes from your DDL and from your queries. Every identifier folds to lower case consistently, and Oracle-style unquoted SQL keeps working because it folds too — just in the other direction, to the same place. Or — quoted everywhere, in one case. If your DDL created "EMP", then every reference to it must also be "EMP", in every query, view and procedure body. This works, but it is unforgiving: one unquoted mention resolves to emp and fails. Never mix. A schema with both "EMP" and emp is legal and is the worst outcome — two real tables, one typo apart. -- Oracle DDL, replayed as-is. Creates a table named `emp` (folded down). CREATE TABLE hr.EMP (id NUMBER, ename VARCHAR2(30)); -- Fails: there is no "EMP", because the quotes ask for it exactly. SELECT * FROM hr."EMP"; -- error: table not found -- Works: unquoted, folds to `emp`, matches what the DDL created. SELECT * FROM hr.EMP; SELECT * FROM hr.emp; -- the same table Worked examples. These examples show supported Oracle-style statements. Run writes through the authenticated HTTPS SQL endpoint; the currently offered PostgreSQL login is read-only. Prepare the referenced tables before running the examples. 1. A sequence-backed insert Both spellings work and share one durable counter, so you can port the Oracle spelling and migrate it later — or not at all. CREATE SEQUENCE hr.emp_seq START WITH 1000 INCREMENT BY 1; -- The Oracle pseudocolumn spelling: ships as-is. INSERT INTO hr.emp (id, ename) VALUES (hr.emp_seq.NEXTVAL, 'KING'); -- The function spelling: the same counter, same durability. INSERT INTO hr.emp (id, ename) VALUES (nextval('hr.emp_seq'), 'CLARK'); -- Read the value the session last took. SELECT hr.emp_seq.CURRVAL FROM dual; -- REFUSED - this is the table-scanning case, and it would mean -- "one sequence value per scanned row", which this surface does not do: -- INSERT INTO hr.emp (id, ename) SELECT hr.emp_seq.NEXTVAL, ename FROM staging.emp; 2. NULL handling and FROM DUAL The one difference to remember: an empty string is not NULL here, so NVL('', 'x') is '' rather than Oracle’s 'x'. SELECT NVL(commission, 0) AS commission, NVL2(manager_id, 'reports', 'top') AS position, DECODE(dept, 10, 'ops', 20, 'sales', 'other') AS dept_name FROM hr.emp; -- FROM DUAL is recognised and stripped: SELECT SYSDATE FROM dual; -- answers in UTC SELECT 1 + 1 FROM sys.dual; -- either spelling, any case 3. Row caps and pagination The cap and the nested pagination idiom port. The combination that would silently change meaning is refused, and the refusal names both rewrites. -- Works: a plain cap. SELECT id FROM hr.emp WHERE ROWNUM <= 10; -- Works: the classic nested pagination idiom, rows 11-20. SELECT * FROM ( SELECT a.*, ROWNUM rn FROM ( SELECT id, ename FROM hr.emp ORDER BY id ) a WHERE ROWNUM <= 20 ) WHERE rn > 10; -- Matches NOTHING - exactly as in Oracle, where the counter only -- advances on a returned row. It is not an OFFSET. SELECT id FROM hr.emp WHERE ROWNUM > 1; -- REFUSED: ROWNUM is assigned BEFORE the sort, so this is -- "10 arbitrary rows, then sorted" in Oracle - not the 10 smallest. -- SELECT id FROM hr.emp WHERE ROWNUM <= 10 ORDER BY id; -- Write the top-n you actually meant: SELECT id FROM hr.emp ORDER BY id FETCH FIRST 10 ROWS ONLY; 4. Hierarchy and set difference CONNECT BY does the walk; LEVEL does not ship yet, so carry depth yourself if you need it. -- Walks the reporting tree from the top down. SELECT id, ename FROM hr.emp START WITH manager_id IS NULL CONNECT BY PRIOR id = manager_id; -- The portable spelling of the same walk, with depth carried as a column: WITH RECURSIVE tree AS ( SELECT id, ename, 1 AS depth FROM hr.emp WHERE manager_id IS NULL UNION ALL SELECT e.id, e.ename, t.depth + 1 FROM hr.emp e JOIN tree t ON e.manager_id = t.id ) SELECT id, ename, depth FROM tree; -- MINUS is a spelling of EXCEPT and inherits its behaviour exactly. SELECT region FROM sales.orders MINUS SELECT region FROM sales.returns; 5. The (+) outer join The two-table shape is rewritten to a LEFT OUTER JOIN. Anything wider is refused rather than turned into an inner join behind your back. -- Served: two tables, all marks on one side, plain col = col. SELECT e.ename, d.dname FROM hr.emp e, hr.dept d WHERE e.dept_id = d.id(+); -- Which is exactly this, and you may prefer to write it directly: SELECT e.ename, d.dname FROM hr.emp e LEFT OUTER JOIN hr.dept d ON e.dept_id = d.id; Next. Everything the base SQL surface serves — joins, aggregates, window functions, CTEs, constraints and transactions — is on the SQL reference, and it is what you fall back to wherever an Oracle spelling stops. To get a client connected, start at Connect a SQL client. If a statement you depend on is refused, the message names the construct — send it to us and it becomes a tracked gap rather than a surprise. Oracle and Java are registered trademarks of Oracle Corporation and/or its affiliates. OriginChainDB is not affiliated with, endorsed by, or sponsored by Oracle Corporation. OriginChainDB implements a compatible subset of the Oracle SQL dialect so that existing SQL can be ported to it; it does not distribute, embed or resell Oracle software, and it does not implement Oracle’s network protocol. SQL Server compatibility Previous Page Compatibility overview Next Page --- ## The SQL Server wire protocol | OriginChainDB docs Canonical source: https://originchaindb.com/docs/compatibility/sqlserver-tds SQL clients & compatibility The SQL Server wire protocol This page records the earlier SQL Server-compatible TDS listener. TDS is the network protocol used by SQL Server clients; implementing part of it does not make OriginChainDB a SQL Server installation. TDS is not offered for new connections. Existing listener state and historical examples remain separate from that product decision. For new work, use HTTPS or a supported read-only PostgreSQL database login. Check an existing TDS integrationTDS is a historical adapter; new integrations should use a currently supported connection. 01 Identify the legacy clientRecord the queries and connection settings it uses. 02 Confirm listener availabilityAsk the operator for the actual endpoint and supported contract. 03 Verify the secure loginCheck TLS and the required database identity. 04 Run a supported SELECTValidate read results before relying on the integration. Check what is bound, not what is configured The capability flag reports configuration readiness, not proof that a port is listening. For an existing listener, confirm its status and perform an authorized login using the supplied host and port. # 1. What does this instance say about the adapter? curl -s "https://$OC_HOST/v1/capabilities" | jq '.families.mssql_tds_dialect' # 2. "available" means CONFIGURED, not "a socket is listening". # Check the socket too. nc -vz $OC_SQL_HOST 1433 # 3. Then prove it end to end with a real login, not a port scan. # (sqlcmd, or the JDBC / Go snippets further down this page.) 1433 is the port SQL Server clients expect and the one used throughout this page, but the host and port your instance is published on are shown in the console once a listener exists. Use those. The limitations your own instance reports beside available are derived from its configuration, and are authoritative for it. TLS is mandatory, and it fails closed The historical TDS listener requires TLS. A missing or unusable certificate can prevent it from starting. Check listener status, certificates and network access when a connection fails. It is enforced at four places, each of which fails closed: At startup. If the certificate and key are missing, empty or unloadable the listener does not bind, and the reason is logged. The check runs before the bind, so no port is ever presented as up. At PRELOGIN. A client that offers no encryption, or asks for it to be off, is answered with the protocol byte meaning encryption is required by the server and the connection is closed cleanly, before the login packet is read. It is not downgraded and not accepted-then-ignored. Against login-only encryption. Encrypting the login and then reverting to plaintext — which a real SQL Server will do — is rejected by design, not merely unimplemented. It protects the credential while streaming every query and every result row in clear, which for a database leaks exactly what the credential would have unlocked. In the type system. The command loop takes an encrypted stream that only a completed handshake can produce, so "no session runs unencrypted" is a compile-time property of the adapter rather than a rule someone has to remember. Set encrypt=true and leave trustServerCertificate at false so your client actually validates the chain. The handshake itself is the TDS-framed variant that commercial SQL Server drivers require during negotiation; the stream switches to ordinary TLS records from the login packet onward. TLS behavior differs between the historical adapters. Follow the requirements for the specific listener rather than copying another protocol’s settings. Connecting with a real client Only drivers that have actually been driven against the engine appear here, at the versions they were driven at. Java — mssql-jdbc 13.4.0 and 12.10.1 // Measured against mssql-jdbc 13.4.0 and 12.10.1 - 34 of 34 checks passed. String url = "jdbc:sqlserver://" + System.getenv("OC_SQL_HOST") + ":1433" + ";databaseName=" + System.getenv("OC_DATABASE") + ";encrypt=true" // mandatory - there is no other way in + ";trustServerCertificate=false" + ";hostNameInCertificate=" + System.getenv("OC_SQL_HOST") + ";loginTimeout=30"; try (Connection conn = DriverManager.getConnection( url, System.getenv("OC_DB_USER"), System.getenv("OC_DB_PASSWORD"))) { try (PreparedStatement ps = conn.prepareStatement( "SELECT TOP 50 id, customer_ref, amount_cents" + " FROM invoices WHERE status = ? ORDER BY amount_cents DESC")) { ps.setString(1, "open"); try (ResultSet rs = ps.executeQuery()) { while (rs.next()) { System.out.println(rs.getInt("id") + " " + rs.getString("customer_ref")); } } } } Go — microsoft/go-mssqldb 1.11.0 // Measured against microsoft/go-mssqldb 1.11.0 - 21 of 21 checks passed. package main import ( "database/sql" "fmt" "net/url" "os" _ "github.com/microsoft/go-mssqldb" ) func main() { q := url.Values{} q.Set("database", os.Getenv("OC_DATABASE")) q.Set("encrypt", "true") // mandatory q.Set("TrustServerCertificate", "false") // validate the chain dsn := url.URL{ Scheme: "sqlserver", User: url.UserPassword(os.Getenv("OC_DB_USER"), os.Getenv("OC_DB_PASSWORD")), Host: os.Getenv("OC_SQL_HOST") + ":1433", RawQuery: q.Encode(), } db, err := sql.Open("sqlserver", dsn.String()) if err != nil { panic(err) } defer db.Close() rows, err := db.Query( "SELECT TOP 50 id, customer_ref FROM invoices WHERE status = @p1", "open") if err != nil { panic(err) } defer rows.Close() for rows.Next() { var id int var ref string if err := rows.Scan(&id, &ref); err != nil { panic(err) } fmt.Println(id, ref) } } Worked, page-sized versions of both, plus the prepared-statement path, are in the TDS examples. Credential models A listener runs in one of two models, and the choice is not yours to make freely — it follows from whether the tenant has any database authorization to enforce: a database RBAC grant or a row-level security policy. Either one is enough; a row-security policy is not the lighter case. ModelWhat the login carriesApplies when sharedOne listener-wide credential. Every session arrives as the same identity.The tenant has no database RBAC grants and no row-level security policies at all. A shared credential cannot enforce a per-user grant or evaluate a per-user row policy, so the engine will not let the two be combined. per-userEach database user logs in with its own password, under the mandatory TLS, and its own grants apply.The tenant has any database RBAC grant, or any row-level security policy. This is the only model that can serve it, and the session is read-only. a per-user listener is read-only A per-user TDS session refuses every write. Not only the writes a grant disallows — the listener marks the session read-only the moment it admits an authenticated identity, before any grant is consulted, because there is no write-parity bridge on this adapter. INSERT, UPDATE, DELETE and DDL all come back refused, and no configuration turns this on. A tenant with database grants or row policies requires per-user authentication. Those sessions remain read-only in this adapter. The write examples below belong to the historical shared-credential model. For new application writes, use the supported HTTPS API. The currently offered PostgreSQL database login is read-only. If a tenant requires per-user authorization but has no database user with a password, neither historical model can accept a login. Resolve the identity requirements with your administrator. The T-SQL boundary, exactly The adapter translates a supported T-SQL subset into OriginChainDB SQL. T-SQL is SQL Server’s query language. Review the translated and refused constructs below before porting a statement. That makes the boundary easy to test and unpleasant to discover late. Here it is. Translated T-SQL you writeWhat it becomes [bracket] identifiersA plain name unwraps; a name with spaces or punctuation, or a reserved word such as [order], becomes a double-quoted identifier. Every position a statement can put one in. SELECT TOP n · TOP (n)LIMIT n OFFSET n ROWS FETCH NEXT m ROWS ONLYLIMIT m OFFSET n. Always lowered — a FETCH left alone would be ignored and silently return every row. ISNULL · LEN · CHARINDEX · IIFCOALESCE, LENGTH, POSITION, CASE GETDATE · SYSDATETIME · SYSUTCDATETIMEOne statement-time UTC value, folded so every call in a statement agrees. CONVERT(type, expr)CAST(expr AS type). The UTF-16 character types (NVARCHAR, NCHAR, NTEXT) collapse onto the engine's string types and UNIQUEIDENTIFIER onto its UUID type, in casts and in DDL column definitions alike. Only mappings that change no value representation are made: BIT, MONEY and DATETIME2 are deliberately left alone, so the engine refuses them with a clear error rather than accept mis-typed data. a + b (string concatenation)CONCAT(a, b), but only when both operands are provably string. Two numbers stay arithmetic; one string and one unknown is ambiguous in T-SQL itself and is refused. SUBSTRING · REPLACE · LTRIM · RTRIM · UPPER · LOWERPass through unchanged — they are engine natives. -- Every line below is rewritten and executed. Send it as an ordinary -- SQL_BATCH, or as the statement text of a parameterized RPC. SELECT TOP 20 [order].[id], [customer name] FROM [order] WHERE ISNULL([status], 'open') = 'open' ORDER BY [amount cents] DESC; SELECT id, LEN(customer_ref) AS ref_len, CHARINDEX('-', customer_ref) AS dash_at, IIF(amount_cents > 100000, 'large', 'small') AS bucket, CONVERT(NVARCHAR(32), amount_cents) AS amount_text FROM invoices ORDER BY id OFFSET 40 ROWS FETCH NEXT 20 ROWS ONLY; Refused, cleanly Each of these comes back as an error token naming the construct and, where one exists, the portable rewrite. Nothing runs, nothing is half-applied, and the connection survives. ConstructWhy, and what to write instead @var · @@FUNCTIONBatch-level variables and built-in globals are not modelled. Bind a parameter, or compute the value in your application. #temp objectsPer-session temporary objects are not modelled. Create an ordinary table. GOA client-tool batch separator, not a server statement. Send one statement per batch. It is caught before parsing, because the grammar would otherwise read a trailing GO as a column alias. MERGEUse INSERT ... ON CONFLICT. SELECT ... INTO newtableThe engine parses the INTO clause and drops it, so passing it through would report a successful table copy that created nothing. Use CREATE TABLE then INSERT ... SELECT. DATEADD · DATEDIFFThe substrate has no calendar timestamp type — timestamps are ISO-8601 strings — so there is no sound mapping. Do date arithmetic in your application. CONVERT with a style codeStyle codes and USING charsets are formatting semantics that are not reproduced. Format in your application. TOP ... PERCENT · WITH TIESNo LIMIT equivalent. The same applies to FETCH ... PERCENT / WITH TIES. TOP in UPDATE / DELETEConstrain the statement with a WHERE predicate. Anything the SQL Server grammar cannot parseReported with the parse failure rather than attempted. A final safety net also refuses any translated output still carrying an un-rewritten bracket identifier, rather than letting it reach the engine as a wrong name. -- Each of these is REFUSED with an explicit error. Nothing executes, -- nothing is half-applied, and the connection stays open. DECLARE @cutoff INT = 100000; -- @variables are not modelled SELECT @@VERSION; -- @@functions are not modelled SELECT * INTO #recent FROM invoices; -- # temp objects are per-session GO -- a client-tool directive, not a statement MERGE invoices AS t USING staged AS s -- use INSERT ... ON CONFLICT instead ON t.id = s.id WHEN MATCHED THEN UPDATE SET t.status = s.status; SELECT DATEADD(day, -7, GETDATE()); -- no calendar timestamp type SELECT CONVERT(VARCHAR(10), created_at, 112); -- style codes are formatting SELECT TOP 10 PERCENT * FROM invoices; -- no LIMIT equivalent DELETE TOP (100) FROM invoices; -- constrain with WHERE instead SELECT * INTO archive FROM invoices; -- SELECT ... INTO would create nothing Three approximations to know about These translate, and for ordinary inputs they agree with SQL Server. They are listed because for unusual inputs they do not: LEN does not reproduce T-SQL's trailing-space trim, so LEN('a ') counts the spaces. GETDATE() yields an ISO-8601 UTC string, because there is no datetime type to yield instead. CONCAT treats NULL as empty where T-SQL's + propagates it. Only reachable where both operands are provably string, which is the only case that translates at all. Stored procedures: the distinction that costs money Prepared statements use protocol calls such as sp_prepare and sp_execute. Support for those calls does not mean the server can run stored procedures written by your application. User-written T-SQL stored procedures are not served by this path. Plan to rewrite them or move their logic to your application. Also refused on this path, cleanly rather than mis-served: the server-side cursor family, OUTPUT value parameters (there is no variable-assignment surface that could produce one), bulk load, and multiple active result sets. Temporal parameter values decode best-effort in this preview — integer, float, bit, string, numeric and unique-identifier parameters are exact. OriginChainDB does have procedures. They are written in a PL/pgSQL-shaped subset, created and called over the SQL endpoint or the PostgreSQL wire, and they are a genuinely different language. Here is what a small one looks like on both sides — note that nothing about the T-SQL version survives except its intent: -- SQL Server (T-SQL). This does NOT run on OriginChainDB. CREATE PROCEDURE dbo.settle_invoice @id INT, @settled INT OUTPUT AS BEGIN DECLARE @amount INT; SELECT @amount = amount_cents FROM invoices WHERE id = @id; IF @amount IS NULL THROW 50001, 'no such invoice', 1; UPDATE invoices SET status = 'settled' WHERE id = @id; SET @settled = @@ROWCOUNT; END; -- OriginChainDB. A different procedural language, so this is a rewrite - -- not a port. Issue it over the SQL endpoint or the PostgreSQL wire. CREATE PROCEDURE settle_invoice(IN p_id INT, INOUT p_settled INT) LANGUAGE plpgsql AS $$ DECLARE v_amount INT; BEGIN SELECT amount_cents INTO v_amount FROM invoices WHERE id = p_id; IF v_amount IS NULL THEN RAISE EXCEPTION 'no such invoice'; END IF; UPDATE invoices SET status = 'settled' WHERE id = p_id; GET DIAGNOSTICS p_settled = ROW_COUNT; END; $$; Inventory and test application procedures individually. A protocol compatibility layer does not translate an entire procedural program. How far this has been proven The table records a historical interoperability test using the named Microsoft drivers. It is evidence for those versions and request shapes, not a claim that every TDS client or current deployment has been tested. DriverVersionResult mssql-jdbc13.4.034 / 34 mssql-jdbc12.10.134 / 34 microsoft/go-mssqldb1.11.021 / 21 The recorded test date is 2026-09-07. The checks covered TLS login, table creation, inserts, decoded SELECT results, prepared statements, batches and rejection of a wrong credential. These were manual checks, not a continuous test service. Re-run the operations your application needs against its target deployment; the results below do not establish current production availability. Limits, in one place The T-SQL procedural language is not implemented. No variables, no built-in globals, no control-flow batches, no GO, no temp tables, no T-SQL stored procedures, triggers or functions. Procedures are a PL/pgSQL-shaped subset and are a rewrite. This is a preview surface. It is not generally available, it is off on every instance unless someone turned it on, and it is not self-serve. TLS is required absolutely. No certificate means no listener, and a client that will not encrypt is refused before it can log in. Server-side cursors, bulk load and multiple active result sets are refused — cleanly, but refused. So is calling a user stored procedure, and so are OUTPUT value parameters. Date and time arithmetic does not translate. There is no calendar timestamp type behind this surface. Interop is verified, not continuously verified, against the three driver versions named above and no others. Other TDS clients may work; they have not been measured, so we do not claim them. For new connections, use the HTTPS SQL endpoint or a supported read-only PostgreSQL database login. Their own limits still apply. Third-party names identify the protocols and driver versions discussed here. Microsoft, SQL Server and T-SQL are Microsoft trademarks; PostgreSQL and MySQL belong to their respective owners. OriginChainDB is independent and is not affiliated with or endorsed by these organizations. MySQL compatibility Previous Page Oracle SQL dialect Next Page --- ## Connect an Elasticsearch client | OriginChainDB docs Canonical source: https://originchaindb.com/docs/connect-elasticsearch Elasticsearch clients Connect an Elasticsearch client Use a supported Elasticsearch 7.x client to send document, search and aggregation requests to OriginChainDB. Start with one connection check and one sample document before moving an application. This compatibility API requires a supported dedicated deployment. It is separate from the normal application Connect flow. Confirm its complete endpoint and credential requirements in current support. Connect an Elasticsearch-compatible clientThe dedicated endpoint supports a documented subset, not every Elasticsearch operation. 01 Copy the search endpointUse the separate endpoint supplied for your dedicated instance. 02 Configure a supported clientUse the documented Elasticsearch 7.x connection settings. 03 Index one test documentChoose an explicit mapping and a known document ID. 04 Search and verify itConfirm the returned ID and fields match what you wrote. What you can connect. Use a client that supports the Elasticsearch 7.x REST API, and test the operations your application needs against the supported subset. The endpoint reports version 7.14.2. This is not a claim of compatibility with every client, dashboard, or query. Connection details. Point the client at your endpoint and authenticate with an API key from the console. info() is the handshake — it is what the client uses to confirm it is talking to Elasticsearch. const { Client } = require('@elastic/elasticsearch') const es = new Client({ node: 'https://', // your instance URL + /v1/tenants//es auth: { username: 'originchaindb', password: process.env.OC_API_KEY } }) await es.info() // reports version 7.14.2 Insert data. Index a single document by _id. It is searchable the instant the call returns — there is no refresh interval to wait on. await es.index({ index: 'shop.products', id: 'sku-8842', body: { name: 'Carbon Marathon', brand: 'Aero', price: 149 } }) Load many at once with _bulk (newline-delimited actions). This is the fast path for backfills and ingest. await es.bulk({ body: [ { index: { _index: 'shop.products', _id: 'sku-1207' } }, { name: 'Trail 24', brand: 'Aero', price: 89 }, { index: { _index: 'shop.products', _id: 'sku-3355' } }, { name: 'City Runner', brand: 'Metro', price: 72 } ] }) Or straight over HTTP — the same NDJSON body a stock Elasticsearch cluster takes: POST /_bulk {"index":{"_index":"shop.products","_id":"sku-1207"}} {"name":"Trail 24","brand":"Aero","price":89} _update is a partial merge — the fields you send are updated and every other field is preserved. await es.update({ index: 'shop.products', id: 'sku-8842', body: { doc: { price: 139 } // name, brand, ... untouched } }) Search and aggregate. The Query DSL you already write — bool, match, term, filters — with aggregations in the same request. await es.search({ index: 'shop.products', body: { query: { bool: { must: [{ match: { name: 'marathon' } }], filter: [{ term: { brand: 'Aero' } }] } }, aggs: { by_brand: { terms: { field: 'brand' } } } } }) Also supported: _count, _msearch, _mget, search_after deep paging, collapse, _delete_by_query and _update_by_query (both honor max_docs), and _reindex into a fresh index. Read a document straight back with GET or HEAD /:index/_doc/:id, or /:index/_source/:id for the bare document; ask what a field looks like with _field_caps; and guard a bulk write with if_seq_no — a stale precondition comes back as a per-item 409 and every other item in the batch still lands. Security comes with the search. Use the identity and access rules intended for the application. Test both permitted and denied queries, including searches over sensitive fields. Keep credentials on the server and review authentication before exposing a search endpoint to users. Limits, stated plainly. The API implements a documented subset of the Elasticsearch surface. Unsupported request bodies can return an explicit error, but unknown URL parameters are currently ignored. A successful response does not confirm that every requested option was applied. Aggregations: terms, metrics, range, histogram, date_histogram, percentiles, top_hits, sub-aggregations and pipeline aggs are in, and so is filters — named buckets, each its own query, with sub-aggregations over exactly that bucket. Send filters in its own request: it is answered with one search per filter. extended_stats is also supported. composite and nested are not answered yet, and missing on a metric aggregation is refused rather than filled in with a value you did not choose. Suggesters: the term suggester corrects a word against what is actually indexed in a field, with suggest_mode honored. Options carry the corrected text and a score, and no document frequency — that number is not available to this API, and we would rather omit a field than report one we cannot stand behind. The phrase and completion suggesters are refused by name. Scoring: function_score and per-field boosts are in; script_score and rescore are refused. Deep paging: search_after for sorted pagination. Scroll and Point-in-Time (PIT) are also supported; inspect /v1/capabilities for deployment limits. Cluster management: Legacy and composable index templates are supported. ILM and snapshot administration are not supported over this API. Vector / kNN search lives on a dedicated surface. Version: the cluster reports 7.14.2; pin clients to the 7.x line. Feature coverage is a separate question from scale — see Full-text search for how the index is built and what a single node holds. Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries. OriginChainDB is not affiliated with, endorsed by, or sponsored by Elasticsearch B.V. OriginChainDB implements a compatible HTTP API so that existing Elasticsearch clients can talk to it; it does not distribute Elasticsearch software. Compatibility overview Previous Page Your first search Next Page --- ## Connect a PostgreSQL client | OriginChainDB docs Canonical source: https://originchaindb.com/docs/connect-sql-client SQL clients & compatibility Connect a PostgreSQL client Use a PostgreSQL-compatible client to read your database. Copy the real listener settings from Connect and use your separate database login. The currently offered login is read-only; it does not authorize SQL writes or ORM schema migrations. Connect your SQL client for readsPostgreSQL database logins are read-only; use HTTPS for supported writes. 01 Open Database loginCopy its host, port, database and separate login credentials. 02 Configure TLSUse the certificate and SSL settings supplied for this connection. 03 Test the connectionRun SELECT 1 with the intended database identity. 04 Read a known tableCheck a small result before connecting your application. Check listener availability Open Connect → PostgreSQL for the instance. Confirm that the listener is enabled and that you have an active database login. An HTTPS endpoint or a protocol listed in engine capabilities is not proof that a usable SQL listener exists. Copy the actual connection details Copy Host, Port, Database, SSL and Username from the supplied settings. Do not assume port 5432 or derive the SQL host from the HTTPS address. Use Database login to create or reset your own password where available. A password is shown only after creation or reset; an existing password cannot be revealed. OC_TOKEN is an HTTPS credential, not a PostgreSQL password. Follow the instance’s network requirements and use the permitted client address. Connect with psql Replace every placeholder in this reference command with the supplied listener settings. Use the appropriate CA file and hostname verification for your driver. The first query should return one row with connected = 1. TLS is required. sslmode=require encrypts the connection but does not by itself verify the certificate. Check your libpq version, server-name handling and CA configuration; do not disable verification to suppress an error. # Set these from Connect → PostgreSQL for your instance. export PGHOST="YOUR_SQL_HOST" export PGPORT="YOUR_SQL_PORT" export PGDATABASE="YOUR_DATABASE" export PGUSER="YOUR_SQL_USER" # Supply PGPASSWORD through your secret manager or let psql prompt for it. # Use the TLS mode and CA supplied for the listener. export PGSSLMODE="verify-full" export PGSSLROOTCERT="/path/to/provided-ca.pem" psql --command "SELECT 1 AS connected;" DBeaver Create a PostgreSQL connection with the standard PostgreSQL driver. Enter the supplied host, port, database and username. Configure the supplied TLS trust settings and enter the database-login password. Test the connection, then run SELECT 1 AS connected. Read a small known table. A successful read does not establish support for every object-browser feature or schema editor. This is setup guidance, not a certification of every DBeaver version. pgAdmin Register a server with the supplied connection and TLS settings. Use Query Tool to run a small read. Some monitoring views issue PostgreSQL catalog queries outside the supported subset, so test the pages you need. The connection remains read-only. ODBC and reporting tools Use a compatible PostgreSQL ODBC driver and the same listener and TLS settings. Test the report’s metadata queries as well as its data query. Do not infer complete reporting-tool compatibility from a successful login. Check the operations your application sends Test the exact read statements and metadata queries your driver sends. PostgreSQL protocol support does not mean full PostgreSQL compatibility. The current database-login contract is read-only; write support in newer source is not a deployed feature. For application writes, use the supported HTTPS API and check the configured credential’s permissions. See PostgreSQL compatibility. Transactions and access controls A database login is tied to one database and its linked database identity. Its permissions cannot exceed the member’s current access. Test as that identity, not with an administrative credential. Do not use write transactions, schema migrations or ORM automatic schema creation through the current read-only login. Use HTTP transactions only on a deployment that supports them. Troubleshoot a failed connection Timeout: check listener status, DNS, the network route and any address restrictions. TLS failure: check the hostname, CA, driver version and certificate verification. Login failure: check the separate database username/password and reset status. Statement failure: keep the SQLSTATE and message, then check support and permissions. Remove passwords from logs and screenshots before sharing them. For application access without a SQL driver, use the HTTP API. PostgreSQL ingest connector Previous Page PostgreSQL compatibility Next Page --- ## MySQL and SQL Server wire protocols | OriginChainDB docs Canonical source: https://originchaindb.com/docs/connect-wire-protocols SQL clients & compatibility MySQL and SQL Server wire protocols For new connections, use the HTTPS API or a PostgreSQL database login. PostgreSQL currently offers read-only access and uses a separate username and password. The protocol details below are historical compatibility references. MySQL and SQL Server are no longer offered as new connection choices, but existing listeners have not been universally disabled. Do not use older enablement instructions as current setup guidance. Start with Connect a PostgreSQL client. Choose a supported connection todayHistorical MySQL and TDS notes are not instructions for a new deployment. 01 Decide what the client needsSeparate application writes from SQL-client reads. 02 Choose the supported interfaceUse HTTPS, or the PostgreSQL login for read-only tools. 03 Copy that interface’s settingsDo not reuse another protocol’s endpoint or password. 04 Test the intended operationVerify the actual queries your client sends. Check what is bound, not what is configured The capability flag reports configuration readiness, not proof that a port is listening. For an existing listener, confirm its status and perform an authorized login using the supplied host and port. # 1. Does the tenant report the listener as CONFIGURED? # The families sit at the TOP level of the payload, not under a wrapper. curl -s "https://$OC_HOST/v1/capabilities" \ | jq '.mysql_wire_dialect.available, .mssql_tds_dialect.available' # 2. Is a socket actually LISTENING? # (1) can say "configured" while (2) refused to bind, so run both - # and give the port scan a control, or a silent "no" proves nothing. nc -vz $OC_SQL_HOST 443 # control: this MUST answer nc -vz $OC_SQL_HOST 3306 # MySQL wire nc -vz $OC_SQL_HOST 1433 # TDS # If the control line fails too, your path is blocked and you have # measured your own network, not our listener. # 3. Prove it end to end with a real login, not a port scan. mysql --host=$OC_SQL_HOST --port=3306 --user=$OC_DB_USER \ --ssl-mode=REQUIRED -e "SELECT 1" Use the host and port supplied for the existing listener. The numbers in the examples are conventions, not deployment settings. Credential models, and which one your tenant is on The historical listeners had shared and per-user credential models. Database permissions determine which model can be admitted; consult the table before evaluating an existing integration. ModelWhat the client sendsUse it when sharedOne listener-wide password. Every session arrives with the same identity.Your tenant has no database RBAC grants at all. A shared credential cannot enforce per-user grants, so the engine will not let you combine the two. per-userEach database user authenticates with its own password verifier, and its own grants apply.Your tenant has any database RBAC grant. This is the only model that can serve it. Two refusals you should expect, and what they mean A listener can refuse to start when it cannot enforce the configured access model. Read its error before changing credentials or permissions. 1. A shared credential against a tenant that has RBAC: DENIED: this tenant has database RBAC configured on N object(s) (...). ANY grant counts Remedy: switch the listener to per-user login. Any grant counts - one grant on one object is enough to make a shared credential inadmissible, and so does any row-level security policy; a row policy is not the lighter case. Note what that buys and what it costs: the session becomes enforced, and read-only. 2. Per-user login against a tenant with no usable database user: DENIED: per-user login is configured but this tenant has NO enabled database user with a password verifier, so no session could ever be admitted. Refusing to bind. Remedy: create at least one enabled database user that has a password verifier. -- Give the tenant at least one ENABLED database user WITH a password -- verifier, and the per-user listener has something it can admit. CREATE USER app_service WITH PASSWORD 'generate-a-real-secret-here'; GRANT SELECT, INSERT, UPDATE ON invoices TO app_service; per-user login is read-only - on both listeners Per-user MySQL and TDS sessions are read-only in this historical contract. They refuse INSERT, UPDATE, DELETE and schema changes even when a grant would otherwise permit the operation. A tenant with database grants or row policies must use the authorization-capable login model. In this historical adapter, that model remains read-only. The write examples below belong to the historical shared-credential model. For new application writes, use the supported HTTPS API; the currently offered PostgreSQL database login is also read-only. If a tenant requires per-user authorization but has no database user with a password, neither historical model can accept a login. Resolve the identity requirements with your administrator; do not weaken permissions to make the connection succeed. MySQL wire protocol The following MySQL example records an earlier client setup. Use only confirmed settings for an existing listener; it is not a new-connection walkthrough. TLS is not optional here In the historical shared-credential mode, a missing certificate could leave the MySQL listener serving plaintext. Do not use that configuration. Require TLS and certificate verification at the client. Per-user mode requires a certificate before the listener can start. Worked example - Sequelize 6.37 over mysql2 3.24 // Verified against the engine with Sequelize 6.37 on mysql2 3.24. import { Sequelize, DataTypes } from "sequelize"; const sequelize = new Sequelize( process.env.OC_DATABASE, process.env.OC_DB_USER, process.env.OC_DB_PASSWORD, { host: process.env.OC_SQL_HOST, port: 3306, dialect: "mysql", dialectModule: require("mysql2"), dialectOptions: { // Required in practice. See "TLS is not optional here" below. ssl: { minVersion: "TLSv1.2", rejectUnauthorized: true }, }, // The engine cannot reflect a schema yet, so DEFINE every model // explicitly and never call sequelize.sync() to discover one. define: { timestamps: false, freezeTableName: true }, }, ); const Invoice = sequelize.define("invoices", { id: { type: DataTypes.INTEGER, primaryKey: true }, customer_ref: DataTypes.STRING, amount_cents: DataTypes.INTEGER, status: DataTypes.STRING, }); await sequelize.authenticate(); // Single-table reads and writes work, transactions included. const tx = await sequelize.transaction(); try { await Invoice.create( { id: 4101, customer_ref: "ACME-77", amount_cents: 129900, status: "open" }, { transaction: tx }, ); await Invoice.update({ status: "settled" }, { where: { id: 4101 }, transaction: tx }); await tx.commit(); } catch (err) { await tx.rollback(); // Rollback is honoured; the row does not appear. throw err; } const open = await Invoice.findAll({ where: { status: "open" }, order: [["amount_cents", "DESC"]], limit: 50, }); What this does not do Measured against the real engine, on a listener using the shared credential model: a full ORM connects, authenticates, and runs a complete single-table workload - reads, writes, and transactions that both commit and roll back. On a per-user listener the writes in that sentence do not happen at all - see below. Two further things it cannot do on either model: Schema reflection. The ORM cannot read table shapes back from the listener, so anything that discovers a schema - describeTable, sync, model autoloading, and the migration tooling built on them - does not work. Declare your models by hand. Associations. Related models do not load. Eager loading with include and the lazy accessors that go with it do not resolve. do not call sync() An ORM schema-sync failure may leave earlier DDL applied. Schema changes are not necessarily rolled back with data writes. Review the resulting objects before retrying, and use a tested migration procedure instead of assuming a failed sync made no changes. The historical MySQL adapter does not support all schema-reflection or association queries. Test those operations separately; a working single-table example is not full ORM compatibility. // NOT served today. Both of these fail against the MySQL listener. // 1. Schema reflection - there is nothing to read a table shape back from. await sequelize.getQueryInterface().describeTable("invoices"); // fails await sequelize.sync(); // fails // 2. Associations - a modelled domain does not load. Invoice.hasMany(LineItem, { foreignKey: "invoice_id" }); await Invoice.findAll({ include: [LineItem] }); // fails // Do this instead: declare every model by hand (as above) and issue the // second query yourself, joining in your own application code. const invoices = await Invoice.findAll({ where: { status: "open" } }); const items = await LineItem.findAll({ where: { invoice_id: invoices.map((i) => i.id) }, }); TDS - the SQL Server wire protocol Point a TDS client at $OC_SQL_HOST:1433. The same two credential models apply. TLS is mandatory, and it fails closed A certificate and key are required. Without loadable PEMs the port is not bound at all - there is no cleartext fallback and no degraded mode to ship by accident. If the port does not answer, an unloadable certificate is the first thing to check. Set encrypt=true and leave trustServerCertificate at false so your client actually validates the chain. Worked example - mssql-jdbc 13.4.0 and 12.10.1 // Verified with mssql-jdbc 13.4.0 and 12.10.1 - 34 of 34 checks passed. String url = "jdbc:sqlserver://" + System.getenv("OC_SQL_HOST") + ":1433" + ";databaseName=" + System.getenv("OC_DATABASE") + ";encrypt=true" // mandatory - the listener is TLS-only + ";trustServerCertificate=false" + ";hostNameInCertificate=" + System.getenv("OC_SQL_HOST") + ";loginTimeout=30"; try (Connection conn = DriverManager.getConnection( url, System.getenv("OC_DB_USER"), System.getenv("OC_DB_PASSWORD"))) { // Prepared statements, including server-side handles and reuse. try (PreparedStatement ps = conn.prepareStatement( "SELECT id, customer_ref, amount_cents FROM invoices" + " WHERE status = ? ORDER BY amount_cents DESC")) { ps.setString(1, "open"); try (ResultSet rs = ps.executeQuery()) { while (rs.next()) { System.out.println(rs.getInt("id") + " " + rs.getString("customer_ref")); } } } // Batch execution. conn.setAutoCommit(false); try (PreparedStatement ins = conn.prepareStatement( "INSERT INTO invoices (id, customer_ref, amount_cents, status)" + " VALUES (?, ?, ?, ?)")) { for (Object[] row : rows) { ins.setInt(1, (Integer) row[0]); ins.setString(2, (String) row[1]); ins.setInt(3, (Integer) row[2]); ins.setString(4, (String) row[3]); ins.addBatch(); } ins.executeBatch(); } conn.commit(); } Worked example - microsoft/go-mssqldb 1.11.0 // Verified with microsoft/go-mssqldb 1.11.0 - 21 of 21 checks passed. package main import ( "context" "database/sql" "fmt" "net/url" "os" _ "github.com/microsoft/go-mssqldb" ) func main() { dsn := (&url.URL{ Scheme: "sqlserver", User: url.UserPassword(os.Getenv("OC_DB_USER"), os.Getenv("OC_DB_PASSWORD")), Host: os.Getenv("OC_SQL_HOST") + ":1433", RawQuery: url.Values{ "database": {os.Getenv("OC_DATABASE")}, // Mandatory - the listener is TLS-only and validates. "encrypt": {"true"}, "TrustServerCertificate": {"false"}, }.Encode(), }).String() db, err := sql.Open("sqlserver", dsn) if err != nil { panic(err) } defer db.Close() rows, err := db.QueryContext(context.Background(), "SELECT id, customer_ref, amount_cents FROM invoices"+ " WHERE status = @p1 ORDER BY amount_cents DESC", sql.Named("p1", "open")) if err != nil { panic(err) } defer rows.Close() for rows.Next() { var id, amount int var ref string if err := rows.Scan(&id, &ref, &amount); err != nil { panic(err) } fmt.Println(id, ref, amount) } } How far this has been proven The driver-level defects that previously blocked both commercial drivers are fixed, and interop is proven end to end against the real engine - the framed TLS handshake, prepared-statement handles and batch execution included. The measured results were 34 of 34 for mssql-jdbc (13.4.0 and 12.10.1) and 21 of 21 for microsoft/go-mssqldb 1.11.0. Historical driver results apply only to their tested versions and engine build. They are not ongoing verification; repeat the required checks on any existing integration you intend to keep. Those historical driver runs used the shared-credential model. They do not verify the per-user read-only login or current production sign-in. Test the actual identity and deployment you will use. Applications written for Oracle Database dialect, not transport This distinction decides whether you can adopt us, so it is worth being blunt about. We support a slice of the Oracle SQL dialect, and we serve it over the PostgreSQL wire. We do not implement Oracle Database's TNS network protocol, there is no listener on 1521, and we do not intend to build one. That is a decision, not a backlog item - the compatibility matrix answers no, not later. The consequence: an Oracle client library cannot connect to us at all. An Oracle-shaped application connects through a PostgreSQL driver, and what has to port is the SQL, not the transport. If your application can be repointed at a PostgreSQL driver, a large slice of its SQL already works unchanged. If it is welded to an Oracle client library, it cannot connect, and no amount of dialect coverage changes that. # An application written for Oracle Database connects with a PostgreSQL # driver, on the PostgreSQL wire port. There is no TNS listener to point # an Oracle client library at. psql "host=$OC_SQL_HOST port=5432 dbname=$OC_DATABASE user=$OC_DB_USER sslmode=require" Served, and equivalent within scope ConstructScope DUALThe one-row dual table. NVLTwo-argument form; the operands must share one type. An empty string is not NULL here. NVL2Three-argument form; the branches must share one type. An empty string is not NULL here. SequencesCREATE SEQUENCE and the sequence object itself. NEXTVAL pseudocolumnseq.NEXTVAL as a projection - the Oracle spelling. MINUSA pure spelling alias for EXCEPT: the same operator, whole-word rewritten. Served, but narrower than Oracle Database Each of these ships and is useful, and each is narrower than the construct you know. Where a shape falls outside the served scope it is refused by name rather than executed with the clause quietly dropped - a dropped clause would return a confident, wrong answer. ConstructWhere it narrows CONNECT BYSTART WITH ... CONNECT BY [PRIOR] col = col over a single relation, rewritten to the equivalent WITH RECURSIVE. The hierarchy walk is served, and so are the pseudocolumns LEVEL, CONNECT_BY_ROOT col and SYS_CONNECT_BY_PATH(col, sep) - each carried down the recursion, so WHERE LEVEL <= 3 post-filters the walked hierarchy exactly as Oracle Database does. Refused by name: CONNECT_BY_ISLEAF, ORDER SIBLINGS BY, a PRIOR outside the CONNECT BY condition, more than one relationship, anything but a single PRIOR col = col equality, joins or multiple tables, a subquery in the FROM, and GROUP BY / HAVING / DISTINCT. A pseudocolumn is also refused as a sort key in every spelling - sort on a plain column instead. Nothing is executed with the clause dropped: that would return the unwalked base table with a 200. ROWNUMThe row-cap idioms port, and Oracle Database's counter semantics are preserved rather than approximated. WHERE ROWNUM <= n becomes a row cap; a projected ROWNUM rn numbers the returned rows from 1; the nested pagination idiom (... WHERE ROWNUM <= 20) WHERE rn > 10 returns the window Oracle returns; and WHERE ROWNUM > 1 matches nothing, as in Oracle, rather than being lowered to an offset. Refused by name, because ROWNUM is assigned before the sort and before grouping: a cap in the same block as ORDER BY, or alongside DISTINCT / GROUP BY / HAVING / an aggregate / a window function; a cap on a level that already carries LIMIT / OFFSET / FETCH; and ROWNUM under an OR, compared to a column, or used in GROUP BY / HAVING / ORDER BY / a join condition. For top-n write ORDER BY x FETCH FIRST n ROWS ONLY. One inconsistency to know about: the capability payload still folds ROWNUM into its rowid entry and reports it as roadmap, because that entry covers both pseudocolumns and has not been split yet. The behaviour above is what the engine does. DECODENULL equals NULL, and there is no implicit conversion of the search terms. INSTRTwo-argument form only; the position form is refused. SUBSTRPostgreSQL semantics, positive offsets only. MERGEShips, and is narrower than Oracle Database's full MERGE grammar. (+) outer joinOne provably equivalent shape: a single SELECT over exactly two comma-joined tables, all marks on one side, each marked predicate a plain col = col. Every other shape is refused rather than answered as an inner join, which would silently lose the unmatched rows the query was written to keep. Recursive queriesWITH RECURSIVE, within a documented narrower scope. SYSDATEShips, narrower than Oracle Database. TO_DATEShips, narrower than Oracle Database. Refused today, with the portable rewrite ConstructWhat to write instead ROWIDRefused. Row identity here is the declared PRIMARY KEY, which every registered table has. A ROWID in Oracle Database is a physical address and a primary key is not one, so code that persisted ROWIDs was relying on something a primary key does not provide - that logic needs revisiting rather than translating. The row-cap uses of ROWNUM are a different construct and do port; see the preview table above. PIVOT / UNPIVOTRefused. Build the cross-tab with conditional aggregates - SUM(CASE WHEN ... THEN ... END) with a GROUP BY - which is served over a single table and over a join. Flashback queryRefused: AS OF TIMESTAMP, AS OF SCN, VERSIONS BETWEEN. A historical read here is an operator-driven point-in-time restore at the backup surface, not a clause inside a SELECT. PL/SQLRefused. Stored program units are not accepted. TNS network protocolNot implemented, and not planned - the compatibility matrix answers no, not later. See the callout above. -- Served, and equivalent within the documented scope: SELECT NVL(discount_pct, 0), NVL2(shipped_at, 'shipped', 'pending') FROM orders; SELECT seq_invoice.NEXTVAL FROM DUAL; SELECT sku FROM catalogue MINUS SELECT sku FROM discontinued; -- Served, but narrower than Oracle Database (see the scope column): SELECT LEVEL, id, manager_id FROM staff START WITH manager_id IS NULL CONNECT BY PRIOR id = manager_id; SELECT DECODE(status, 'O', 'open', 'C', 'closed', 'other') FROM invoices; MERGE INTO invoices t USING staging s ON (t.id = s.id) WHEN MATCHED THEN UPDATE SET t.status = s.status; -- ROWNUM row caps port, with Oracle's counter semantics kept: SELECT id FROM invoices WHERE ROWNUM <= 10; -- becomes a row cap SELECT id FROM invoices WHERE ROWNUM > 1; -- returns NOTHING, as in Oracle SELECT * FROM ( -- the pagination idiom, verbatim SELECT a.*, ROWNUM rn FROM ( SELECT id, ref FROM invoices ORDER BY id ) a WHERE ROWNUM <= 20 ) WHERE rn > 10; -- REFUSED by name, because ROWNUM is assigned BEFORE the sort: this is -- ten arbitrary rows THEN sorted in Oracle, not the top ten by date. -- SELECT * FROM invoices WHERE ROWNUM <= 10 ORDER BY created_at; SELECT * FROM invoices ORDER BY created_at FETCH FIRST 10 ROWS ONLY; -- NOT served. ROWID has no equivalent; row identity is the PRIMARY KEY. -- SELECT ROWID, id FROM invoices; -- refused A note on the names used on this page Every third-party name here is used to describe protocol or dialect compatibility, and for no other purpose. MySQL and Oracle are registered trademarks of Oracle Corporation and/or its affiliates. Microsoft and SQL Server are trademarks of the Microsoft group of companies. PostgreSQL is a registered trademark of the PostgreSQL Community Association of Canada. Sequelize, mysql2, mssql-jdbc and go-mssqldb are the property of their respective owners. OriginChainDB is not affiliated with, endorsed by, or sponsored by any of them. OriginChainDB is not any of these products - it is an independent database that speaks their wire protocols and accepts parts of their SQL. PostgreSQL compatibility Previous Page MySQL compatibility Next Page --- ## Use the current console | OriginChainDB docs Canonical source: https://originchaindb.com/docs/console Use the current console The console is the web interface for your databases. Use it to find connection details, browse records, run queries and manage access. The redesigned console is currently a local preview. Its sample screens do not provision a database or issue usable credentials. On a connected deployment, the available actions depend on your permissions and the instance capabilities. Find your database in the consoleThe local preview demonstrates navigation; a live instance supplies its own connection details. 01 Sign inOpen the organization that owns your database. 02 Select an instanceCheck its name and state before opening it. 03 Choose a workspaceUse data, queries or access settings for your task. 04 Connect your applicationCopy the live instance’s connection details when it is ready. Open your workspace Sign in, choose the organization that owns your database, then open Instances. Select an instance to enter its workspace. In the redesign, Summary shows the instance status, Infrastructure shows its deployment details, and Activity shows events. Workbench, Database login and Connect are available from the instance header. Create an instance and connect Open Instances and choose New instance. Review the offered configuration and location. For a live deployment, wait for provisioning to complete. A saved preview entry is not a running database. Open Connect and choose API or PostgreSQL. Copy the values provided for that instance. Save any shown-once secret securely. For API access, use the full OC_URL exactly as supplied and the credential identified as OC_TOKEN. Do not derive the URL from the display name or remove path segments. Access-token support depends on the deployment; some configurations still use an instance key. PostgreSQL uses a separate username and password. Its currently offered database-login capability is read-only. See SQL client connections. Read-only tables and unavailable actions Data Explorer shows tables, fields, records and indexes. An action may be unavailable because of your role, the table structure or an instance capability. Read the explanation beside the control. The demo stores local samples and drafts. A successful edit there does not change a live database. For a connected action, inspect the returned status and verify the result. Manage access when a teammate leaves Removing a member revokes their personal instance tokens. Engine updates can follow asynchronously, so check the status before assuming every database has rejected the old credential. Review shared organization tokens separately; member removal is not a substitute for that review. Explore with sample data The public demo uses sample data. It cannot provide working production credentials. Sign in to the real console to work with your organization and instances. Follow a video or find an answer Use the tutorial library for walkthroughs. Videos and screenshots reflect the interface when recorded; labels may differ from the current console. Follow this guide and the connection details supplied by your instance when they differ. Assign access through Team Organization membership controls console access. Database users, roles and grants control database operations. Review both before adding access for an application. Empty preview lists do not prove that a live organization has no members or grants. See roles and permissions. Open optional tools from Plugins Open Plugins to see the tools offered to your organization, such as Vezual. Check each tool’s availability and connection requirements. MCP is not offered in the new one-token Connect flow while a compatible published server is being verified. See MCP availability. Ask the documentation Previous Page Navigate the console Next Page --- ## Current console and API guides | OriginChainDB docs Canonical source: https://originchaindb.com/docs/current-guides Current console and API guides Find a guide for your next task: connecting a client, moving data, building a search index or checking a result. Start with the workflow, then use its linked API reference for exact request fields. Find the current implementation guideA guide describes its supported interface; confirm that your instance provides it. 01 Choose the taskMigration, embeddings, search or a client connection? 02 Open its workflow guideCheck prerequisites and availability first. 03 Read the request contractUse the endpoint and fields for that interface. 04 Verify a small resultTest your deployed version before expanding the workflow. Choose your next task Use the current console Find your instance, connect a client, explore records and understand the controls available to your role. Copy and sync data with Migrate Copy a source database, validate mappings and rows, and use supported PostgreSQL or MySQL live sync on dedicated deployments. Saved embedders and embedding runs Generate vectors from selected table columns with a saved embedding endpoint, and control which rows a run processes. PostgreSQL compatibility Connect through the PostgreSQL endpoint, understand transaction behavior and handle the differences that matter to an application. Elasticsearch API: current support Connect a 7.x client with the supported authentication formats, and check the operations and limits available on dedicated deployments. Vector record API Create vector indexes, write dense or sparse records with metadata, fetch by ID and search within a namespace. Search suggestions, timeouts and cancellation Search suggestions apply the caller’s row policies. If a suggestion request cannot complete safely, show the returned error instead of presenting an empty suggestion list as a successful result. Native SQL, graph, full-text and vector-table reads support the request headers X-OC-Statement-Timeout-Ms and X-OC-Query-Id. Use a valid timeout and a query ID unique among running requests. Malformed header values are refused, a duplicate active query ID conflicts, and a timed-out request returns a timeout response. Handle cancellation, throttling and failures explicitly. The vector record search route has its own request contract and currently refuses a timeout_ms body field. Do not transfer options between APIs without checking their reference. Learn a workflow and resolve questions Browse the video tutorial library or the console FAQ. If a recording predates a new option, use the current guide for its availability and limits. The demo workspace offers browser-only sample data; sign in to the real console to use your own instances. Dashboard guide Previous Page Move existing data Next Page --- ## Use the dashboard. | OriginChainDB docs Canonical source: https://originchaindb.com/docs/dashboard Use the dashboard. Use the dashboard to open a database, inspect records and run queries. Choose a task below. These walkthroughs describe the redesigned local preview; live actions depend on your deployment and permissions. Your first console workflowChoose the guide for the step you need; screenshots show the local preview. 01 Create an instanceChoose a configuration and wait until it is ready. 02 Define a tableName the fields and choose their types. 03 Add a few recordsReview the values before confirming a write. 04 Run a queryCheck the result against those sample records. Create an instance → — Choose a free or dedicated configuration, review the resources, and distinguish a local preview from live provisioning. Navigate your database → — Find your instance, understand the workspace sidebar, and open connection and operations settings. Create a schema → — Define native fields in the table builder, inspect connections, and configure indexes separately. Insert data → — Validate a CSV or JSON batch, add individual records, and verify the resulting data. Run queries → — Choose SQL, vector, full-text, or graph inputs and inspect the returned records. Workbench → — Use the query library, editor tabs, result formats, saved drafts, and local history. Explain and plans → — Open Explain from the Workbench and use Query stats or Slow queries to investigate costly work. Looking for the HTTP API? See the API reference. Looking for the SDK? See SDKs. Backups, point-in-time recovery and failover live in the ops runbook. Inspect query plans Previous Page Console and API workflows Next Page --- ## Create an instance | OriginChainDB docs Canonical source: https://originchaindb.com/docs/dashboard/create-instance Create an instance Choose a configuration, review it and open your new database. An instance is the database deployment your application connects to. Screenshots show a local preview. Create a live instance in the console before connecting. Create an instance, then connectScreenshots use the local console preview; a live creation request provisions the actual database. 01 Choose New instanceStart from the instance list in your organization. 02 Choose the configurationReview the plan, region and settings you need. 03 Review and createCheck any quoted cost before confirming a live request. 04 Wait for ReadyThen open Connect for this instance’s connection details. 1. Open Instances Choose New instance in the Instances page. Choose New instance in the Instances page. 2. Choose the configuration Choose a plan, enter a name and select the environment and location. Choose a plan, enter a name and select the environment and location. Which settings should I choose? Free: use the supplied starting configuration and review its limits. Dedicated: choose the offered compute, storage, recovery and network options. Environment: label the instance for development, staging or production. Location: choose an available region; a live quote confirms availability and price. For production, review deployment options and replication limits. 3. Review, then confirm Check the summary; use Edit configuration if anything is wrong. Check the summary; use Edit configuration if anything is wrong. In a live console, follow the displayed quote, payment or approval step and wait for provisioning to finish. 4. Open the instance Open the new instance, then use Connect to get its connection details. Open the new instance, then use Connect to get its connection details. Ready to query? Follow Run your first query with a confirmed live connection. Create a free account Create your account, verify your email and open the instance setup guide. Run your first query Next Page --- ## Inspect query plans and diagnostics | OriginChainDB docs Canonical source: https://originchaindb.com/docs/dashboard/explain Inspect query plans and diagnostics A query plan shows the steps the database uses to produce a result. Use it to find unnecessary scans, large joins or extra work. Preview plans are illustrations; only results from a connected engine provide real measurements. Screenshots show the current local console with sample data. They do not show live credentials or confirm a production change. Understand what your query will doPlan-only inspection differs from Explain and run, which executes the query. 01 Prepare a SQL queryStart with a small query in Workbench. 02 Choose plan-only inspectionReview the plan without selecting an execution action. 03 Trace the workLook at scans, filters and joins in the plan. 04 Compare one changeRecheck the plan; measure execution separately when appropriate. 1. Open Explain from the Workbench In Workbench → Editor, select SQL and prepare a query. Open the arrow beside Run, then choose Explain plan or Explain and run. The plan appears in the results area's Query plan tab. Explain and run executes the query. Use plan-only mode when you only need its structure. Keep exploratory queries bounded while iterating; a LIMIT at the top of a plan does not necessarily prevent work below it. The local preview displays schematic operators and sample data. Its browser durations are not live engine measurements, and per-operator timings appear only when collected. Open Run options and choose Explain plan. Open Run options and choose Explain plan. 2. Read from inputs to output The operator at the top produces the final result. Follow its inputs down to see how rows are read, filtered, and joined, then read upward to understand the data flow. Select an operator to inspect its details. OperatorWhat to inspect ScanThe table and rows read; on a live plan, inspect any segment-scan or pruning details it reports. FilterThe predicate and how many input rows survive it. JoinThe join keys and work performed by each input. LimitThe output cap, while checking how much work happened before it. On a live analyzed plan, self time excludes child operators. Compare actual rows, estimated rows, and self time only when the response provides them; an absent value is not zero. Read the plan from the input scan to the output. Read the plan from the input scan to the output. 3. Keep plans and execution separate Explain plan does not execute the query. It can help you inspect the intended operators, but it cannot tell you the actual elapsed time or rows processed. Explain and run executes the query and may return measured values from the connected engine. 4. Find expensive patterns in Query stats Review query statistics Open the Workbench's Query stats tab. SQL literals are replaced with placeholders so similar executions can be grouped. Start with total time, then compare calls, latency percentiles, and average returned rows. Select a pattern to inspect it. Open in editor and Explain in editor prepare a new draft; neither runs it. Replace any placeholder values and review the query before execution. In local preview, the stats use recorded browser activity and optional sample activity. They are not a complete audit log or live telemetry. The classic engine registry is in memory, holds up to 200 fingerprints by total time, and resets on engine restart. 5. Inspect an individual slow execution Slow queries shows individual executions. Set the duration threshold, inspect a row's query and result details, and reopen it in the editor when you need to reproduce the work. Opening an entry never executes it automatically. Raw query text can contain sensitive literal values. Live access and masking policies still apply. The engine's recent-execution window is an in-memory ring of up to 200 entries that resets on restart; local preview history is a separate browser record. 6. Change one thing and compare If a scan reads many rows that a filter discards, inspect the predicate and available secondary indexes. If a join dominates, check its keys and whether each input can be narrowed earlier. If you return more rows or columns than the application uses, reduce the projection or result limit. If tail latency is high, reproduce a slow execution with its actual parameter values. Add or change indexes through Data Explorer or the schema API, then compare the same query again. An index is useful only if the resulting plan uses it for the workload. SQL example and plan shape These examples illustrate a join and its operator structure. The actual plan depends on the query, schema, and engine version. SELECT o.id, c.name, c.country, o.amount_cents FROM shop.orders o JOIN shop.customers c ON o.customer = c.id WHERE o.status = 'paid' LIMIT 10 limit(10) hash_join(on customer = id) filter(Eq { path: "status", value: String("paid") }) scan(shop.orders) scan(shop.customers) Continue with the SQL reference for supported query syntax and EXPLAIN behavior. Run queries in the console Previous Page Dashboard guide Next Page --- ## Database users and access | OriginChainDB docs Canonical source: https://originchaindb.com/docs/dashboard/iam Database users and access A database identity is a user that the database can recognize and give permissions to. Configure that access separately from organization membership. The redesigned console is a local preview; its drafts do not enforce live permissions. Screenshots show the current local console with sample data. They do not show live credentials or confirm a production change. Set up a database identityOrganization membership and database access are separate settings. 01 Select the databaseOpen its access controls. 02 Create or select an identityUse the identity intended for this person or application. 03 Assign its permissionsChoose the required roles and policies. 04 Test effective accessConfirm allowed operations succeed and forbidden operations fail. 1. Open Access Control Select an instance, then choose Access Control in its sidebar. Roles & grants, Database identities, Policies, Column masking, Effective access, and Audit are grouped here. Organization membership is managed separately under Team. 2. Check database identities Open Access Control → Database identities. On a connected instance, choose New identity, select API key or password authentication, and assign the intended roles. Permission and instance requirements are shown beside unavailable actions. Organization membership and database identities are separate. A console member and a database user are separate identities. Adding someone to Team does not establish their right to query records. Open Database identities to check the available access controls. Open Database identities to check the available access controls. Credentials for a connected instance Use Connect → API for the complete OC_URL and the credential instructions for that deployment. Keep its path unchanged. Database login provides separate PostgreSQL credentials. Save one-time secrets when shown; demo values cannot connect an application. Credential kinds in the service API Credential scope matters: an organization token, an instance token and a database identity key grant different access. Confirm the issuing screen and the intended client. CredentialWhat to check Personal tokenThe owner’s access and the grants selected for the token. Organization tokenThe explicit grants and associated database identity. Instance keyWhether this deployment still requires it for the selected API. PostgreSQL passwordThe separate database login, its host and TLS settings. Revoke or rotate the credential through its issuing screen. Confirm the resulting status and test the affected connection; control-plane rejection and propagation to an engine are separate events. 3. Prepare network access From the instance overview, choose Network. Add an address rule using an IPv4 or IPv6 address or CIDR range. A single address is normalized to /32 or /128. Review the existing IP Access List before saving. On the connected service, an empty list permits HTTPS API requests from every address; it does not open a database wire port. Private connectivity is a request workflow, and submitting a request does not establish a connection. Confirm the applied state returned by the console. 4. Prepare row policies Open Access Control → Policies, choose New policy, and select a table and role. Enter the read condition, then choose Save policy. The engine validates the condition. Use Test with the intended database identity; administrators are not restricted by these read policies. Engine policy semantics The documented read-policy model attaches a USING predicate to a table and role. Its predicate surface includes =, !=, <, <=, >, >=, IN (...), IS [NOT] NULL, AND, OR, NOT, and CURRENT_USER. For the documented database-user read path, a policy sees real values before column masking; rows failing the predicate are filtered out. A database bearer acting as the administrative superuser is not a test of restricted user access. With no policies on a table, the policy layer supplies no row filter. Verify identity propagation and enforcement separately for each query path before relying on a policy. Review access changes Access Control → Audit reads the selected instance’s authorization history in the signed-in console. Use the available verification and export controls to inspect the engine chain. The demo’s local draft history is a separate browser record. Connected engine audit reference The engine's authorization audit model is an append-only hash chain. Its documented actions include user.create, user.delete, user.rotate_key, role.create, role.delete, grant.put, grant.revoke, rls.put, and rls.delete. Each entry includes its target, change detail, and previous hash. Chain verification must recompute the links and identify any first broken sequence. Engine audit exports use NDJSON. Organization events and browser-local draft history are separate records; the signed-in console and the demo show different records. Before applying a policy Connect an authenticated service and verify the deployed engine's capabilities. Local policy and role definitions establish no access boundary. ControlBoundary to verify Network accessThe actual endpoint rules and empty-allowlist policy, independently of database credentials. Read-only tokenWrite requests are rejected by the service; a browser label alone cannot enforce this. Database identityQueries propagate the intended database user rather than an administrative bearer identity. SELECT, policies and maskingReads by that identity are checked for table access, row filtering, and masked columns on every supported query path. Insert, update, delete, referencesVerify the deployed engine’s write permissions for the identity and API your application uses. Test denied operations as that identity; an administrator’s successful request is not evidence of a restricted user’s access. Next: create a role and inspect its grants. Authentication Previous Page Roles and permissions Next Page --- ## Add and import records | OriginChainDB docs Canonical source: https://originchaindb.com/docs/dashboard/insert Add and import records Use Data Explorer to add a record or inspect imported rows. For CSV import, select the database, review the detected types and validate the plan before confirming the write. Preview records stay in the browser; live imports need a connected service. Screenshots show the current local console with sample data. They do not show live credentials or confirm a production change. Review an import before writingValidation is a preview; a live receipt and a read-back show what was actually accepted. 01 Choose the source fileSelect the target database and a CSV or workbook. 02 Review the detected fieldsCheck types, keys and sample values. 03 Validate and confirmCorrect reported errors before approving the write. 04 Inspect accepted recordsRead the receipt, then check rows in the target table. 1. Open a table and import records Open Import data for the selected database and choose a CSV file or Excel workbook. The importer proposes column types and relationships before writing. The screenshots use two product records; uploading and validating them does not create a database. Choose the source CSV and target database. Review the detected fields, types and target table. Validate the plan and correct reported errors. Review the validation result; confirm the import only when the plan is correct. A local preview uses sample data. A live import needs a connected service, and its receipt is the evidence of what was accepted. Choose a sample CSV or Excel file. Choose a sample CSV or Excel file. 2. Resolve validation errors Check column names, native datatypes, required values, primary keys, and referenced records. Duplicate keys are rejected by the current local catalog. Do not assume that a live write endpoint has the same insert-versus-upsert behavior; check the write API documentation. Decide how empty cells, dates and large integers should be represented before confirming. Keep postcodes and zero-padded IDs as text when their formatting matters. Use the validation preview to inspect actual values instead of relying only on inferred types. Check names, types and keys before validating all rows. Check names, types and keys before validating all rows. 3. Add a single record Use the Record button in the table's toolbar to enter one record. The form validates it against the current table definition. There is no need to use a SQL editor for a local preview record. The local Workbench's sample SQL is read-only. Use a connected, supported SQL endpoint or row API for production INSERT, UPDATE, and DELETE operations; the engine examples below are preserved for that workflow. 4. Check what was accepted Choose Validate all rows. A ready result shows the number checked and the creation order. If validation fails, fix the named field, key or reference before proceeding. The confirmation checkbox authorizes writes; inspect the receipt afterward because a failed import may have loaded some rows. Review validation, then confirm only the intended import. Review validation, then confirm only the intended import. 5. Verify the result Use the Data view to inspect records, filter fields, sort, or switch to JSON. Open in Workbench prepares a query for the selected table. Review the returned rows and their types; a saved browser record does not prove a production write succeeded. For a live import, check the response from the ingest endpoint and run a bounded read or count against the target table. Use namespace.table where the API requires a fully qualified name. Choose the API for larger imports Console and service limits can differ. For production batches, newline-delimited JSON (NDJSON), vectors or scheduled ingestion, use the insert guide and the limits reported by the live endpoint. Do not assume a bulk import is a transaction. If a live upload fails after accepting rows, inspect its response before retrying. Row writes keyed by primary key may replace an existing row; choose an endpoint with the write semantics your application requires. Vector data uses the vector endpoint and its declared dimension and metric. Original CSV and SQL examples These engine examples assume a shop.orders table with the displayed fields. Prepare that fixture first; the current quickstart creates a different product table. The local console sample parser is separate. Show CSV, INSERT, response, and verification examples id,customer,amount_cents,status,notes,placed_ms ord_3000,cus_481,1200,paid,,1753660800000 ord_A001,cus_9930,2111,paid,gift wrap,1753660801500 ord_H002,cus_2214,3022,paid,,1753660803000 INSERT INTO shop.orders (id, customer, amount_cents, status, notes, placed_ms) VALUES ('ord_7Q2R', 'cus_481', 15400, 'paid', 'expedited', 1753669000000) { "kind": "insert", "schema": "shop.orders", "rows": [ { "id": "ord_7Q2R", "customer": "cus_481", "amount_cents": 15400, "status": "paid", "notes": "expedited", "placed_ms": 1753669000000 } ] } SELECT COUNT(*) AS orders FROM shop.orders Next, query your data and inspect the returned records. Write data and update indexes Previous Page Choose a query model Next Page --- ## Navigate the console | OriginChainDB docs Canonical source: https://originchaindb.com/docs/dashboard/navigate Navigate the console Open an instance to work with one database. Use Summary for its status, Infrastructure for deployment details and Activity for events. The redesign is a local preview, so its sample values are not live operational data. Screenshots show the current local console with sample data. They do not show live credentials or confirm a production change. Find the right console workspaceCheck the selected organization and instance before changing data or settings. 01 Choose the organizationOpen the workspace that owns your database. 02 Check the instanceUse Summary to confirm its identity and state. 03 Open your taskChoose Data Explorer, Workbench or access settings. 04 Review activityInspect the relevant result or event after an operation. 1. Pick an organization and instance Select your organization, then open an instance from Instances. Check its name before running a query or changing a setting. Organization-level pages apply across the organization; instance pages apply to the selected database. Check the connection state before acting. Local preview means the page is showing sample data or configuration drafts, not confirmed production state. Open Summary and check the selected instance. Open Summary and check the selected instance. 2. Find the right workspace AreaWhat it contains SummaryInstance status and the next available action. InfrastructureCompute, storage and deployment details. ActivityInstance events and progress. WorkbenchQuery input, results and supported diagnostics. Database loginSeparate PostgreSQL credentials for the supported read-only connection. ConnectAPI address, token instructions and PostgreSQL connection details. Your tokens / Organization tokensTokens for the selected personal or organization scope. Controls that depend on an engine capability or a dedicated instance must be confirmed against that instance. A preview control is not a promise that a live change has been applied. Use Infrastructure to review resources and deployment details. Use Infrastructure to review resources and deployment details. 3. Browse your instances The organization-level Instances page is the inventory. Open an instance to enter its workspace, or choose New instance to prepare a deployment. Organization team, usage, billing, and settings pages apply across that organization. 4. Explore data and connect an application Data Explorer has four views: Data, Connections, Embeddings, and Indexes. Use namespace and table filters to narrow the scope. In Connections, switch between the schema map and record graph; Expand workspace gives the canvas more room without losing its controls. Open Connect and choose API or PostgreSQL. For API access, copy the complete OC_URL and follow the token instructions shown for that instance. PostgreSQL uses a separate username and password. MCP setup is not exposed in the new connection panel while a compatible published server is being verified. Review deployment and network settings under Infrastructure. The available actions depend on the instance; a visible preview is not confirmation that the engine supports or applied an action. 5. Review changes before applying them A saved draft is different from an applied engine change. Read the resulting status, especially for network rules, feature switches, backup requests, and deployment settings. Deleting an instance or changing its credentials can affect connected applications; use the confirmation and impact details presented by the live console. Use Activity to check the recorded outcome of a change. Use Activity to check the recorded outcome of a change. Next: explore a query Open the Workbench guide for a first query, or create a table before loading your own data. Console overview Previous Page Query Workbench Next Page --- ## Run queries in the Workbench | OriginChainDB docs Canonical source: https://originchaindb.com/docs/dashboard/queries Run queries in the Workbench Choose SQL to filter rows, Vector to find similar content, Full-text to find words or Graph to follow links. Start with a small query and inspect the returned records. These console examples use local sample data. Match the query input to the modelSQL statements, vectors, search words and graph links are different inputs. 01 Select a query modeChoose SQL, vector, full-text or graph. 02 Prepare the right inputUse a statement, numeric vector, search terms or starting record. 03 Run against prepared dataThe selected model needs its tables, indexes or relations. 04 Read its result formatInspect rows, ranked matches or connected records. SQL: inspect structured rows Open Workbench and choose SQL. Start from Examples, or write a bounded SELECT against the displayed table. Click Run and inspect Results. Switch the result format to JSON when you need its record structure. SELECT id, title, category FROM documents LIMIT 5; This query uses the local preview's sample documents. For a live query, use the table names and syntax required by your instance. The SQL reference covers joins, aggregates, limits, and supported statements. Vector: find similar records Choose Vector, enter the query embedding, set the number of results and optional category filter, then run it. The sample mode uses three dimensions and cosine similarity. A production query must match the stored vectors' dimension and configured distance metric. For a live embedding workflow, follow the vector quickstart. Use Data Explorer → Embeddings to inspect a sample projection; a three-dimensional visualization does not replace the original embeddings or distance calculation. Full-text: find matching documents Choose Full-text, enter search terms, set the result count, and run. Ranked matches show the fields needed to inspect each hit. In the local preview, the search covers sample document titles and bodies. For live BM25, boolean, and phrase queries, use the full-text reference and verify that the relevant index exists. Graph: follow relationships Choose Graph and select a starting node, relationship, direction, and traversal depth. Run the traversal, then select a node or record to inspect its properties. The preview form offers one, two, or three hops over the sample graph. The live engine's supported Cypher syntax is a separate query surface; use the Cypher guide and graph API reference for those requests. Natural language: use Ask Natural-language queries use the Ask endpoint. The current Workbench preview does not expose an NL mode. Follow the Ask guide to scope schemas, inspect the compiled plan, and handle the returned rows in an application. Inspect results before reusing a query Choose a result format appropriate to the mode: table, JSON, ranked matches, or graph. Select a record for field details; export CSV when you need the returned records. The browser is not an unbounded data export tool, so keep queries limited and use an SDK for larger retrieval jobs. Save a useful draft from the toolbar, or reopen a previous input from History. Opening a history entry does not run it. See Workbench in depth for local persistence and query plans for diagnostics. Engine examples for the shop dataset These reference examples assume you have created and populated shop.orders and shop.customers with the fields shown. The current quickstart creates a different product table, so it does not prepare these fixtures. Use the corresponding engine endpoint after preparing the required tables; the local preview parser is separate. SQL examples SELECT id, customer, amount_cents, status FROM shop.orders WHERE status = 'paid' ORDER BY placed_ms DESC LIMIT 10 SELECT customer, COUNT(*) AS orders, SUM(amount_cents) AS total_cents FROM shop.orders WHERE status = 'paid' GROUP BY customer ORDER BY total_cents DESC LIMIT 8 SELECT o.id, c.name, c.country, o.amount_cents FROM shop.orders o JOIN shop.customers c ON o.customer = c.id WHERE o.status = 'paid' LIMIT 10 Cypher pattern MATCH (o:orders {id: '01JTRX1H4Q9P0N2WMX0F5JZ001'})-[:customer]->(c) RETURN c.name, c.country LIMIT 10 Ask question which countries spent the most on paid orders Full-text request examples table:field one or more query terms shop.orders:notes rush delivery ^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^ table field terms shop.orders:notes rush delivery Query Workbench Previous Page Inspect query plans Next Page --- ## Roles and permissions | OriginChainDB docs Canonical source: https://originchaindb.com/docs/dashboard/rbac Roles and permissions A role groups permissions such as reading a table. Assign roles to database identities, then test what they can do. Organization membership controls access to the console and is managed separately. Screenshots show the current local console with sample data. They do not show live credentials or confirm a production change. Give each role a clear boundaryA console team role does not automatically grant access to database records. 01 Define the allowed actionsName the tables and operations this role needs. 02 Assign the database identityAttach the intended role to the user or application. 03 Test allowed and denied requestsUse that identity’s credentials for both tests. 04 Review effective permissionsCheck combined roles and policies when access differs from expectations. 1. Review your team Return to the organization and open Team. Choose Invite member, enter an email and select an available organization role. In the signed-in console, invitations are emailed. Demo invitations remain in the browser. 2. Open Roles & grants Select an instance and open Access Control → Roles & grants. Review the roles, inherited roles and grants returned by that instance. Read the permission explanation if an action is unavailable. 3. Create a database role Choose New role in a connected console, or New role draft in the local preview. Name it, then choose Grant access for the live role or Add grant in the draft. Select the object and permissions available in the grant editor. Add column masks where required. Save the grant and review the state returned by the instance. Test access using the intended database identity. Broad object scopes can include more tables than one named object. Review those scopes and inherited roles before granting access. Built-in roles cannot be deleted. Name the role and add only the grants it needs. Name the role and add only the grants it needs. 4. Verify effective access Use the connected Effective access view to inspect access for a database identity. In the demo, the similarly named analyzer evaluates local role proposals only. Verify table grants, inherited roles, row policies and column masks as the intended identity. The demo’s Proposed or Not proposed labels do not establish a live security boundary. A database role belongs to the database identity layer. Organization Team membership does not provide database permissions. See database identities and the enforcement boundary before applying a proposal. Edit or remove access Return to Roles & grants to edit or revoke a grant. Deleting a custom role requires typing its name and may be unavailable under the current action policy. Read the confirmation and check the returned result before assuming access has changed. Use the connected organization’s role catalog and permission explanations for its current capabilities. Team membership controls console access; database identities, roles and grants control access to the database. A permission shown in a browser is not a substitute for server enforcement. Apply through an authenticated service Review exported scopes, resolve database identities, and verify enforcement for SQL, vector, full-text, graph, and direct record requests. A browser draft is not evidence that a user is restricted. Removing a member or leaving an organization revokes that member’s personal instance tokens. Read the Team page’s confirmation status across the organization’s instances. Review the returned status and follow up on unconfirmed revocations; a removal request alone is not proof that every engine has rejected the old credential. Organization API keys remain separate and are not revoked by member removal; review shared credentials and database identities separately. Next: prepare row policies and check the live enforcement boundary. Database users Previous Page Managed deployments Next Page --- ## Create a table in the console | OriginChainDB docs Canonical source: https://originchaindb.com/docs/dashboard/schema Create a table in the console Name a table, choose its fields and check the saved definition. Create a small public.tasks table with two text fields: id and title. Screenshots show the current local console with sample data. Live controls depend on your instance's capabilities; preview changes stay in the browser. Select a screenshot to enlarge it. Create a table in Data ExplorerCreating a table defines its structure; adding records is a separate step. 01 Choose New tableOpen Data Explorer in the selected database. 02 Name the table and keyChoose the field that uniquely identifies each record. 03 Add and review fieldsSelect a type and required settings for each field. 04 Create and inspect StructureConfirm the saved definition before adding records. 1. Open the table editor Open your instance → Data Explorer → New table. 2. Name the table and its fields Use public.tasks; keep id as the required primary key and title as text. Use public.tasks; keep id as the required primary key and title as text. The primary key gives each task a unique ID; Required means a record must include that field. 3. Choose the datatype Choose the value a field accepts, such as text, a number or true/false. Choose the value a field accepts, such as text, a number or true/false. Keep String for both fields in this example, then choose Create table (or Register table on a connected instance). 4. Check the new table Confirm tasks appears with two fields; zero records is expected until you add data. Confirm tasks appears with two fields; zero records is expected until you add data. 5. Inspect the saved fields Open Structure to check field types, the primary key and available edit actions. Open Structure to check field types, the primary key and available edit actions. Add the first record when the definition is correct. Indexes, relationships and later changes Indexes: open the Indexes view; a modality checkbox alone does not build a working search index. Connections: inspect the schema map; declare a relation before querying it. Edit structure: review which changes the connected instance allows before submitting. Delete: remove dependencies and read the confirmation; deleting a live table can remove its data. See vector setup or full-text setup when you need search. Prefer a schema file? The visual editor uses fields, not a TOML tab; use the registration API for a file. Separate example: an orders schema in TOML namespace = "shop" table = "orders" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "customer" ty = "str" required = true [[columns]] name = "amount_cents" ty = "i64" required = true [[columns]] name = "status" ty = "str" required = true [[columns]] name = "notes" ty = "str" [[columns]] name = "placed_ms" ty = "u64" [[indexes]] name = "by_status" columns = ["status"] [[check_constraints]] name = "amount_non_negative" expression = "amount_cents >= 0" [[relations]] name = "placed_by" from_col = "customer" target = { namespace = "shop", table = "customers", pk = "id" } bidirectional = true The optional relation requires shop.customers to exist first. Create a schema Build a table with fields, a searchable category and a supplier relationship. Schema reference Look up the fields used to define tables, indexes, relationships and validation. --- ## Use the query Workbench | OriginChainDB docs Canonical source: https://originchaindb.com/docs/dashboard/workbench Use the query Workbench Workbench keeps your query editor and results together. Open a database, choose a query mode and run a small request. The redesigned console is a local preview; connected deployments use the console query API. Screenshots show the current local console with sample data. They do not show live credentials or confirm a production change. Write, run and keep a queryOpening or saving a query does not execute it. 01 Select the instanceCheck the database shown in Workbench. 02 Prepare the query draftChoose the mode and enter the appropriate input. 03 Run and inspect resultsReview returned data or the reported error. 04 Save a useful queryReopen it later, review it and run it deliberately. 1. Open an instance workspace Select an instance, then open Workbench from the instance header. The page keeps the editor, results, and query library together. The tabs above it switch between Editor, Query stats, and Slow queries. 2. Choose what to explore The library selector opens Explorer, Saved, or History. Explorer shows fields and example data for the selected query mode. Use its search field to find a table or field. The editor's modality selector offers SQL, Vector, Full-text, and Graph. Each mode has its own input: SQL text, a query vector, search terms, or a graph traversal form. Start with Examples when trying a mode for the first time. See the inputs each query mode expects → 3. Keep related queries in tabs Use New query to open a draft. The query-options menu can rename or duplicate it. Each tab retains its mode and input; an unsaved indicator marks changes. Closing an unsaved tab offers Save and close, Discard draft, or Cancel. The preview keeps up to 20 open query tabs per instance. Query drafts belong to the selected organization and instance in this browser. 4. Run and inspect results Click Run to execute the current input. The results area offers the formats relevant to that mode: a table, JSON, ranked matches, or a graph. Select a record to inspect its fields, or export the returned records as CSV. For SQL, the arrow beside Run opens Explain plan and Explain and run. The first inspects a plan without executing the query; the second executes it. A returned plan appears under Query plan beside Results. Plans in the local preview are schematic. Browser duration and illustrative operator values must not be read as live engine telemetry. Choose Run, then inspect the returned rows. Choose Run, then inspect the returned rows. 5. Save a query or revisit a run Click Save to add a query to the Saved library. History records recent executions and lets you reopen their inputs. Opening an entry prepares a draft; it does not execute it. The preview stores up to 100 saved queries and 100 history entries locally. They do not sync between machines, and clearing browser storage removes them. A saved query is a bookmark, not a scheduled job. 6. Check the target before running The instance name in the workspace header identifies the current target. Use Connect for connection instructions, and check whether the page is showing local sample data or a live connection. Keep a LIMIT on exploratory SQL queries; the browser displays only the records returned to it. Continue in your application Move a working query into an SDK or the HTTP API when you need application credentials, bound inputs, or repeatable execution. Use query plans and diagnostics to investigate costly work. Navigate the console Previous Page Run queries in the console Next Page --- ## Choose a deployment | OriginChainDB docs Canonical source: https://originchaindb.com/docs/deploy Choose a deployment Choose a database configuration based on the workload you have measured. Confirm its location, resources, connection methods and recovery options before provisioning. The console preview demonstrates the workflow but does not create infrastructure. Plan capacity before provisioningRecovery options and quoted resources depend on the configuration you choose. 01 Measure the workloadEstimate stored data, query demand and growth. 02 Choose resources and regionReview capacity, recovery options and the quote. 03 Provision the instanceWait for the selected configuration to become ready. 04 Verify a small workloadTest access, queries and the recovery procedure you require. Tenant architecture A tenant is the logical database scope used by the service. A dedicated instance has resources assigned to its deployment. Account and billing settings are managed separately from database operations. Check the actual configuration rather than inferring isolation or availability from a plan name. Choosing a region + configuration Review the compute, memory, storage and region offered for your deployment. Confirm any standby, network or recovery requirements in the quote. Use current pricing for costs. Hourly figures on the website are monthly-price equivalents; they do not change the billing contract. Availability commitments must come from your agreed service terms. Selecting add-ons Check the capabilities reported by the deployed instance before depending on SQL, vector, graph, full-text or optional operations. An option in a preview screen is not confirmation that the engine has enabled it. Confirm the cost and prerequisites of any additional feature in the current quote; this guide does not define a fixed add-on catalog. Provisioning Open Instances → New instance and choose an offered configuration. Review the name, region, resources and network settings. Confirm the quote and submit the live provisioning request. Wait for the instance to report ready. Open Connect, copy the supplied values and run a small read. Provisioning time depends on the deployment. A preview entry or submitted request is not proof that the database is ready. DNS & TLS Use the complete HTTPS address supplied by Connect. Do not construct a hostname from the instance name. Configure certificate verification as instructed for the endpoint. For PostgreSQL, use its separate host, port and TLS settings. An endpoint change during recovery may require clients to reconnect; test that behavior in your application. Bearer rotation Create a replacement credential, update your application and verify a request before revoking the old one. Revocation in the management service and propagation to engines are separate events. Do not assume an undocumented overlap period. See authentication. Replication topology A primary serves writes; a standby is a second copy prepared for recovery. If replication is asynchronous, the standby can lag behind the primary and may lack recent acknowledged writes after a failure. Confirm the topology, acknowledgement behavior and promotion procedure for your instance. Synchronous behavior on one endpoint does not establish the same guarantee for every write API. Test recovery with your own workload. See the operations guide and multi-region availability. Migration from existing data Use Migrate for a supported source database, or the write guide for application and batch writes. Verify record counts and representative values before switching your application. Keep the source available until the destination checks pass. Roles and permissions Previous Page Multi-node configurations Next Page --- ## The Elasticsearch-compatible API | OriginChainDB docs Canonical source: https://originchaindb.com/docs/elasticsearch Elasticsearch clients The Elasticsearch-compatible API This API accepts a documented subset of Elasticsearch-style document and search requests. It is useful when an application already uses that request format. It does not provide a full Elasticsearch cluster or certify every client integration. Start with the quickstart, then learn field mappings, search queries and bulk writes. Check availability and authentication first. From JSON documents to search hitsMappings, document writes and searches are separate steps; embeddings are not created automatically. 01 Connect to the search endpointUse the dedicated interface and its supported client contract. 02 Define and load documentsChoose field mappings and stable document IDs. 03 Send a supported searchUse the documented query DSL for your question. 04 Inspect matching hitsCheck IDs, returned fields and any aggregations. What you point at it Use a compatible Elasticsearch 7.x client or plain HTTP. The endpoint reports version 7.14.2. Use the complete tenant endpoint as the client base URL; each index lives under that path. POST /v1/tenants/:tenant/es/:index/_search PUT /v1/tenants/:tenant/es/:index/_doc/:id POST /v1/tenants/:tenant/es/_bulk What makes it different from a search cluster Document writes and search use the same compatibility API. Start by writing a document, reading it by ID and searching an indexed field. Access depends on the request identity. Test the intended role and policies with the actual queries your application will send. Other query modes have separate interfaces. Vector indexing and cross-query result handling remain explicit application tasks. Do not assume an Elasticsearch write creates a vector embedding. What it does not do Coverage is limited to the documented API subset. Unsupported bodies can return errors, while unknown URL parameters are currently ignored. Check the supported options explicitly; HTTP success alone does not prove that every option was applied. AreaAnsweredRefused, and why Aggregationsterms, metrics, range, histogram, date_histogram, percentiles, top_hits, filters, sub-aggregations, pipelines, extended_statscomposite, nested have no executor yet; missing on a metric aggregation would fill in a value you did not choose Suggestersthe term suggester, with suggest_modephrase and completion have no executor; popular ranks by a document frequency this API does not report Pagingsearch_after, scroll and Point-in-TimeCheck the deployment limits in /v1/capabilities Scoringfunction_score, per-field boostsscript_score and rescore would run arbitrary script Cluster managementindex create, delete, mapping, _field_caps, legacy and composable templatesILM and snapshot administration are not supported over this API Vector and hybrid search live on their own surface — see querying. Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries. OriginChainDB is not affiliated with, endorsed by, or sponsored by Elasticsearch B.V. OriginChainDB implements a compatible HTTP API so that existing Elasticsearch clients can talk to it; it does not distribute Elasticsearch software. Oracle SQL dialect Previous Page Connect your client Next Page --- ## Aggregations | OriginChainDB docs Canonical source: https://originchaindb.com/docs/elasticsearch/aggregations Elasticsearch clients Aggregations An aggregation summarizes the documents that match a query. It can count groups, add values or arrange results by date. It summarizes the full match set, not only the page of returned hits. Use size: 0 when you need only the summary. The examples use the Elasticsearch-compatible API. Check the supported aggregation types before reusing an existing request. Turn matching documents into a summaryAggregations use the matching document set, not just the visible page of hits. 01 Select the documentsApply the query or filters for the report. 02 Choose grouping fieldsUse supported keyword, numeric, date or boolean fields. 03 Calculate the summaryCount buckets or compute the requested measurements. 04 Check a known totalCompare a small sample and confirm time-bucket boundaries. Group by a field A terms aggregation needs a field it can group on: keyword, numeric, date or boolean. On a text field use the .keyword sub-field — see indexing. await es.search({ index: 'shop.products', body: { size: 0, aggs: { by_brand: { terms: { field: 'brand' } } } } }) Metrics avg, sum, min, max, value_count, stats, extended_stats and percentiles are supported on their own or inside a bucket. aggs: { avg_price: { avg: { field: 'price' } }, spread: { percentiles: { field: 'price' } }, by_brand: { terms: { field: 'brand' }, aggs: { avg_price: { avg: { field: 'price' } } } } } missing is refused, not filled in missing on a metric aggregation asks us to substitute a value for documents that do not have the field. We refuse it rather than fold in a number you did not choose, because the result would look like data and be an assumption. Bucket by time A date_histogram groups documents into calendar buckets. The field can hold an ISO-8601 string or epoch milliseconds — both bucket the same way. Buckets are UTC and calendar-aligned, so pass calendar_interval. aggs: { per_day: { date_histogram: { field: 'placed_at', calendar_interval: 'day', // minute hour day week month quarter year time_zone: 'UTC' } } } fixed_interval is refused: an arbitrary fixed width has no calendar-aligned equivalent here, and approximating it would put your documents in the wrong buckets. Named filter buckets One bucket per named query, counting the documents that match both your search and that filter, with sub-aggregations over exactly those documents. other_bucket_key adds a bucket for everything that matched none of them. aggs: { by_price: { filters: { other_bucket_key: 'mid_range', filters: { clearance: { range: { price: { lt: 50 } } }, premium: { range: { price: { gte: 200 } } } } }, aggs: { avg_price: { avg: { field: 'price' } } } } } send filters in its own request A filters aggregation is answered with one search per filter, which is a different shape of work from the single pass every other aggregation takes. Combining it with other top-level aggregations in one request is refused, so that a request that looks like one search cannot quietly become several. The documents behind a bucket top_hits returns the best matching documents with their _source. It works at the top level, or nested so each bucket carries its own examples. // three best matches overall aggs: { best: { top_hits: { size: 3 } } } // one example per brand, most expensive first aggs: { by_brand: { terms: { field: 'brand' }, aggs: { top: { top_hits: { size: 1, sort: [{ price: 'desc' }] } } } } } Pipelines cumulative_sum and derivative post-process the buckets of the aggregation they sit in — a running total or a rate of change over a date histogram. aggs: { per_day: { date_histogram: { field: 'placed_at', calendar_interval: 'day' }, aggs: { revenue: { sum: { field: 'total' } }, running: { cumulative_sum: { buckets_path: 'revenue' } } } } } What is not answered composite and nested have no executor yet and are refused rather than partially answered. An aggregation that names no field is refused — except a bare top_hits, which legitimately needs none. A field that was never indexed comes back as an empty aggregation with your hits intact, not as a failed search. Correct the query first — Did-you-mean over the words actually indexed. See it applied — Catalog facets, log volume over time, transaction summaries. Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries. OriginChainDB is not affiliated with, endorsed by, or sponsored by Elasticsearch B.V. OriginChainDB implements a compatible HTTP API so that existing Elasticsearch clients can talk to it; it does not distribute Elasticsearch software. Bulk writes Previous Page Search suggestions Next Page --- ## Bulk ingest and safe concurrent writes | OriginChainDB docs Canonical source: https://originchaindb.com/docs/elasticsearch/bulk Elasticsearch clients Bulk ingest and safe concurrent writes A bulk request sends several document actions together. Read each item’s status: HTTP 200 can still contain failed items. For an update based on a previous read, use the supported version check to detect another writer’s change. Prepare your field mapping and check endpoint availability first. Check every action in a bulk requestAn HTTP success can still contain failed items; the batch is not an all-or-nothing transaction. 01 Prepare the actionsPair each operation with its required document data. 02 Send the bulk requestUse the supported action and request format. 03 Inspect each item resultSeparate accepted operations from failures. 04 Resolve failures carefullyCorrect the cause and reconcile uncertain writes before retrying. Load many documents Newline-delimited actions, exactly as a cluster takes them. An index that does not exist yet is created by the first write. await es.bulk({ body: [ { index: { _index: 'shop.products', _id: 'sku-1207' } }, { name: 'Trail 24', brand: 'Aero', price: 89 }, { index: { _index: 'shop.products', _id: 'sku-3355' } }, { name: 'City Runner', brand: 'Metro', price: 72 } ] }) Read the result per item A bulk request is 200 even when some items fail; errors tells you whether any did, and each item carries its own status. Check it — a failed item in a successful request is the classic silent data-loss bug. const { body: res } = await es.bulk({ body: operations }) if (res.errors) { for (const item of res.items) { const op = item.index ?? item.update ?? item.delete if (op.status >= 300) console.error(op._id, op.status, op.error?.type) } } Guard a write against a concurrent one Carry if_seq_no and if_primary_term on an action and the write lands only if the document is still the version you read. A stale precondition comes back as a per-item 409 and every other item in the batch still applies, so the loser retries one document rather than the whole load. // read the document you are about to change const { body: cur } = await es.get({ index: 'shop.products', id: 'sku-8842' }) await es.bulk({ body: [ { index: { _index: 'shop.products', _id: 'sku-8842', if_seq_no: cur._version - 1, if_primary_term: 1 } }, { ...cur._source, price: 129 } ] }) // stale -> items[0].index.status === 409 // version_conflict_engine_exception where preconditions apply On index actions. A create is already its own precondition (the document must not exist), so it does not take a version. A conditional update or delete is refused: an update is a read-modify-rewrite, and asserting the version at the rewrite is a different guarantee from the one your read saw. External versioning is refused too — it has no faithful mapping onto an exact compare-and-set. Partial updates update merges: the fields you send are written and every other field is preserved. await es.bulk({ body: [ { update: { _index: 'shop.products', _id: 'sku-8842' } }, { doc: { price: 139 } } // name, brand, ... untouched ] }) Throughput Batches are written through the engine's chunked ingest path rather than one document at a time. Send documents in batches of a few hundred to a few thousand; a single enormous request is not faster and costs you the ability to retry a small piece of it. Get the mapping right first — A backfill into the wrong field type means reindexing it. Check what landed — Count and group the data you just loaded. Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries. OriginChainDB is not affiliated with, endorsed by, or sponsored by Elasticsearch B.V. OriginChainDB implements a compatible HTTP API so that existing Elasticsearch clients can talk to it; it does not distribute Elasticsearch software. Search with Query DSL Previous Page Aggregations Next Page --- ## Elasticsearch API: current support | OriginChainDB docs Canonical source: https://originchaindb.com/docs/elasticsearch/current-support Elasticsearch clients Elasticsearch API: current support Check this page before connecting an Elasticsearch-style client. It lists the accepted authentication formats, supported operations and known limits. Use a supported dedicated deployment; this API is unavailable on Free configurations. Check the search compatibility you needThe reported Elasticsearch version does not imply full Elasticsearch or OpenSearch compatibility. 01 Check deployment availabilityUse a supported dedicated instance. 02 Get its search endpointCopy the supplied endpoint and authentication settings. 03 Look up your operationsCompare the client’s requests with the supported subset. 04 Test the actual requestsVerify results and errors before migrating the client. Endpoint and credentials Use the Elasticsearch-compatible endpoint and credentials supplied for your deployment. The examples below use the explicit-tenant address {HTTPS endpoint}/v1/tenants/{tenant}/es. Do not construct this address from the current Connect URL or substitute an instance ID for a tenant ID. If no Elasticsearch connection is supplied, confirm availability before configuring a client. Keep the token on your server. OptionHeader value BearerBearer BasicBasic base64(:). Any username can be used; the OriginChainDB token is the password. ApiKeyApiKey base64(:). The ID is a label; the secret is the OriginChainDB token. Each value is sent in the Authorization header. Base64 is encoding, not encryption. These options use OriginChainDB credentials; they do not create Elasticsearch security API keys. Set OC_ENDPOINT, OC_TENANT and OC_TOKEN in your server environment. The following request assumes a catalog index with a searchable title field. curl "$OC_ENDPOINT/v1/tenants/$OC_TENANT/es/catalog/_search" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ --data '{"query":{"match":{"title":"notebook"}}}' A client request Use an Elasticsearch 7.x client. The API reports version 7.14.2; it does not claim Elasticsearch 8.x compatibility. This snippet illustrates endpoint and authentication configuration. Test the operations your application uses before switching traffic. import { Client } from "@elastic/elasticsearch"; // Use a 7.x client. const es = new Client({ node: `${process.env.OC_ENDPOINT}/v1/tenants/${process.env.OC_TENANT}/es`, auth: { apiKey: { id: "originchain", api_key: process.env.OC_TOKEN } } }); const result = await es.search({ index: "catalog", body: { query: { match: { title: "notebook" } } } }); Supported operations and boundaries AreaAvailable behaviorLimits to check Documents and bulkIndex, get, update and delete documents; bulk actions and multi-get.Update scripts are limited to simple field assignment and removal. Ingest pipelines are unavailable. SearchSupported Query DSL, count, multi-search, highlighting and term suggestions.Cross-index requests refuse aggregations, suggesters, collapse and search_after. Phrase and completion suggesters are unavailable. PaginationScroll and point-in-time reads, with open, continuation and close operations.Read the deployed capability limits. Async search returns synchronously. AggregationsSupported bucket, metric and pipeline aggregations, including extended_stats.Support is a subset; nested, geo and composite aggregations are not available. TemplatesLegacy, index and component templates applied when an index is created.Template aliases and data streams are unavailable. Search templates are a separate, unsupported operation. Index configurationCreate indexes with supported mappings and settings; read settings and update mappings.Changing settings with PUT _settings and the full Elasticsearch index lifecycle are unavailable. AnalysisNamed analyzers and a limited set of analyzer definitions.Do not assume arbitrary tokenizer or filter chains work. Inline definitions in _analyze are refused. Limits and errors Read GET /v1/capabilities on the instance for its supported operations and limits, including the search window, scroll and point-in-time limits. curl "$OC_ENDPOINT/v1/capabilities" \ -H "Authorization: Bearer $OC_TOKEN" Unsupported APIs can return 501, a missing index returns 404, and refused request features can return 400 with an explanation. Unknown URL parameters are currently ignored. Send only documented parameters and verify the returned result; do not rely on every unsupported option being rejected. Delete-by-query and update-by-query refuse options that would change the selected set in unsupported ways, such as pagination, sorting or point-in-time selection. URI query-string search options are supported for search and count, not those write operations. Access control and suggestions Database grants determine what a token may read or write. Searches, counts and gets apply row policies. Masks on the source document redact hits and can make field queries, sorts or aggregations unavailable. Updates, update-by-query and reindex operations are refused when the caller’s row policy or mask makes those rewrites unsafe. Term suggestions use documents visible to the caller. Suggestion requests can fail with a timeout or throttling response; show that error instead of treating it as “no suggestions”. Features outside this API Ingest pipelines, general scripting, Kibana support, Elasticsearch security APIs, snapshots, lifecycle management, data streams and Elasticsearch kNN search are not offered by this release. A compatible authentication format alone does not verify a log shipper or dashboard integration. For OriginChainDB vector retrieval, use the vector record API or the vector-table API. For instance navigation and available integrations, see the current console guide. Elasticsearch and Kibana are trademarks of Elasticsearch B.V. OriginChainDB is not affiliated with or endorsed by Elasticsearch B.V. Your first search Previous Page Create an index Next Page --- ## Create an index, and choose what each field does | OriginChainDB docs Canonical source: https://originchaindb.com/docs/elasticsearch/indexing Elasticsearch clients Create an index, and choose what each field does A mapping describes how an index treats each field. Use text for words you want to search, keyword for exact values, and numeric or date types for comparisons. Choose these before loading data so the queries behave as expected. These examples use the dedicated Elasticsearch-compatible API. See current support for connection requirements. Map fields for the searches you needA text field supports word search; keyword fields support exact values and grouping. 01 Identify each field’s purposeDecide which fields contain words, exact labels, numbers or dates. 02 Create the mappingUse a supported type for each field. 03 Load known documentsKeep a stable ID for each document. 04 Test each search typeCheck word matches, exact filters and expected groups. The short answer To make one column full-text searchable, declare it text when you create the index: await es.indices.create({ index: 'shop.products', body: { mappings: { properties: { description: { type: 'text' } // full-text searchable } } } }) That field now has a full-text index behind it: analyzed into terms, ranked by BM25, and reachable with match, match_phrase and fuzzy search. Everything below is how to choose when the answer is not that simple. What each type gives you TypeFull-text searchGroup / sort / aggregateUse it for textyes, analyzednoprose: descriptions, messages, notes, titles you search inside keywordexact value onlyyesidentifiers, tags, statuses, brands, e-mail addresses long / doublenoyesprices, counts, latencies, scores datenoyestimestamps, in ISO-8601 or epoch milliseconds booleannoyesflags the one that trips people up A text field cannot be grouped or sorted, and a keyword field cannot be searched inside. That is Elasticsearch's rule, not ours, and it is why the next section exists. When you need both on one column A product name you want to search inside and group by exactly needs two views of the same value. Declare a multi-field: the base is analyzed text, the sub-field is the exact keyword. mappings: { properties: { name: { type: 'text', // match 'carbon marathon' fields: { keyword: { type: 'keyword' } } // group by the exact name } } } Then search the base and aggregate the sub-field: query: { match: { name: 'marathon' } } // searches the text aggs: { by_name: { terms: { field: 'name.keyword' } } } // groups the exact value If you skip the mapping entirely You do not have to create the index first. Write a document to a name that does not exist and the index is created for you, with dynamic mapping: every string gets both a full-text index and a .keyword twin, numbers become numeric, and anything that parses as a date becomes a date. await es.index({ index: 'shop.reviews', // does not exist yet - created by this write id: 'r-1', body: { body: 'fits well, runs small', stars: 4 } }) That is the fastest way to start and the right default for logs and events. Declare a mapping when you want to be deliberate: to pick an analyzer, to keep a field out of the index, or to stop a string you never search from carrying a full-text index it does not need. Adding a field to an index that already exists Same call Elasticsearch uses. New fields are added; existing ones keep their type. await es.indices.putMapping({ index: 'shop.products', body: { properties: { supplier: { type: 'keyword' } } } }) a field's type is fixed once it exists Changing text to keyword on a live field would make every document already written disagree with the mapping. Create a new index with the mapping you want and _reindex into it — the same move you would make on a real cluster. Checking what a field actually is _field_caps reads the stored mapping and tells you, per field, what it is and whether it can be searched or aggregated. This is the call dashboards make on connect, and the fastest way to find out why an aggregation came back empty. await es.fieldCaps({ index: 'shop.products', fields: '*' }) // name -> text searchable: true, aggregatable: false // brand -> keyword searchable: true, aggregatable: true // price -> long searchable: true, aggregatable: true Analyzers, when the language matters A text field can declare an analyzer so that searching for running finds run. Set it per field in the mapping; the same analyzer is used when the document is indexed and when the query is parsed, so the two always agree. mappings: { properties: { description: { type: 'text', analyzer: 'english' } } } An analyzer we cannot reproduce faithfully is refused when you create the index, rather than accepted and quietly ignored. Index names fold Index names are matched with case and separators folded, so Shop-Products, shop_products and shop.products are one index, not three. If a name would land on an index another name already owns, the create is refused with the owner named, rather than quietly writing into it. // shop.products exists await es.indices.create({ index: 'Shop-Products' }) // -> 400 already exists: [Shop-Products] differs from it only in // case or separators and would alias its data Pick one spelling and keep it. The refusal exists so a typo cannot silently merge two datasets. Deleting an index await es.indices.delete({ index: 'shop.reviews' }) This removes the index and its documents. A delete of a name that folds onto an index another name owns is refused, for the same reason a create is. Now search it — match, bool, term, range, fuzzy, sorting and paging. Load it properly — Bulk ingest, and guarding a write against a concurrent one. Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries. OriginChainDB is not affiliated with, endorsed by, or sponsored by Elasticsearch B.V. OriginChainDB implements a compatible HTTP API so that existing Elasticsearch clients can talk to it; it does not distribute Elasticsearch software. Supported features Previous Page Search with Query DSL Next Page --- ## Worked examples by industry | OriginChainDB docs Canonical source: https://originchaindb.com/docs/elasticsearch/industries Elasticsearch clients Worked examples by industry These four examples show how to model a catalog, application logs, payments and support tickets. Each starts with the field mapping, then shows the query it enables. They are illustrative datasets, not customer case studies. Prepare a supported Elasticsearch-compatible connection before running them. Build a useful log-search workflowThe industry examples are illustrative; prepare their mappings and sample data before querying. 01 Collect log fieldsKeep the message, service name and timestamp. 02 Choose field mappingsUse text for messages, keyword for services and date for time. 03 Find the relevant errorsSearch the message and filter the intended service. 04 Group results over timeCheck error counts in the requested UTC time buckets. Retail: a product catalog with facets A search box over product text, plus the filters down the side of the page: brand, price band, availability. The trap here is wanting to search a name and group by it, which needs both views of the same field. The mapping Name and description are prose, so they are text. Brand and colour are picked from a list, so they are keyword. Name also carries a .keyword twin so it can be grouped exactly. mappings: { properties: { name: { type: 'text', fields: { keyword: { type: 'keyword' } } }, description: { type: 'text', analyzer: 'english' }, brand: { type: 'keyword' }, colour: { type: 'keyword' }, price: { type: 'long' }, in_stock: { type: 'boolean' }, added: { type: 'date' } } } Search plus the facet counts, in one request The search ranks by text relevance while the filters narrow it, and the aggregations count what is left so the sidebar numbers always match the results. await es.search({ index: 'shop.products', body: { size: 20, query: { bool: { must: [{ match: { description: 'waterproof running' } }], filter: [{ term: { in_stock: true } }] } }, aggs: { by_brand: { terms: { field: 'brand' } }, by_colour: { terms: { field: 'colour' } }, avg_price: { avg: { field: 'price' } } } } }) Price bands, and a sample product per band Bands are not a field, they are a question, so they are named filters. Send this one on its own: a filters aggregation is answered with one search per filter. aggs: { bands: { filters: { other_bucket_key: 'mid', filters: { budget: { range: { price: { lt: 50 } } }, premium: { range: { price: { gte: 200 } } } } }, aggs: { example: { top_hits: { size: 1, _source: ['name','price'] } } } } } Offer a spelling correction. Run the search and a suggester in the same request. If the search returns nothing, show the correction instead of an empty page. Software: an application log stream High write volume, mostly time-ranged reads, and one question repeated all day: what broke, where, and when did it start. The mapping The message is searched, so text. Service, level and host are grouped and filtered, so keyword. The timestamp drives every chart, so it is a date — an ISO string or epoch milliseconds, either works. mappings: { properties: { message: { type: 'text' }, service: { type: 'keyword' }, level: { type: 'keyword' }, host: { type: 'keyword' }, latency_ms:{ type: 'long' }, ts: { type: 'date' } } } Errors per hour for one service A date histogram over the filtered set. Buckets are UTC and calendar-aligned. await es.search({ index: 'ops.logs', body: { size: 0, query: { bool: { filter: [ { term: { service: 'checkout' } }, { term: { level: 'error' } }, { range: { ts: { gte: '2026-09-05T00:00:00Z' } } } ] } }, aggs: { per_hour: { date_histogram: { field: 'ts', calendar_interval: 'hour', time_zone: 'UTC' } } } } }) The worst offenders, with an example line each Group by service, then pull the slowest request in each group so the chart has something to click into. aggs: { by_service: { terms: { field: 'service' }, aggs: { p95: { percentiles: { field: 'latency_ms' } }, worst:{ top_hits: { size: 1, sort: [{ latency_ms: 'desc' }], _source: ['message','host','ts'] } } } } } Import in batches. Send logs with _bulk in batches of a few hundred to a few thousand, and check errors on the response — a failed item inside a successful request is the classic way to lose data quietly. See bulk ingest. Financial services: a payment ledger Amounts and dates you summarise, counterparties you look up exactly, and a free-text reference people actually search. The distinguishing requirement is that not everyone may see every row. The mapping The reference is prose. Everything you group or compare is keyword, long or date. Money is stored in minor units as an integer, so totals never drift. mappings: { properties: { reference: { type: 'text' }, counterparty:{ type: 'keyword' }, status: { type: 'keyword' }, currency: { type: 'keyword' }, amount_minor:{ type: 'long' }, // 12345 = 123.45 booked_at: { type: 'date' } } } Daily totals by currency A date histogram with a nested terms aggregation and a sum, which is one request rather than a report job. await es.search({ index: 'fin.payments', body: { size: 0, query: { bool: { filter: [{ term: { status: 'settled' } }] } }, aggs: { per_day: { date_histogram: { field: 'booked_at', calendar_interval: 'day' }, aggs: { by_ccy: { terms: { field: 'currency' }, aggs: { total: { sum: { field: 'amount_minor' } } } } } } } } }) Configure the intended database identity and access rules, then test both permitted and denied searches and aggregations. An application filter is not a substitute for database authorization. See authentication. Support: a ticket desk Agents search what customers wrote, managers want queue health, and both want it in the same shape. The mapping Subject and body are searched. Queue, status and priority are grouped. First response time is a number you average. mappings: { properties: { subject: { type: 'text' }, body: { type: 'text', analyzer: 'english' }, queue: { type: 'keyword' }, status: { type: 'keyword' }, priority: { type: 'keyword' }, first_reply_mins: { type: 'long' }, opened_at: { type: 'date' } } } Open tickets mentioning a problem, with queue health beside them One request answers the agent's search and the manager's dashboard, over the same match set. await es.search({ index: 'support.tickets', body: { size: 20, query: { bool: { must: [{ match: { body: 'refund not received' } }], filter: [{ term: { status: 'open' } }] } }, aggs: { by_queue: { terms: { field: 'queue' }, aggs: { avg_first_reply: { avg: { field: 'first_reply_mins' } } } } } } }) Two agents editing one ticket Read the ticket, then write it back conditionally. If someone else saved first, you get a conflict instead of silently overwriting their edit. const { body: cur } = await es.get({ index: 'support.tickets', id }) await es.bulk({ body: [ { index: { _index: 'support.tickets', _id: id, if_seq_no: cur._version - 1, if_primary_term: 1 } }, { ...cur._source, status: 'resolved' } ] }) // someone else saved first -> items[0].index.status === 409 What these four have in common The mapping is the design. Every question you can ask later is decided by which fields are text and which are keyword. See indexing. Search and summary in one request. Hits and aggregations come from the same match set, so a dashboard cannot disagree with the list beneath it. Verify a write with a read. Index a known document and test its expected searches. Separate vector and cross-query workflows still need explicit application coordination. Start from zero — Connect a client and run the first search. All examples — Sixteen single-purpose recipes with their responses. Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries. OriginChainDB is not affiliated with, endorsed by, or sponsored by Elasticsearch B.V. OriginChainDB implements a compatible HTTP API so that existing Elasticsearch clients can talk to it; it does not distribute Elasticsearch software. Search suggestions Previous Page Authentication Next Page --- ## Connect and run your first search | OriginChainDB docs Canonical source: https://originchaindb.com/docs/elasticsearch/quickstart Elasticsearch clients Connect and run your first search Connect a supported client, create a small index, add one document and search it. A successful result should contain the document you just wrote. Use sample data while checking the setup. This walkthrough uses the dedicated Elasticsearch-compatible API and the JavaScript 7.x client. It is separate from the main application API connection. Write a document and find itStart with one known document before importing a larger dataset. 01 Connect a supported clientUse the supplied dedicated search endpoint. 02 Create an explicit mappingChoose the field types used by this example. 03 Index a test documentGive it an ID you can recognize. 04 Search and inspect the hitConfirm the result contains that ID and its fields. Before you start Obtain the complete Elasticsearch-compatible endpoint and accepted bearer credential for your dedicated deployment. Do not construct this endpoint from the current application Connect URL. If no Elasticsearch connection is supplied, confirm availability first. See connection details. export OC_ES_URL='https:///v1/tenants//es' export OC_API_KEY='' The five steps 1. Install a client This example uses a 7.x Node client. Other clients must be tested against the supported API subset; a matching major version does not establish compatibility for every method. npm install @elastic/elasticsearch@7 2. Point it at your instance Pass the endpoint as the node and your API key as the auth. info() clears the product check and reports the version. import { Client } from '@elastic/elasticsearch' const es = new Client({ node: process.env.OC_ES_URL, auth: { username: 'originchaindb', password: process.env.OC_API_KEY } }) await es.info() // version 7.14.2 3. Create an index with a mapping Declare your fields. text is analyzed for full-text search; keyword is exact and can be grouped and sorted. Indexing explains how to choose, and what happens if you skip this step. await es.indices.create({ index: 'shop.products', body: { mappings: { properties: { name: { type: 'text' }, brand: { type: 'keyword' }, price: { type: 'long' }, added: { type: 'date' } } } } }) 4. Add a document It is searchable the moment this returns. There is no refresh to wait for. await es.index({ index: 'shop.products', id: 'sku-8842', body: { name: 'Carbon Marathon', brand: 'Aero', price: 149, added: '2026-09-01T00:00:00Z' } }) 5. Search it The Query DSL you already write. This one matches the analyzed text and filters on the exact brand. const { body: res } = await es.search({ index: 'shop.products', body: { query: { bool: { must: [{ match: { name: 'marathon' } }], filter: [{ term: { brand: 'Aero' } }] } } } }) // res.hits.total.value === 1 // res.hits.hits[0]._source.name === 'Carbon Marathon' Check it from the shell The same thing without a client, so you can prove connectivity before wiring an app: curl "$OC_ES_URL/shop.products/_search" \ -H "Authorization: Bearer $OC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query":{"match":{"name":"marathon"}}}' If the first call fails A 401 means the credential was missing or rejected. Check its value, scope and required authentication header. For 404, verify the endpoint, index name and whether the document exists. If a client rejects the handshake, compare its version and requested APIs with current support. Where to go next Choose what each field does — Text, keyword, or both - and how to make one existing column searchable. Load real data — Bulk ingest, and how to guard a write against a concurrent one. Summarise it — Group, count, average, bucket by day, or pull the top documents per bucket. See it modelled — Worked examples for a catalog, a log stream, transactions and tickets. Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries. OriginChainDB is not affiliated with, endorsed by, or sponsored by Elasticsearch B.V. OriginChainDB implements a compatible HTTP API so that existing Elasticsearch clients can talk to it; it does not distribute Elasticsearch software. Connect your client Previous Page Supported features Next Page --- ## Search with the Query DSL | OriginChainDB docs Canonical source: https://originchaindb.com/docs/elasticsearch/search Elasticsearch clients Search with the Query DSL Start with the kind of match you need: words, an exact value, a range or a combination. A query DSL is a JSON structure that describes those conditions. The examples below show where each condition belongs. Use the supported dedicated Elasticsearch-compatible endpoint. JavaScript 7.x client payloads belong in body and responses are read from body; a standalone JSON fragment is the request body. Build a search from clear conditionsAn empty index returns no hits; a missing index is a different error. 01 Choose words or exact valuesMatch text with a search query or exact fields with filters. 02 Combine the conditionsSeparate relevance conditions from required restrictions. 03 Set order and page sizeRequest a bounded, predictable set of hits. 04 Inspect matches and totalsCheck whether the result answers the original question. Full-text: match and match_phrase match analyzes your terms the same way the field was analyzed and ranks by BM25. match_phrase keeps the words adjacent. query: { match: { description: 'waterproof jacket' } } // only this exact phrase, in this order query: { match_phrase: { description: 'waterproof jacket' } } Exact: term and terms Use these on keyword, numeric, date and boolean fields. On an analyzed text field a term query looks for a single analyzed token, which is rarely what you want. query: { term: { brand: 'Aero' } } query: { terms: { brand: ['Aero', 'Metro'] } } Ranges query: { range: { price: { gte: 50, lt: 200 } } } query: { range: { added: { gte: '2026-09-01T00:00:00Z' } } } Combining: bool must contributes to the score, filter does not (and is the one to use for exact predicates), should boosts, must_not excludes. query: { bool: { must: [{ match: { name: 'marathon' } }], filter: [{ term: { brand: 'Aero' } }, { range: { price: { lte: 200 } } }], should: [{ match: { description: 'carbon' } }], must_not: [{ term: { discontinued: true } }] } } Typo tolerance Fuzziness walks the words actually indexed in the field. For a search box, pair it with the suggester so you can show what you corrected to. query: { match: { name: { query: 'marathn', fuzziness: 'AUTO' } } } Sorting, paging and trimming the response sort: [{ price: 'desc' }, '_score'], from: 0, size: 20, _source: ['name', 'price'] // only these fields come back Use search_after with the sort values of the last hit for sorted pagination. Scroll and Point-in-Time (PIT) are also supported. Check /v1/capabilities for the deployment limits and keep cursor lifetimes bounded. Reading one document When you know the id, skip the search. The version that comes back is the one the write reported, so you can carry it into a conditional write. await es.get({ index: 'shop.products', id: 'sku-8842' }) await es.exists({ index: 'shop.products', id: 'sku-8842' }) // true / false await es.mget({ index: 'shop.products', body: { ids: ['a','b'] } }) What a missing index does A search or count against an index that does not exist answers 404 index_not_found_exception, the same as a real cluster. An index that exists but holds nothing answers 200 with zero hits. Those are different answers on purpose: a client polling for an index can tell absent from empty. Security is part of the query Row-level security and column masking are enforced on the search itself. A caller who cannot see a row will not find it through any query, and a query that searches a masked column is refused rather than answered — otherwise the match set could be used to reconstruct the value the mask hides. Summarise results — Terms, metrics, date histograms, filter buckets and top hits. Copy-paste recipes — Sixteen worked requests with their responses. Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries. OriginChainDB is not affiliated with, endorsed by, or sponsored by Elasticsearch B.V. OriginChainDB implements a compatible HTTP API so that existing Elasticsearch clients can talk to it; it does not distribute Elasticsearch software. Create an index Previous Page Bulk writes Next Page --- ## Did you mean | OriginChainDB docs Canonical source: https://originchaindb.com/docs/elasticsearch/suggest Elasticsearch clients Did you mean A term suggestion offers a spelling close to words already in the index. Use it after an empty search to give the person another query to try. A suggestion is a spelling option, not a matching document. Complete the Elasticsearch quickstart to connect the client and create shop.products. Index a name containing “marathon” before trying the “marathn” example below. Suggestions depend on words actually in that field. Offer a spelling correction before searchingA term suggestion is a candidate word, not a matching document. 01 Notice an unhelpful searchFor example, a misspelled term returns no useful hits. 02 Request term suggestionsCompare the term with words in the indexed field. 03 Offer a correctionLet the application or user choose the suggested word. 04 Run the corrected searchUse the chosen word to retrieve actual documents. Ask for a correction await es.search({ index: 'shop.products', body: { size: 0, suggest: { did_you_mean: { text: 'marathn', term: { field: 'name' } } } } }) // suggest.did_you_mean[0] // text: 'marathn', offset: 0, length: 7 // options: [ { text: 'marathon', score: 0.857 } ] Each entry is one word of your input, with its offset and length so you can splice a correction back into the original string. Options come back best first; the score is one minus the edit distance over the word length. Correct every word, or only unknown ones suggest_mode: missing suggests alternatives only for words absent from the index. always also suggests alternatives for known words. Use missing for a spelling correction; use always when you deliberately want to broaden a query. term: { field: 'name', suggest_mode: 'always', size: 3 } A search box, end to end Run the search; if it returns nothing, ask for a correction and offer it. const { body: res } = await es.search({ index: 'shop.products', body: { query: { match: { name: q } }, suggest: { fix: { text: q, term: { field: 'name' } } } } }) if (res.hits.total.value === 0) { const best = res.suggest.fix[0]?.options[0]?.text if (best) console.log(`Did you mean ${best}?`) } What it does not return The response does not include document frequency: how many documents contain each option. Rank available suggestions by score. The popular suggestion mode requires frequency information and is refused. The phrase and completion suggesters are refused by name — there is no executor for either, and a silent empty result would read as "no suggestions" rather than "not supported". Fuzzy matching — Typo tolerance inside the query itself, rather than as a correction. Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries. OriginChainDB is not affiliated with, endorsed by, or sponsored by Elasticsearch B.V. OriginChainDB implements a compatible HTTP API so that existing Elasticsearch clients can talk to it; it does not distribute Elasticsearch software. Aggregations Previous Page Search use cases Next Page --- ## Saved embedders and embedding runs | OriginChainDB docs Canonical source: https://originchaindb.com/docs/embeddings Vector search Saved embedders and embedding runs An embedding is a list of numbers that represents the meaning of content. An embedding run sends selected text to your configured model and saves the returned vectors for similarity search. Use a dedicated configuration and a tested saved embedder. The provider handles the model request; review its charges and data handling. Generate embeddings from selected textA configured provider receives the selected text; source and query vectors must use a compatible model. 01 Select the table and textChoose the source columns and stable record IDs. 02 Choose a saved embedderCheck its provider, model and destination settings. 03 Run or schedule generationReview the affected records before starting the operation. 04 Search with compatible vectorsUse the same model and check matches against source records. Search with a question After a table has been filled by an embedding run or migration with a saved embedder, search its vectors with plain text from the console or API. OriginChainDB embeds the question with the same saved embedder and returns nearby rows. This requires a prepared table and a saved embedder; supplying arbitrary vectors alone does not configure text search. See the 19 October release update. Save and test an embedder In organization Settings → Embedders, save the endpoint URL, key and model, then test the connection before using it. Use a public HTTPS endpoint; local and private-network URLs are not accepted. The key is encrypted, and only its last characters are displayed later. Changing the URL requires entering the key again. Selected text is sent to the saved endpoint. Review the provider’s data handling and charges before starting a run. Keep credentials out of the text columns you select. Embed a table already on an instance Open the dedicated instance’s Platform → Embeddings page and start a new run. Choose a table keyed by one column, and select the columns to embed in the order they should be joined. Choose a tested saved embedder. Optionally add row conditions; all supplied conditions must match. Choose which rows to process and set the required maximum number of rows to embed. Start the run and follow its state, rows read, rows embedded and any failure reason. ModeBehavior Rows without a vectorThe default. Run again later to process rows that still have no vector. New and changed rowsAlso regenerates vectors when their source text changed. Every rowRegenerates vectors for all selected rows, subject to the run limit. New and changed rows and Every row replace a stored vector together with its metadata. Other metadata under the same row ID is not retained. Treat metadata keys beginning with oc_ as reserved. Permissions and data visibility A run reads the table as the member who started it, applying that member’s row policies and column masks. A masked key column or text column to embed is refused. Members who can operate the instance can start, cancel or restart runs; other members can view them. Cancel or continue a run Use Cancel to stop a run. For a failed or cancelled run, Start again continues from its saved progress and keeps the count toward its row limit. Read the failure reason before restarting; an invalid endpoint, missing permission or unsuitable table needs attention first. Keep embeddings current Set up an embedding schedule to process new rows automatically and, optionally, rows whose source text has changed. Without a schedule, start an explicit run when you want vectors refreshed. A row edit alone does not start an unscheduled job. Embed during migration The Embed rows option in Migrate uses a tested saved embedder and a table keyed by one column. Row conditions choose what gets embedded; they do not exclude those other rows from the copy. Review the selected text, conditions and maximum row count before approving. For common questions, see the migration and embeddings FAQ. Vector schemas Keep embeddings consistent and connect matches back to their source records. Vector record API Next Page --- ## Handle errors without repeating writes | OriginChainDB docs Canonical source: https://originchaindb.com/docs/errors Handle errors without repeating writes Start with the HTTP status and error message. They tell you whether to fix the request, check permissions or try again. A failed connection does not prove that a write failed, so verify its outcome before repeating it. Respond to the error you actually receivedA lost response does not prove a write failed; reconcile its outcome before repeating it. 01 Keep the error detailsRecord the status, message and trace ID without secrets. 02 Classify the failureSeparate invalid input, missing access, limits and temporary failures. 03 Choose the appropriate actionCorrect the request, back off or inspect the write outcome. 04 Verify the resultConfirm the operation’s state before continuing dependent work. Read the complete response HTTP errors do not all use one JSON envelope. Engine, management, compatibility adapters and gateways can return different fields or plain text. Check the HTTP status first, parse JSON only when appropriate, and retain the request ID from the response headers. An error may use code, error or class; do not assume a retry field exists. For support, record the endpoint, time, status, SDK version and X-OC-Request-Id when present. Query execution may also provide X-OC-Query-Id. Remove tokens, database keys and private data before sharing logs. Choose the next action StatusLikely causeAction 400 / 422Syntax, field, type, dimension or semantic validationRead the returned detail and correct the request. 401 / 403Authentication or permission failureCheck credential type, identity headers and grants. A new token does not grant additional permissions. 404Wrong route or missing/hidden resourceCheck host, tenant, table and key. Restricted objects may be hidden. 409Conflict, duplicate key or transaction validationDistinguish a permanent constraint violation from a concurrency conflict. Re-read and recompute before retrying a conflict. 413Request or operation size limitSplit the work according to the endpoint’s batching contract. 429Rate or capacity limitHonor Retry-After when supplied; reduce concurrency. 501Unsupported feature or deployment modeUse a supported operation; repeating it unchanged will not enable support. 500 / 502 / 503 / 504Server, gateway, capacity or timeout failureInspect the error and retry hint. Retry reads with bounded backoff; reconcile uncertain writes first. Retry only when safe Check the retry behavior of your installed SDK. Do not automatically replay a write unless the endpoint explicitly supports deduplication for that operation. A new key on a later request does not identify it as the same operation, and an idempotency header alone does not make arbitrary SQL safe to repeat. For reads, use bounded exponential backoff with jitter and a total deadline when the failure is transient. Respect Retry-After if provided. Do not use an unbounded retry loop. For writes, check whether the route supports idempotency. Reuse the same key and payload for the same logical operation when supported. If the outcome of a write or COMMIT is unknown, read back or reconcile using an application key. Do not blindly rerun the transaction. SQL clients Wire clients also report SQLSTATE. Examples include 23505 for a unique constraint, 23503 for a foreign key, 42501 for insufficient privilege, 40001 for a transaction conflict and 0A000 for an unsupported feature. Use the returned code and message together; HTTP status numbers and SQLSTATE are different interfaces. Find the relevant example See error examples, limits, troubleshooting and transaction failure handling. Example response bodies illustrate that route; they are not a universal envelope for every endpoint. Troubleshooting Previous Page Request and capacity limits Next Page --- ## Examples | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples Examples Choose a recipe for the task you want to complete. Run it in a test database, check the result, then adapt the table names and values. From a sample to your own queryStart in a test database and verify the sample result before adapting it. 01 Choose a taskFind a recipe for rows, text, vectors or relationships. 02 Load its sampleCreate the tables and records that the recipe names. 03 Run one exampleUse the connection and request format shown on that page. 04 Check the resultCompare the returned fields and IDs with the expected outcome. New to the database? Start with one small customer table. That page includes its definition, three rows to load and the query result. Then try an exact filter or join the customers to their orders. For search, follow one complete pair: index text then find a word, or store a vector then search by similarity. Choose a task Read and change rows — Filter, join, summarize and update structured data. Search by similarity — Store embeddings, retrieve matches and inspect vector indexes. Search text — Match words, rank documents and summarize results. Follow connections — Read relationships, find paths and analyze groups. Use several query models — Coordinate separate writes with shared record IDs. Handle an error — Understand the response and choose a safe recovery step. Connection and SDK versions These recipes retain their original request and response examples. HTTP snippets use explicit tenant routes. Use the connection address and authentication instructions for your deployment; do not construct a new address by guessing tenant segments. Language tabs use earlier client interfaces. Check the SDK reference for the version you have installed and the methods it provides. The 1.0 source candidate is public on GitHub, but its packages have not been published to registries. Use the installation instructions for the pinned source version; a registry install may provide an earlier API. For writes, check each endpoint’s transaction and retry rules. A timeout may leave the result unknown; confirm the outcome before repeating a write. Read the examples correctly A schema defines the names and types of a table's fields. Sample rows are the small dataset loaded to demonstrate a request. The SQL samples use different table definitions. Use a separate test database for an incompatible sample rather than replacing a table that contains useful data. A request containing ... or a comment inside an array is shortened for explanation. Replace it with real values before sending it; JSON does not allow comments. Responses are examples of the fields to inspect. Counts, scores and IDs depend on the data you loaded; a page calls out when its small sample dataset reproduces them exactly. cURL examples use Bash syntax. Run them in a Bash-compatible shell, or translate quoting and environment variables for your shell. Configuration-specific examples Elasticsearch API recipes — Supported request forms for dedicated deployments. Natural-language endpoint recipes — Questions and plan inspection where Ask is enabled; this is not a general SDK capability. Existing MySQL listeners — Historical protocol examples with explicit credential limits. Existing SQL Server listeners — Preview protocol examples and dated driver checks. MySQL and SQL Server are not offered as new connection methods. Their examples require an existing enabled listener. The current PostgreSQL database-login path is read-only. For request fields rather than recipes, use the API reference. For data definitions, start with schemas. Ask examples Next Page --- ## Ask examples | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/ask Ask Ask examples ← All examples These endpoint examples apply only where Ask is enabled by the service configuration. Permissions and budgets still apply. Inspect generated plans and use explicit SQL when an exact query shape is required. Start with the count recipe, which creates its own sample data. Use plan inspection next to see why an answer was returned. A natural-language response should be checked against the intended table, filter and result. From a question to checked database resultsAsk AI needs an enabled provider and suitable permissions; inspect the plan when the answer matters. 01 Choose the tablesLimit the question to data your account can access. 02 Ask in plain languageDescribe the count, filter or result you need. 03 Inspect the planCheck which tables and conditions the question produced. 04 Check the rowsCompare the answer with the underlying records. Check natural-language questions Ask for a row count — Ask how many customers are in a table. Choose the tables Ask can use — Pass a schemas list to limit the tables Ask considers. Inspect how Ask answers — Request show_plan to see the operations used to answer the question. Check a question against a known join — Establish the result with explicit SQL, then compare an English question with it. Check plan reuse — Send the same question twice to see whether Ask reuses its compiled plan. Make a question answerable — Use an Ask error’s details to make the question more specific. Before adapting a recipe Use a test database, load the named sample data, and check the expected result. Read each page’s limits before changing the query. See connection and SDK notes. Examples Previous Page Check plan reuse Next Page --- ## Check plan reuse | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/ask/cache-hit Ask Check plan reuse ← Ask examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Send the same question twice to see whether Ask reuses its compiled plan. A plan describes a query; it is not a saved copy of the result rows. Before you run it: A cache hit does not mean the rows are stale. Changes to the question, schemas or table definition can change cache behavior. After loading the two sample customers below, both requests should return the same count unless another write occurs. Compare cache separately from rows: reusing a plan means reusing query instructions, not reusing the old answer. Reuse a plan while reading current rowsA cache hit concerns the compiled plan, not a saved copy of the answer. 01 Ask the first questionKeep its wording and schemas for the comparison. 02 Repeat the same questionThe service may reuse a suitable cached plan. 03 Read both outputsInspect cache status separately from the newly returned rows. Follow the example Load the sample and confirm Ask is enabled. Send the question with its schemas list. Repeat the same request. Compare cache metadata and returned rows. Set up the table Save this definition as customers.toml and send it to POST /v1/tenants/:t/schemas with Content-Type: text/plain before loading rows. The schema walkthrough shows how to register a file; use this page's definition for its sample. namespace = "shop" table = "customers" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "email" ty = "str" Load sample rows # Any handful of customers is fine - the cache hit doesn't depend on the count. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.customers/_batch" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '[ { "id": "c_1", "email": "alice@example.com" }, { "id": "c_2", "email": "bob@example.com" } ]' Run the request # Call the same question twice - watch the cache field flip. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/ask" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "nl": "how many customers do I have?", "schemas": ["shop.customers"] }' # Same body, same headers - just send it again. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/ask" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "nl": "how many customers do I have?", "schemas": ["shop.customers"] }' Check the result The illustrated calls show a miss followed by a hit. Some requests may report skip. First call: { "rows": [ { "count": 2 } ], "cache": "miss" } Second call: { "rows": [ { "count": 2 } ], "cache": "hit" } The cache values are "hit", "miss", or "skip". "skip" means the engine bypassed the cache - for example when the question depends on state that can't be safely cached. How the database handles this request The cache key is (canonicalised_nl, sorted_schemas_list). Case, whitespace, and trailing punctuation are normalised before hashing. Only the plan tree is cached - rows are always read fresh from the row store, so the count reflects current state on a "hit". Schema migrations evict entries that reference affected schemas. After you alter shop.customers, the next call for that question re-plans. The cache is per-tenant and durable across replicas - it rides the WAL stream that provisioned standbys tail, so a standby that is promoted keeps the entries it has already tailed. Important limits and checks Interpolating values into the question. "orders from customer c_1" and "orders from customer c_2" are different cache entries. Use a parameterised question: "orders for a given customer id" and bind the value separately when supported, or fall back to /v1/query with a saved plan. Re-ordering the schemas list. ["a","b"] and ["b","a"] hash to the same key (the engine sorts), but adding or removing a schema does change it. Expecting stale rows on a hit. The plan is cached. The data is not. A "hit" still runs the executor against current rows. Continue Continue to inspect how ask answers. Ask examples Previous Page Make a question answerable Next Page --- ## Make a question answerable | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/ask/error-recovery Ask Make a question answerable ← Ask examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Use an Ask error’s details to make the question more specific. Repeating an unchanged question will not resolve missing context. Before you run it: Branch on the error code, not the wording of a hint. Avoid sending secrets in questions to a configured model provider. The nonsense question below is deliberately invalid; it is not a setup test. First confirm that the row-count example works with your connection. Then compare this refusal with a meaningful question about those same customers. Turn an unclear question into a valid readAn unchanged question will not fix no_plan_compiled. 01 Read the error codeIdentify why the question could not produce a plan. 02 Check the tableConfirm its name, columns and available data. 03 Rewrite the questionAsk for one clear count or filter. 04 Verify the new planCheck the corrected read before using its answer. Follow the example Read the stable error code. Check table and column names. Add a schemas hint or rewrite the question. Retry and inspect the result. Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/ask" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "nl": "ufnwiefwn wefjwe" }' Check the result The failed example returns no_plan_compiled with a hint and suggested rephrase. HTTP/1.1 400 Bad Request { "error": "no_plan_compiled", "hint": "the question contained no recognisable identifiers (table, column, or relation name). nothing in the registered schemas matched any token.", "suggested_rephrase": "ask in terms of names that appear in your schemas - e.g. \"how many shop.customers do I have\"" } error is stable - branch on it in your code. hint and suggested_rephrase are human-readable and may change wording between releases; show them, don't parse them. Understand the behavior The compiler tokenises the question and tries to bind tokens to schema identifiers (namespace, table, column, relation name). If too few tokens bind, the compiler refuses to guess. There is no silent fallback to "scan everything". The hint explains the binding failure in human terms; the suggested rephrase uses identifiers from the visible catalog as anchor words. A failed compile is not cached - retry safely with a better question. Important limits and checks Ambiguous column references. "Total by month" with no date column anywhere in the visible schemas is unanchored - say which column to bucket by. Sensitive data in questions. The LLM-fallback path (if configured) sees the full question. Don't put PII, secrets, or credentials in the nl field - bind those as parameters in /v1/query instead. Retrying without rephrasing. The error is deterministic for a fixed schema set. Retrying the same question gets the same error. Either rephrase or change the schemas list (or registered schemas). Continue Continue to check a question against a known join. Check plan reuse Previous Page Check a question against a known join Next Page --- ## Check a question against a known join | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/ask/join-via-nl Ask Check a question against a known join Check a question against a known join Establish the result with explicit SQL, then compare an English question with it. Ask does not guarantee a general SQL join. Before you run it: Ask must be enabled. A declared relationship provides context; it does not make every join available through natural language. Check a natural-language join against SQLAsk AI may not express the requested join; keep the SQL query as the reference. 01 Join customers and ordersRun the explicit SQL join on the sample tables. 02 Ask the same questionRequest the plan as well as the answer. 03 Compare the resultsCheck the joined fields and rows against SQL. 04 Use SQL if neededKeep the explicit query when the plan cannot express the join. Follow the example Create the related sample tables. Run the SQL join. Submit the English question with show_plan. Compare the plan and rows; keep SQL if Ask cannot express the request. Choose the query surface Use SQL for an exact join. Ask can use declared relationships as context for supported operations, but a question spanning two tables is not a guarantee of a SQL-style join. Run a controlled join Set up both tables and their sample rows using the INNER JOIN example. Run its explicit SQL to select orders with their related customer fields. Check the join keys, aliases and selected columns before converting it to an application query. Evaluate an English question separately When trying Ask, scope the candidate schemas and request show_plan: true. Compare the returned rows with your known SQL result. If the question cannot express the required shape, use the explicit query instead of accepting a plausible partial answer. Next steps Working Ask quickstart · Declare relations · SQL reference Expected result The comparison shows whether the question produced the intended relationship and filters. Continue Continue to combine matching records. Make a question answerable Previous Page Choose the tables Ask can use Next Page --- ## Choose the tables Ask can use | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/ask/schemas-hint Ask Choose the tables Ask can use ← Ask examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Pass a schemas list to limit the tables Ask considers. Each entry is a qualified table name, such as namespace.table. Before you run it: Naming several schemas does not guarantee a SQL join. Use explicit SQL when the join must be predictable. Keep a question focused on one tableThe schemas hint selects candidate tables; it does not filter their rows. 01 Choose shop.customersPass the table in the schemas list. 02 Ask about gold customersThe question supplies the condition to apply. 03 Check the plan and countConfirm that the intended table and tier were used. Follow the example Confirm Ask is available and load the sample. Name the relevant table in schemas. Ask for the gold-tier count. Check the rows and generated plan. Set up the table Register this once with POST /v1/tenants/:t/schemas. namespace = "shop" table = "customers" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "email" ty = "str" [[columns]] name = "tier" ty = "str" [[indexes]] name = "by_tier" columns = ["tier"] Load sample rows # Seed customers across two tiers so the count below is non-trivial. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.customers/_batch" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '[ { "id": "c_1", "email": "alice@example.com", "tier": "gold" }, { "id": "c_2", "email": "bob@example.com", "tier": "silver" }, { "id": "c_3", "email": "carol@example.com", "tier": "gold" }, { "id": "c_4", "email": "dan@example.com", "tier": "silver" } ]' Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/ask" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "nl": "how many gold-tier customers do I have?", "schemas": ["shop.customers"] }' Check the result The question is interpreted using the named tables rather than the entire catalog. { "rows": [ { "count": 2 } ], "cache": "miss" } The shape is the same as the unhinted call - rows and cache. The difference is that the compiler walked one schema, not the whole tenant. How the database handles this request The schemas list is part of the cache key - same question, different schemas list, different entry. The compiler sees only the listed schemas in its catalog. Tables in other namespaces are invisible for this call. Recognising "gold-tier" hits the tier column. Because there's a by_tier index, the plan becomes Aggregate(count) → IndexScan(tier = "gold"). A shorter schema list gives the compiler fewer table definitions to consider. It does not guarantee a faster response or a supported join. Important limits and checks Assuming multiple tables imply a join. The list supplies context, not permission to generate every SQL join. Compare with a known SQL result when relationships matter. Bare table name without namespace. Schemas are addressed as namespace.table. "customers" alone returns 400 unknown_schema. Using a hint as a data filter. The list chooses tables; it does not filter rows within them. Inspect the returned plan and count to confirm that the question selected the intended records. Continue Continue to inspect how ask answers. Check a question against a known join Previous Page Inspect how Ask answers Next Page --- ## Inspect how Ask answers | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/ask/show-plan Ask Inspect how Ask answers ← Ask examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Request show_plan to see the operations used to answer the question. Check the plan to confirm the intended table and filter. Before you run it: Putting show_plan in the URL does not enable it. Plans may change with schemas and indexes. A query plan is a list of database operations. In this example, IndexScan finds paid orders and Aggregate(count) counts them. Read those operations alongside the returned count before relying on the answer. See how a question becomes a countRequest the plan in the body with show_plan: true. 01 Ask about paid ordersThe question names the rows you want to count. 02 Inspect the query planCheck the orders table, paid filter and counting step. 03 Verify the countCompare the answer with the paid sample rows. Follow the example Load the sample and confirm Ask is enabled. Set show_plan: true in the JSON body. Send the question. Compare the plan and rows with the intended filter. Set up the table Save this definition as orders.toml and send it to POST /v1/tenants/:t/schemas with Content-Type: text/plain before loading rows. The schema walkthrough shows how to register a file; use this page's definition for its sample. namespace = "shop" table = "orders" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "customer_id" ty = "str" [[columns]] name = "amount" ty = "f64" [[columns]] name = "status" ty = "str" [[indexes]] name = "by_status" columns = ["status"] Load sample rows # Seed a handful of paid and pending orders so the plan has work to do. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.orders/_batch" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '[ { "id": "o_1", "customer_id": "c_1", "amount": 19.00, "status": "paid" }, { "id": "o_2", "customer_id": "c_2", "amount": 42.00, "status": "paid" }, { "id": "o_3", "customer_id": "c_1", "amount": 11.50, "status": "pending" } ]' Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/ask" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "nl": "count of paid orders", "schemas": ["shop.orders"], "show_plan": true }' Check the result The response includes the plan alongside rows and cache information. { "rows": [ { "count": 2 } ], "cache": "miss", "plan": { "Aggregate": { "group": [], "aggs": [ { "Count": { "alias": "count" } } ], "child": { "Filter": { "predicate": { "Eq": { "path": "status", "value": "paid" } }, "child": { "IndexScan": { "schema": "shop.orders", "index": "by_status" } } } } } } } The plan field is the same JSON the engine's /v1/query endpoint accepts as input. Lift it, store it, replay it - the planner is deterministic for a fixed schema set. Understand the behavior The compiler runs as usual. When show_plan is true, the resulting plan tree is serialised back into the response alongside the rows. The plan here is Aggregate(count) → Filter(status = paid) → IndexScan(by_status). The presence of IndexScan instead of plain Scan tells you the planner picked up the by_status index. If you see Scan where you expected IndexScan, the index probably doesn't cover the predicate - add an index or rephrase. Important limits and checks Putting show_plan in the URL. It's a body field. The query string is ignored. Logging the plan tree on every request. It's a few KB and changes the response shape. Use it during development; turn it off in app code. Assuming the plan is stable across schema changes. Adding or dropping an index re-plans. The previous plan tree is no longer the one the engine will run - re-fetch it. Continue Continue to make a question answerable. Choose the tables Ask can use Previous Page Ask for a row count Next Page --- ## Ask for a row count | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/ask/simple-count Ask Ask for a row count ← Ask examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Ask how many customers are in a table. The nl request field holds the question; the result contains database rows. Before you run it: Ask availability, permissions and budgets depend on configuration. These endpoint recipes do not imply that every SDK provides Ask. Count the sample customers with Ask AIThe sample contains three customers; the returned count should agree with those rows. 01 Three customer rowsLoad the sample into shop.customers. 02 Ask for the countName the table and ask how many customers it contains. 03 Inspect the answerCheck the returned count separately from cache information. Follow the example Confirm Ask is enabled for your configuration. Load the sample customers. Send the question in nl. Read the count and cache metadata. Set up the table Register this once with POST /v1/tenants/:t/schemas (Content-Type: text/plain). namespace = "shop" table = "customers" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "email" ty = "str" [[columns]] name = "region" ty = "str" Load sample rows Load the three sample customers before running the count. # One-time seed of three customers - skip if you've already loaded data. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.customers/_batch" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '[ { "id": "c_1", "email": "alice@example.com", "region": "IN" }, { "id": "c_2", "email": "bob@example.com", "region": "US" }, { "id": "c_3", "email": "carol@example.com", "region": "DE" } ]' Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/ask" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "nl": "how many customers do I have?" }' Check the result The count is based on stored rows. A cached plan still reads current data. { "rows": [ { "count": 3 } ], "cache": "miss" } Every Ask response has the same shape: rows (an array of objects keyed by column), cache ("hit", "miss", or "skip"), and an optional plan field when you asked for it. How the database handles this request The Ask endpoint canonicalises the question (lowercase, collapse whitespace) and looks it up in the plan cache keyed by question + schemas list. First call is a miss. The compiler walks the registered schemas, recognises "how many" as a COUNT, and produces a Plan tree like Aggregate(count) → Scan(shop.customers). The executor runs the plan and the count rolls up to one row. The plan is stored under that cache key for next time - the actual rows are not cached, only the plan. Important limits and checks Sending "question" instead of "nl". The engine reads the body field nl. Anything else returns 400 missing_field. Expecting the rows array to be cached. Cache hits replay the compiled plan, not the result set. If the underlying rows changed since the previous call, you'll see the new count on a "hit". Ambiguous questions on a busy tenant. "How many customers" works if customers is the only obvious table. Once you have a crm.customers and a shop.customers, narrow the request with a schema hint. Continue Continue to choose the tables ask can use. Inspect how Ask answers Previous Page Multi-model writes Next Page --- ## Multi-model writes | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/atomic-multi-shape Multi-model writes Multi-model writes ← All examples Write a row, its embeddings and searchable text with the same record ID. Each write call commits separately. Reconnect search results to their source row in the application and reconcile uncertain writes before retrying. Connect separate representations with one record IDRow, vector and full-text writes are separate operations, not one cross-model transaction. 01 Save the source rowKeep the original fields under a stable record ID. 02 Write search entriesUse that ID for the embedding and text index. 03 Find a matching IDChoose the search method your question needs. 04 Read the originalFetch the source row to show its current details. Use shared IDs across query models Search and connect product records — Store a product row, embedding and searchable text under the same ID. Find an article by words or meaning — Store an article row, embedding and searchable body. Connect profiles and search bios — Store a profile with its follows relationship, then index the bio by meaning. Filter events and search their text — Store structured event fields and index the event text separately. Store and retrieve an agent’s notes — Connect a note’s fields, embedding and searchable text through a shared ID. Keep writes consistent Track each response. If a write times out, check its outcome before replaying it. A new SDK call may use a new key, and a key alone does not guarantee SQL replay safety. See idempotency. Ask for a row count Previous Page Store and retrieve an agent’s notes Next Page --- ## Store and retrieve an agent’s notes | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/atomic-multi-shape/agent-memory Multi-model writes Store and retrieve an agent’s notes ← Multi-model writes The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Connect a note’s fields, embedding and searchable text through a shared ID. Vector metadata narrows searches to an agent or session. Before you run it: Coordinate separate writes and deletes. Metadata filters do not replace access controls, and deleting a row does not delete its search entries. Use the tenant-scoped HTTP connection described in the connection notes. In these snippets, ORIGINCHAIN_URL is the origin including https://, T is its tenant ID, and OC_TOKEN is its bearer token. Do not append these routes to a different Connect URL format. Retrieve a saved note with its contextSearch metadata helps filtering; it does not replace authorization or source checks. 01 Save the noteKeep its agent, session and text in a source row. 02 Index with the same IDWrite its embedding, metadata and text entry separately. 03 Search within contextApply the relevant metadata filters to the search. 04 Verify the source noteCheck the original agent, session and text before using it. Follow the example Register the memory schema. Write the source note. Write embedding and text using the same ID. Filter the search and fetch the source note. Set up the table The composite index covers the most common read shape - "newest memories for this agent in this session". # agent/memories.toml namespace = "agent" table = "memories" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "agent_id" ty = "str" required = true [[columns]] name = "session_id" ty = "str" required = true [[columns]] name = "text" ty = "str" required = true [[columns]] name = "ts_ms" ty = "u64" required = true # Composite index supports "all memories for this agent in this session, # newest first" without a full scan. [[indexes]] name = "by_agent_session_time" columns = ["agent_id", "session_id", "ts_ms"] The memory row curl -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/rows/agent.memories" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "mem-77f2-001", "agent_id": "agt-sales-east", "session_id": "thr-77f2", "text": "Customer prefers contact between 09:00 and 11:00 IST.", "ts_ms": 1749500120000 }' The embedding with metadata Write agent_id and session_id in vector metadata as well as the row when the query needs those filters. A query without the intended filter can return other matching notes. Enforce access permissions separately; metadata is not an authorization system. curl -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/vector/agent.memories/put" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "mem-77f2-001", "embedding": [0.0144, -0.0681, 0.0398, /* ... 768 floats ... */], "dim": 768, "metric": "cosine", "metadata": { "agent_id": "agt-sales-east", "session_id": "thr-77f2" } }' The keyword index curl -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/fts/agent.memories/text" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "doc_id": "mem-77f2-001", "text": "Customer prefers contact between 09:00 and 11:00 IST." }' The embedding arrays are shortened illustrations. Generate the full vector with your chosen model, match dim to its length, and use that same model when embedding a search question. An embedding is a numeric representation used to compare meaning; OriginChainDB does not generate it in these write calls. Handle separate writes and retries These write calls commit separately. The documented SDKs do not provide automatic retry safety. A new SDK call can generate a new key. Retry reads with bounded backoff; for writes, confirm the endpoint supports deduplication and reuse a stable key, or reconcile the previous outcome first. See idempotency. Important limits and checks Include the metadata used by the query, and apply the intended filter. Enforce access controls separately. Split long conversations into useful passages before embedding them. Choose passage size by checking retrieval quality. Use the same embedding model and preprocessing at write and query time. When expiring a note, delete its row, vector and full-text entry separately. A row delete does not remove the other entries. Expected result Search the agent.memories collection using the filtered-vector pattern, keeping the same agent and session metadata as the write. A matching ID such as mem-77f2-001 identifies the source row to read. Verify its agent_id, session_id and text before using the note. Continue Continue to search within matching metadata. Multi-model writes Previous Page Filter events and search their text Next Page --- ## Filter events and search their text | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/atomic-multi-shape/audit-event Multi-model writes Filter events and search their text ← Multi-model writes The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Store structured event fields and index the event text separately. Use a shared ID to reconnect text matches with actor and time fields. Before you run it: The two writes succeed separately. A successful row write does not prove indexing succeeded. Use the tenant-scoped HTTP connection described in the connection notes. In these snippets, ORIGINCHAIN_URL is the origin including https://, T is its tenant ID, and OC_TOKEN is its bearer token. Do not append these routes to a different Connect URL format. Find an audit event by its detailsIndex sanitized text separately; keep the structured event as the source record. 01 Record the eventSave the actor, action and time under an event ID. 02 Index searchable textUse the same ID for the sanitized event description. 03 Find the event IDSearch for the words you are investigating. 04 Read the evidenceOpen the source event to inspect its actor and time. Follow the example Register the schema. Write the event row. Index text with the event ID. Search and fetch the matching event. Set up the table Two indexes: one for "find all events by this actor in this window" and one for global time-range queries. # audit/events.toml namespace = "audit" table = "events" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "actor_id" ty = "str" required = true [[columns]] name = "action" ty = "str" required = true [[columns]] name = "payload_text" ty = "str" [[columns]] name = "ts_ms" ty = "u64" required = true [[indexes]] name = "by_actor_and_time" columns = ["actor_id", "ts_ms"] [[indexes]] name = "by_time" columns = ["ts_ms"] The event row curl -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/rows/audit.events" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "evt-2026-06-10-00042", "actor_id": "user.alice", "action": "schema.update", "payload_text": "Added column carbon_plate to shop.products", "ts_ms": 1749500000000 }' The keyword index Index the sanitized payload text. Same doc_id as the row's primary key so search hits join back to the event. curl -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/fts/audit.events/payload_text" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "doc_id": "evt-2026-06-10-00042", "text": "Added column carbon_plate to shop.products" }' Handle separate writes and retries These write calls commit separately. The documented SDKs do not provide automatic retry safety. A new SDK call can generate a new key. Retry reads with bounded backoff; for writes, confirm the endpoint supports deduplication and reuse a stable key, or reconcile the previous outcome first. See idempotency. Important limits and checks Indexing PII without redaction. Indexed text remains searchable until its search entry is removed or replaced. Sanitize emails, phone numbers, tokens, internal IDs before calling db.fts.index - never after. Mutating audit events. Audit logs should be append-only. Don't re-put the row to "correct" an event - emit a new event that supersedes it. Embedding raw JSON in payload_text. Full-text search splits text into searchable words; raw JSON punctuation does not add useful context. Render the payload as a human sentence first so the index actually has searchable words. Forgetting an id. If the row write generates an id server-side and the FTS call uses a different one, search hits won't join back. Set the id client-side (UUID or a sortable like ULID) and use the same string for both calls. Expected result Adapt the single-word search to audit.events and the field used above. Search for a word such as column, then read the event row using the returned doc_id. Check its actor, action and timestamp; a text hit alone is not the complete audit event. Continue Continue to require every query word. Store and retrieve an agent’s notes Previous Page Find an article by words or meaning Next Page --- ## Find an article by words or meaning | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/atomic-multi-shape/kb-article Multi-model writes Find an article by words or meaning ← Multi-model writes The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Store an article row, embedding and searchable body. Shared IDs let either search path open the original article. Before you run it: These are separate writes. Update each affected representation when the article changes. Use the tenant-scoped HTTP connection described in the connection notes. In these snippets, ORIGINCHAIN_URL is the origin including https://, T is its tenant ID, and OC_TOKEN is its bearer token. Do not append these routes to a different Connect URL format. Search an article and open the sourceKeep the source, embedding and text index in sync when an article changes. 01 Save the articleStore its title, body and source URL. 02 Prepare two searchesWrite a title-and-body embedding and index the body text. 03 Find its shared IDSearch by wording or meaning. 04 Open the articleUse the ID to read the original content and URL. Follow the example Register the schema. Write the article row. Write embedding and text with its ID. Search, then fetch the source row. Set up the table Plain row schema - no [[relations]] because there's no graph edge to write. # kb/articles.toml namespace = "kb" table = "articles" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "title" ty = "str" required = true [[columns]] name = "body" ty = "str" required = true [[columns]] name = "url" ty = "str" [[columns]] name = "created_ms" ty = "u64" [[indexes]] name = "by_created" columns = ["created_ms"] The row curl -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/rows/kb.articles" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "kb-2026-001", "title": "How atomic multi-shape writes work", "body": "Each shape (row, vector, FTS, graph) has its own endpoint. Every call is atomic individually. Retry behavior depends on the endpoint and key reuse.", "url": "/docs/concepts/atomic-multi-shape", "created_ms": 1747900000000 }' The embedding (title + body concatenated) Embed both fields together. A title-only embedding misses everything the body says, and that's where most of the meaningful tokens live. curl -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/vector/kb.articles/put" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "kb-2026-001", "embedding": [0.0211, -0.0612, 0.0341, /* ... 768 floats ... */], "dim": 768, "metric": "cosine" }' The keyword index (body only) Index the body for BM25 keyword search. Help-center queries are usually keyword-shaped ("install on Windows"). curl -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/fts/kb.articles/body" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "doc_id": "kb-2026-001", "text": "Each shape (row, vector, FTS, graph) has its own endpoint. Every call is atomic individually. Retry behavior depends on the endpoint and key reuse." }' The embedding arrays are shortened illustrations. Generate the full vector with your chosen model, match dim to its length, and use that same model when embedding a search question. An embedding is a numeric representation used to compare meaning; OriginChainDB does not generate it in these write calls. Handle separate writes and retries These write calls commit separately. The documented SDKs do not provide automatic retry safety. A new SDK call can generate a new key. Retry reads with bounded backoff; for writes, confirm the endpoint supports deduplication and reuse a stable key, or reconcile the previous outcome first. See idempotency. Important limits and checks Embedding only the title. Concatenate title + body before embedding so semantic similarity fires on body content, not just the headline. Indexing the title in FTS but not the body. The opposite mistake. The body is where the searchable keywords live. Forgetting to re-index on update. If you edit an article, you have to re-put the row, re-put the vector, and re-index the FTS field. None of the three rides along with the others. Embedding huge bodies as one vector. For long articles, split the body into passages, write one row per passage with a parent article_id, and embed each passage separately. Choose the passage size using your model's limits and retrieval tests. Expected result Adapt word search or vector search to kb.articles. Both paths use kb-2026-001 to identify this sample. Read that row to obtain the title, body and URL; the search result is not itself the full article. Continue Continue to filter events and search their text. Filter events and search their text Previous Page Search and connect product records Next Page --- ## Search and connect product records | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/atomic-multi-shape/product-catalog Multi-model writes Search and connect product records ← Multi-model writes The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Store a product row, embedding and searchable text under the same ID. A schema relationship links the row to its supplier. Before you run it: The row and its derived edge share the row write. Vector and full-text writes are separate calls, not one cross-model transaction. Use the tenant-scoped HTTP connection described in the connection notes. In these snippets, ORIGINCHAIN_URL is the origin including https://, T is its tenant ID, and OC_TOKEN is its bearer token. Do not append these routes to a different Connect URL format. Find a product and recover its supplierThe product row derives its declared supplier edge; vector and text indexing use separate writes. 01 Save supplier and productRegister the supplier first and link sku-9281 to it. 02 Index the productWrite its embedding and text with the same product ID. 03 Search for a matchRetrieve a product ID by words or similarity. 04 Open product detailsRead its name, price and supplier relationship. Follow the example Register product and supplier schemas. Write the row and declared relationship. Write the embedding and text with the same ID. Query and reconnect results by ID. Set up the table Register the target supplier table before the product table. A relationship returns the supplier key; storing a supplier row lets your application also display its name. Create the supplier used by this product curl --fail-with-body -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/schemas" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: text/plain" \ --data-binary @- <<'TOML' namespace = "shop" table = "suppliers" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "name" ty = "str" TOML curl --fail-with-body -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/rows/shop.suppliers" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '{"id":"sup-acme-shoes","name":"Acme Shoes"}' Now register the product definition below. Use a test database where these sample table names are unused. Push this once with /v1/tenants//schemas before the first write. Note the [[relations]] block - that's what makes the supplier edge automatic. # shop/products.toml namespace = "shop" table = "products" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "name" ty = "str" required = true [[columns]] name = "description" ty = "str" [[columns]] name = "price_cents" ty = "i64" [[columns]] name = "category" ty = "str" [[columns]] name = "supplier_id" ty = "str" required = true [[indexes]] name = "by_category" columns = ["category"] # Declaring supplier_id as a relation makes the row write also # create a graph edge from this product to its supplier. [[relations]] name = "supplied_by" from_col = "supplier_id" bidirectional = true [relations.target] namespace = "shop" table = "suppliers" pk = "id" The row (also writes the supplier edge) curl -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/rows/shop.products" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "sku-9281", "name": "Trailblazer 2", "description": "All-terrain running shoe with carbon-plate forefoot.", "price_cents": 12900, "category": "running-shoes", "supplier_id": "sup-acme-shoes" }' The embedding The id here is the same primary key as the row. Same key = same logical product across shapes. curl -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/vector/shop.products/put" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "sku-9281", "embedding": [0.0124, -0.0883, 0.0451, /* ... 768 floats ... */], "dim": 768, "metric": "cosine", "metadata": { "category": "running-shoes" } }' The full-text index doc_id matches the row's primary key so search results can be joined back to the row. curl -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "doc_id": "sku-9281", "text": "Trailblazer 2 all-terrain running shoe with carbon-plate forefoot" }' The embedding arrays are shortened illustrations. Generate the full vector with your chosen model, match dim to its length, and use that same model when embedding a search question. An embedding is a numeric representation used to compare meaning; OriginChainDB does not generate it in these write calls. Handle separate writes and retries The three calls are separate. There is no single "write everything" endpoint. Each call is atomic by itself - the row write either commits or doesn't, the vector put either commits or doesn't. A new SDK call can create a new idempotency key. Check the failed endpoint’s retry contract and reconcile an uncertain outcome before repeating it; the SDK does not make the three operations one transaction. Important limits and checks Forgetting one of the three calls. If you skip the vector put, similarity search won't return this product. If you skip the FTS index, keyword search won't. The row write doesn't fan out to the other shapes. Updating one without re-doing the others. If you re-put the row with a new description, the vector and FTS index still point at the old text until you re-put / re-index them too. Mismatched IDs. The id in the row write, the vector put, and the FTS doc_id must all be the same string. If they drift, you can't join search hits back to the row. Writing the supplier edge by hand. Don't. Let the [[relations]] block do it. There is no edge-write endpoint to call instead — edges are derived from the row write, so a second "write the edge" step is not something you can do, and not something you need to do. Expected result Use the word-search pattern with the table and field above, or query the stored vector. A match for sku-9281 should reopen the product row. Check its name, price and supplier ID rather than displaying a similarity score as product data. Continue Continue to find an article by words or meaning. Find an article by words or meaning Previous Page Connect profiles and search bios Next Page --- ## Connect profiles and search bios | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/atomic-multi-shape/social-user Multi-model writes Connect profiles and search bios ← Multi-model writes The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Store a profile with its follows relationship, then index the bio by meaning. The relationship comes from the schema; the embedding is a separate write. Before you run it: Following or unfollowing replaces the full stored relationship list in this example. Do not submit a partial delta as the full list. Use the tenant-scoped HTTP connection described in the connection notes. In these snippets, ORIGINCHAIN_URL is the origin including https://, T is its tenant ID, and OC_TOKEN is its bearer token. Do not append these routes to a different Connect URL format. Connect profile search with follow relationshipsThe profile write carries the full follows list; biography embeddings are written separately. 01 Save Alice's profileInclude the complete list of people Alice follows. 02 Index the biographyStore its embedding under Alice's profile ID. 03 Search or follow linksFind similar profiles or traverse the declared relationships. 04 Read the profileFetch the current user fields using the returned ID. Follow the example Create the schema and related rows. Write the profile and follows values. Write the bio embedding with the same ID. Read relationships or query similar bios. Create the profile table Push this once. The follows list column plus the self-relation is the whole graph - no separate edge table to keep in sync. # social/users.toml - one table models the profile AND the graph. namespace = "social" table = "users" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "handle" ty = "str" required = true [[columns]] name = "bio" ty = "str" [[columns]] name = "joined_ms" ty = "u64" # The follow graph lives in a list column on the row. Each element is a # user id this person follows. [[columns]] name = "follows" ty = "list" element = "str" [[indexes]] name = "by_handle" columns = ["handle"] # A self-relation turns the 'follows' list into graph edges: one forward # edge per element (alice -> bob, alice -> carol). bidirectional = true also # maintains the reverse side, so "who follows bob?" is a graph read, not a scan. [[relations]] name = "following" from_col = "follows" bidirectional = true [relations.target] namespace = "social" table = "users" pk = "id" The user row (profile + follows) The follows array lands as graph edges in the same write. To follow or unfollow later, re-put the row with the updated list - the edges are recomputed from the new list on each write. curl -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/rows/social.users" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "alice", "handle": "@alice", "bio": "Mechanical engineer. Trail runner. Reading sci-fi.", "joined_ms": 1746180851000, "follows": ["bob", "carol"] }' The profile embedding Use the same id as the user row. Now /vector/social.users/topk returns similar users by bio. curl -X POST "$ORIGINCHAIN_URL/v1/tenants/$T/vector/social.users/put" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "alice", "embedding": [0.0182, -0.0712, 0.0419, /* ... 768 floats ... */], "dim": 768, "metric": "cosine" }' Traverse the follow graph neighbors walks one hop forward along the relation (who alice follows); reverse walks the back-edge (who follows bob). Both are direct adjacency-list lookups - no scan, no join. # Who does alice follow? (one hop forward along 'following') curl "$ORIGINCHAIN_URL/v1/tenants/$T/graph/social.users/neighbors?rel=following&pk=alice" \ -H "Authorization: Bearer $OC_TOKEN" # → ["bob", "carol"] # Who follows bob? (reverse side, maintained by bidirectional = true) curl "$ORIGINCHAIN_URL/v1/tenants/$T/graph/social.users/reverse?rel=following&pk=bob" \ -H "Authorization: Bearer $OC_TOKEN" # → ["alice"] The embedding arrays are shortened illustrations. Generate the full vector with your chosen model, match dim to its length, and use that same model when embedding a search question. An embedding is a numeric representation used to compare meaning; OriginChainDB does not generate it in these write calls. Handle separate writes and retries These write calls commit separately. The documented SDKs do not provide automatic retry safety. A new SDK call can generate a new key. Retry reads with bounded backoff; for writes, confirm the endpoint supports deduplication and reuse a stable key, or reconcile the previous outcome first. See idempotency. Important limits and checks Modeling follows as a composite-PK edge table. A follows table keyed [follower_id, followee_id] can't be traversed with neighbors(pk="alice") - the source of each edge is the whole composite key, not a single user. Put the relation on the users row via a follows list instead. Forgetting the reverse direction. Set bidirectional = true so "who follows bob?" is a reverse read. Without it you can only walk forward. Partial re-put on follow/unfollow. Edges are recomputed from the follows list on each write, so re-put the row with the full new list, not just the delta. Updating handle without re-embedding. If you embed the handle and let users edit it, the vector goes stale until you re-put. Either re-put on every profile edit or only embed the bio. Expected result The forward relationship from alice points to bob and carol; a reverse read for bob should include alice. Those keys locate profiles, not profile bodies. Create Bob and Carol's rows if the application must display them, and use the vector result IDs to read bios after a similarity search. Continue Continue to find records that link to a target. Search and connect product records Previous Page Elasticsearch examples Next Page --- ## Elasticsearch examples | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/elasticsearch Elasticsearch examples ← All examples These recipes use the Elasticsearch-compatible API on dedicated deployments. Read current support and authentication before connecting. Create products, then inspect search resultsThese examples use the documented Elasticsearch-compatible adapter on dedicated deployments. 01 Declare the mappingCreate the product index with its field types. 02 Load three productsCheck every bulk item and apply the sample price update. 03 Search and countInspect product hits and the Aero and Metro groups. 04 Delete lastPreview the matching count before the bounded deletion example. Run a recipe Configure the client using the connection guide. Create the sample index before writing or searching its documents. Run one request and inspect its response before moving to the next task. The JavaScript snippets use the 7.x client: requests put payloads in body and read responses from body. Compatibility is limited to the documented forms, not every Elasticsearch client feature. Raw routes are listed in the API reference. Use one small dataset Run Create an index, Write a document, Load several documents, then Change selected fields. This creates three products and changes the first product's price to 139. The later search sections use those records. Try the read examples before the delete example. Deleting the two Aero products changes the answers and removes the document used by the later read-by-ID example. Use a fresh test index or reload the sample before comparing results. In these snippets, es is the connected JavaScript client from the connection guide. An index is the named searchable collection; a mapping declares the fields it accepts. Each await belongs inside an async function or a module that supports top-level await. Create an index Declare the fields and their mapping types before writing documents. await es.indices.create({ index: 'shop.products', body: { mappings: { properties: { name: { type: 'text' }, brand: { type: 'keyword' }, price: { type: 'integer' } } } } }) Write a document Create or replace the document with the chosen _id. On this adapter path the document is searchable when the write returns; this does not combine independent native row, vector and full-text calls. await es.index({ index: 'shop.products', id: 'sku-8842', body: { name: 'Carbon Marathon', brand: 'Aero', price: 149 } }) Load several documents Send a bulk action for each document. The client builds the newline-delimited JSON body from the operations array. Check every item’s result, not only the outer response. await es.bulk({ body: [ { index: { _index: 'shop.products', _id: 'sku-1207' } }, { name: 'Trail 24', brand: 'Aero', price: 89 }, { index: { _index: 'shop.products', _id: 'sku-3355' } }, { name: 'City Runner', brand: 'Metro', price: 72 } ] }) Change selected fields Send the fields to change. This update merges them into the document and preserves other fields. await es.update({ index: 'shop.products', id: 'sku-8842', body: { doc: { price: 139 } // name, brand, ... untouched } }) Search document text Use match to turn the query into searchable words with the field’s text rules. With the three sample products loaded, marathon finds sku-8842. Read the document in each hit’s _source field. await es.search({ index: 'shop.products', body: { query: { match: { name: 'marathon' } } } }) Add exact filters to a search Put the text query in must and exact or range conditions in filter. Here the product must contain runner, have brand Metro, and cost at most 100. The sample match is sku-3355. Filters restrict matches without adding to the text score. await es.search({ index: 'shop.products', body: { query: { bool: { must: [{ match: { name: 'runner' } }], filter: [{ term: { brand: 'Metro' } }, { range: { price: { lte: 100 } } }] } } } }) Count matches by value A terms aggregation counts documents with the same field value. Before deleting anything, the sample gives two Aero documents and one Metro document. size: 0 omits individual hits because this request only needs those group counts. await es.search({ index: 'shop.products', body: { size: 0, aggs: { by_brand: { terms: { field: 'brand' } } } } }) Count matching documents Use the count endpoint when you need the total without fetching documents. This request should count two Aero products before the delete example runs. await es.count({ index: 'shop.products', body: { query: { term: { brand: 'Aero' } } } }) Read the next page Sort by price and _id, then pass the last hit’s pair of sort values as search_after. With only three sample products and a page size of 20, the next page is empty. Check that the first page contains a hit before reading .at(-1).sort; stop paging when no hits remain. Pagination remains inside the documented 10,000-hit window. const { body: page1 } = await es.search({ index: 'shop.products', body: { size: 20, sort: [{ price: 'asc' }, { _id: 'asc' }], query: { match_all: {} } } }) const last = page1.hits.hits.at(-1).sort // e.g. [72, 'sku-3355'] await es.search({ index: 'shop.products', body: { size: 20, sort: [{ price: 'asc' }, { _id: 'asc' }], search_after: last, query: { match_all: {} } } }) Delete a bounded set of matches This deletes the two Aero products from the sample. Run the matching count first and use max_docs to cap the deletion. Reload those products before continuing with their read-by-ID or spelling examples. Unbounded whole-table deletion is refused. await es.deleteByQuery({ index: 'shop.products', max_docs: 100, body: { query: { term: { brand: 'Aero' } } } }) Read one document Fetch by ID. The response carries _version for conditional writes and supports _source filtering. The _source/:id route returns only the document. await es.get({ index: 'shop.products', id: 'sku-8842' }) // -> { _index, _id, _version: 2, found: true, _source: { ... } } await es.getSource({ index: 'shop.products', id: 'sku-8842', _source_includes: 'price' }) // -> { price: 139 } await es.exists({ index: 'shop.products', id: 'sku-8842' }) // true / false Group results by calendar day This uses a separate index, shop.orders, with a placed_at date field; the product setup does not create it. Create that mapping and index orders with known dates before testing. Use calendar_interval with ISO-8601 or epoch-millisecond values. Each bucket counts orders within one UTC calendar day. fixed_interval is refused on this path. Create the two-order sample for this request Use an unused test index. Do not replace a shop.orders table from a different example. await es.indices.create({ index: 'shop.orders', body: { mappings: { properties: { placed_at: { type: 'date' } } } } }) await es.bulk({ body: [ { index: { _index: 'shop.orders', _id: 'order-1' } }, { placed_at: '2026-01-01T10:00:00Z' }, { index: { _index: 'shop.orders', _id: 'order-2' } }, { placed_at: '2026-01-01T15:00:00Z' } ] }) Check both bulk item results. The aggregation below should then put two orders into the January 1 UTC day bucket. await es.search({ index: 'shop.orders', body: { size: 0, aggs: { per_day: { date_histogram: { field: 'placed_at', calendar_interval: 'day', time_zone: 'UTC' } } } } }) Count named groups Give each filter a name to obtain a count for that group. Sub-aggregations use the same matched documents. other_bucket_key collects matches outside all named filters. Send this aggregation separately from other top-level aggregations. await es.search({ index: 'shop.products', body: { size: 0, aggs: { by_price: { filters: { other_bucket_key: 'mid_range', filters: { clearance: { range: { price: { lt: 50 } } }, premium: { range: { price: { gte: 200 } } } } }, aggs: { avg_price: { avg: { field: 'price' } } } } } } }) Show documents inside each group Use top_hits to include matching documents and their _source fields. The first request finds the sample City Runner. The final aggs: block is only a request-body fragment: place it inside es.search({ index: ..., body: { ... } }) to request one example per brand. await es.search({ index: 'shop.products', body: { size: 0, query: { match: { name: 'runner' } }, aggs: { best: { top_hits: { size: 3 } } } } }) // nested: one top hit per brand aggs: { by_brand: { terms: { field: 'brand' }, aggs: { top: { top_hits: { size: 1 } } } } } Suggest a spelling correction The term suggester uses words already indexed in the field. missing corrects unknown words; always considers every word. Read each option’s text and score. This adapter does not support phrase or completion suggesters. await es.search({ index: 'shop.products', body: { size: 0, suggest: { did_you_mean: { text: 'marathn', term: { field: 'name' } } } } }) // suggest.did_you_mean[0].options // -> [ { text: 'marathon', score: 0.875 } ] Check versions during bulk writes Put if_seq_no and if_primary_term on each conditional bulk action. A stale item returns 409 while other items can succeed. Read the current document and reapply the intended change before retrying only the conflicting item. await es.bulk({ body: [ { index: { _index: 'shop.products', _id: 'sku-8842', if_seq_no: 1, if_primary_term: 1 } }, { name: 'Carbon Marathon', brand: 'Aero', price: 129 } ] }) // stale precondition -> items[0].index.status === 409 // version_conflict_engine_exception Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries. OriginChainDB is not affiliated with, endorsed by, or sponsored by Elasticsearch B.V. OriginChainDB implements a compatible HTTP API so that existing Elasticsearch clients can talk to it; it does not distribute Elasticsearch software. Next steps Check supported Elasticsearch features before adapting a production client. Connect profiles and search bios Previous Page Error responses Next Page --- ## Error responses | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors Errors Error responses ← All examples Match the HTTP status and error code to a recipe below. The response message explains the specific failure; optional fields may provide a retry delay, current row version or trace ID. The example error envelope is: { "error": "code", // short machine-readable string "message": "human", // plain-English explanation "retry": false // true if the same request might succeed later } Correct invalid requests before resending them. For server or connection failures, retry reads with bounded backoff. Check the outcome of a write before repeating it. These failing-request snippets retain their original explicit tenant route. Use your deployment’s connection details and never print a token while diagnosing a failure. Choose the right response to an API errorA failed write response does not always mean that nothing was stored. 01 Read status and codeFind the matching error recipe. 02 Identify the causeSeparate invalid input, access problems and temporary failures. 03 Check uncertain writesRead the stored state before repeating a write. 04 Correct and verifyApply the documented fix and check the result. 400 - bad request The request is invalid. The problem may be JSON syntax, a name the schema cannot resolve, a type mismatch or an unsupported option. Correct the reported field before resending. 400 - malformed JSON body — The request body failed to parse as JSON. Trailing comma, unterminated string, wrong content-type. 400 - unknown table (schema_not_found via SQL) — The SQL referenced a table that is not declared in any schema for this tenant. 400 - unknown column in SELECT/WHERE — The translator could not resolve a column reference against the table's manifest. 400 - column type mismatch on write — A value did not match the column's declared type. String into a float column, etc. 400 - invalid vector mode (only fast / high_recall) — The topk mode field has only two legal values. Anything else returns 400. 401 / 402 / 403 - auth, billing, permission Check whether the credential is missing, malformed, expired or insufficient. A capability that is not enabled has a separate response; inspect current configuration and billing before changing it. 401 - missing Authorization header — No Authorization header was sent at all. The router rejects before reaching the handler. 401 - malformed bearer token — The header was present but did not parse as 'Bearer '. 401 - token revoked or expired — The token parsed but has been revoked from the admin console or is past its expiry. 402 - addon required (paid feature) — The endpoint is gated by an addon the tenant has not enabled. Body carries a purchase_url. 403 - token valid but for a different instance — The bearer is well-formed and not expired, but it does not authorise this tenant or instance. 404 - not found The hostname, path, or resource id does not exist. 404 - instance / endpoint not found — The hostname or path did not match any provisioned instance or route. 404 - schema not registered — The schema id in the URL is not registered for this tenant. 409 - conflict The request is valid but conflicts with current state - a concurrent writer, or an already-enabled addon. 409 - optimistic-concurrency conflict on row write — A versioned write lost the race. Default writes are last-writer-wins; OCC is opt-in via If-Match. 409 - addon already enabled — The addon-enable request hit a tenant where that addon is already on. 413 - payload too large The body exceeded the limit for that endpoint or gateway. Check row request limits before choosing a batch size. 413 - request body too large — The request body exceeded the per-call size limit. Split into smaller batches. 422 - semantically invalid The request parsed but failed a higher-level semantic check. 422 - semantically invalid manifest (FK target missing) — The manifest parsed as TOML but failed semantic validation. FK targets a column that doesn't exist. 429 - rate limited The configured request budget was exceeded. Read the retry delay and rate-limit guidance before sending more work. 429 - rate limited (per-token cap) — The per-API-key request quota was exceeded. Honour the Retry-After header before retrying. 5xx - server-side The server hit an unexpected condition or the engine was momentarily unreachable. 500 - internal server error — An unexpected server error. Trace id is included in the response; share it with support. 502 - engine unreachable (failover in progress) — The service could not reach the engine. Retry reads within a limit and reconcile uncertain writes before repeating them. Elasticsearch examples Previous Page 400 - invalid vector mode Next Page --- ## 400 - invalid vector mode | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/400-invalid-vector-mode Errors 400 - invalid vector mode ← Errors examples What happened The vector request names a search mode the endpoint does not accept. Use the exact spelling fast or high_recall. Correct an unsupported vector search modeUse the accepted mode spelling; changing mode does not repair the underlying data. 01 Inspect the modeFind the rejected value in the search request. 02 Choose a supported valueUse fast or high_recall. 03 Repeat the corrected readCheck the returned IDs and scores. Request that triggers it Any mode value other than the two legal ones. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/products/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"query": [0.1, 0.2, 0.3], "k": 5, "mode": "warp_speed"}' Read the response { "error": "invalid_argument", "message": "mode 'warp_speed' is not supported; valid values are 'fast' and 'high_recall'", "retry": false } Fix the request Read the mode field in the failing request. Replace it with an accepted value. Run the corrected request once. Keep in mind: Set the mode explicitly; do not depend on a default inferred from older examples. Common causes Typo - high-recall with a hyphen, highrecall with no separator. Carrying over a mode name from another vendor's API (exact, flat, approximate). Configuration string read from an env var that wasn't validated at startup. Casing - the enum is lower-case; Fast is rejected. Continue See error handling and retries, or return to error examples. Error responses Previous Page 400 - malformed JSON body Next Page --- ## 400 - malformed JSON body | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/400-malformed-json Errors 400 - malformed JSON body ← Errors examples What happened The body cannot be parsed as JSON, so the query has not reached its handler. Common causes include trailing commas and broken quoting. Fix the JSON before sending it againThe request cannot reach its handler until the body parses. 01 Locate invalid JSONCheck commas, quotes and the reported parse location. 02 Encode the bodyUse a JSON encoder and the correct content type. 03 Send the corrected requestVerify the response without exposing secrets in public validators. Request that triggers it A trailing comma after the last key in the JSON body. The closing } arrives where the parser expected another key. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"sql": "SELECT id FROM shop.products LIMIT 1",}' Read the response { "error": "invalid_json", "message": "trailing comma at byte offset 18", "retry": false } Fix the request Build the body with a JSON encoder. Check that the body and Content-Type agree. Correct the syntax and send again. Keep in mind: Repeating the same malformed body cannot fix it. Do not paste secrets into a public JSON validator. Common causes Trailing comma after the last field (JSON5 habit leaking into strict JSON). Unterminated string - a missing closing " from shell-escape collisions. Wrong Content-Type header (e.g. text/plain); the router treats those as invalid JSON. Empty body on an endpoint that requires one - the parser sees EOF where it expected {. String-templated payloads with unescaped quotes from user input. Continue See error handling and retries, or return to error examples. 400 - invalid vector mode Previous Page 400 - column type mismatch Next Page --- ## 400 - column type mismatch | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/400-type-mismatch Errors 400 - column type mismatch ← Errors examples What happened A value does not match the type registered for its column. This can happen in a row write or a query filter. Match a value to its column typeA quoted number is a string; the schema decides which value types are accepted. 01 Read the expected typeFind the named column in the schema. 02 Correct the valueSend the proper JSON type and valid range or dimensions. 03 Verify the accepted writeCheck the response and stored value. Request that triggers it Putting a string into a numeric column. The older response below calls the type float64; use f64 when declaring it with the current schema field reference. curl -X PUT "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.orders/o_42" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"id": "o_42", "amount": "not-a-number", "status": "paid"}' Read the response { "error": "type_mismatch", "message": "column 'amount' is float64; value 'not-a-number' is not a number", "retry": false } Fix the request Read the expected type and column in the response. Check the registered schema. Convert the value to the required JSON type. Send the corrected request. Keep in mind: A quoted number is a string. Use the type names from your registered schema and current schema reference. Common causes Form fields arriving as strings from HTML inputs without client-side parsing. null sent for a non-null column. A number outside the declared integer range, or a negative value supplied for u64. A timestamp supplied in seconds when the timestamp column expects epoch milliseconds. Vector dimension mismatch on an embedding column. Boolean sent as "true" (string) instead of true (JSON literal). Continue See error handling and retries, or return to error examples. 400 - malformed JSON body Previous Page 400 - unknown column Next Page --- ## 400 - unknown column | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/400-unknown-column Errors 400 - unknown column ← Errors examples What happened The table exists, but the request names a column that its schema does not define. Resolve a column name before queryingDo not create a new column merely to hide a spelling mistake. 01 Check the query nameInspect the column spelling and table alias. 02 Read the table schemaConfirm which columns actually exist. 03 Run the corrected queryUse the intended column and inspect the returned fields. Request that triggers it Selecting a column that isn't in the schema. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"sql": "SELECT bogus_col FROM shop.customers LIMIT 1"}' Read the response { "error": "unknown_column", "message": "column 'bogus_col' is not declared on table 'shop.customers'", "retry": false } Fix the request Check the column spelling and case. Read the table schema. Qualify columns with the right alias in joins. Correct the query or explicitly update the intended schema. Keep in mind: Do not create a new column just to hide a typo in an existing query. Common causes Typo in the column name. SQL written against a newer schema version than the one currently registered. Aliasing in a JOIN where the alias scope was lost. SELECT * works, then a specific column was added - check spelling against the manifest. Confusing a JSON sub-field with a top-level column (sub-fields require json_extract(...)). Continue See error handling and retries, or return to error examples. 400 - column type mismatch Previous Page 400 - unknown table Next Page --- ## 400 - unknown table | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/400-unknown-table Errors 400 - unknown table ← Errors examples What happened The requested table cannot be resolved in the current tenant and namespace. It may be misspelled or not registered. Find the intended table in this tenantA table in another tenant is not available through the current connection. 01 Confirm the connectionCheck the tenant and instance you are using. 02 Look up the schemaFind the exact namespace and table name. 03 Use the qualified nameCorrect the query or register the intended missing schema. 04 Check the new resultConfirm the request now reaches the correct table. Request that triggers it A SELECT against a table name that doesn't exist in the catalog. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"sql": "SELECT * FROM does_not_exist"}' Read the response { "error": "unknown_table", "message": "table 'does_not_exist' is not declared in any schema for tenant", "retry": false } Fix the request Check the instance and tenant connection. List the available schemas. Use the qualified namespace.table name. Register the intended schema if it is missing. Keep in mind: A table with the same name in another tenant is not available through this connection. Common causes Pointing at the wrong tenant in the URL (so the schema exists, but not for this tenant). Forgetting the schema namespace: customers instead of shop.customers. A schema migration that renamed the table on one environment but not the other. Copy-pasted SQL from another tenant's namespace. Continue See error handling and retries, or return to error examples. 400 - unknown column Previous Page 401 - token revoked or expired Next Page --- ## 401 - token revoked or expired | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/401-expired Errors 401 - token revoked or expired ← Errors examples What happened The credential is no longer accepted because it expired or was revoked. The same credential will keep failing. Replace an expired or revoked credentialNever log the token while checking or replacing it. 01 Identify the rejected tokenCheck which credential the application is loading. 02 Obtain a valid credentialUse the approved account or credential flow. 03 Reload the application secretUpdate the secret store rather than hard-coding the token. 04 Verify accessRepeat the request with the new credential. Request that triggers it A bearer token whose exp claim is in the past, or whose ID has been added to the revocation set. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer eyJ...expired..." \ -H "Content-Type: application/json" \ -d '{"sql": "SELECT id FROM shop.products LIMIT 1"}' Read the response { "error": "unauthorized", "message": "token expired at 2026-04-30T12:00:00Z", "retry": false } Fix the request Obtain a valid credential through the approved account flow. Update the application’s secret store. Reload the connection configuration. Retry with the new credential. Keep in mind: Do not log the token while debugging. Automatic refresh is not a guarantee of every SDK or credential type. Common causes Token issued with a short TTL for an integration test that ran later than expected. System clock drift between the client and the engine - if the client clock is far ahead, valid tokens look expired. Team member rotated the token in the dashboard but didn't redeploy the consumer. Token explicitly revoked after an offboarding. Continue See error handling and retries, or return to error examples. 400 - unknown table Previous Page 401 - malformed bearer token Next Page --- ## 401 - malformed bearer token | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/401-malformed-bearer Errors 401 - malformed bearer token ← Errors examples What happened The Authorization header arrived but does not have the expected Bearer token format. Missing prefixes, pasted punctuation or newlines can cause this. Repair the Authorization header formatThe required prefix is Bearer followed by one space and the loaded token. 01 Inspect header constructionCheck the format without printing its secret value. 02 Remove extra charactersAvoid quotes, newlines or a missing Bearer prefix. 03 Verify the corrected headerSend the request with a properly loaded credential. Request that triggers it An Authorization header that's missing the Bearer prefix. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: not-a-real-bearer" \ -H "Content-Type: application/json" \ -d '{"sql": "SELECT id FROM shop.products LIMIT 1"}' Read the response { "error": "unauthorized", "message": "Authorization header must be 'Bearer '", "retry": false } Fix the request Use the literal prefix Bearer followed by one space and the token. Check that the secret variable is populated without printing its value. Remove accidental surrounding quotes or newlines. Send the corrected header. Keep in mind: The response marks this request as non-retryable until the header is corrected. Common causes Token sent without the Bearer prefix. Lowercase bearer from a snippet - the parser is case-sensitive on the scheme name. Smart-quote characters from a doc copy-paste (" vs "). Trailing whitespace or newline pulled in from a file read. Two tokens concatenated by accident (env var set twice). Continue See error handling and retries, or return to error examples. 401 - token revoked or expired Previous Page 401 - missing Authorization header Next Page --- ## 401 - missing Authorization header | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/401-missing-bearer Errors 401 - missing Authorization header ← Errors examples What happened The endpoint did not receive an Authorization bearer header. This is different from an expired token. Send the missing access credentialCheck both the client and any proxy that forwards its request. 01 Load the credentialRead the token from your configured secret source. 02 Attach AuthorizationSend Bearer followed by the token. 03 Check forwarding and accessEnsure the header reaches the API and inspect the response. Request that triggers it A request that omits the Authorization header entirely. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Content-Type: application/json" \ -d '{"sql": "SELECT id FROM shop.products LIMIT 1"}' Read the response { "error": "unauthorized", "message": "missing Authorization header", "retry": false } Fix the request Confirm the application loaded its secret. Set Authorization: Bearer followed by that token. Check that a proxy forwards the header. Retry the corrected request. Keep in mind: Use the constructor and environment rules for your installed SDK version; do not assume all clients load OC_TOKEN automatically. Common causes Token env var unset in CI - the script silently sent an empty value, which the proxy stripped. A reverse proxy or sidecar dropping the Authorization header on forward. Calling through a CDN cache that wasn't configured to forward auth headers. Pasted cURL from a docs page that didn't include the auth line. Frontend code that forgot to attach the token to fetch options. Continue See error handling and retries, or return to error examples. 401 - malformed bearer token Previous Page 402 - addon required Next Page --- ## 402 - addon required | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/402-addon-required Errors 402 - addon required ← Errors examples What happened The requested capability is not enabled for this instance. The response identifies the capability and may include an enablement link. Check availability before enabling a capabilityThe error is not approval to purchase or enable an add-on. 01 Identify the capabilityRead which add-on the request requires. 02 Review its availabilityCheck the configuration and billing requirements. 03 Enable only when authorizedHave an authorized operator make the change. 04 Verify after activationRetry the feature once its configuration is ready. Request that triggers it Calling a paid endpoint (here, natural-language SQL via /ask) before the ask addon is enabled. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/ask" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"question": "how many customers do I have?"}' Read the response { "error": "addon_required", "message": "natural-language SQL requires the 'ask' addon", "retry": false, "addon": "ask", "name": "Natural language SQL", "monthly_usd": 99, "purchase_url": "https://originchaindb.com/app/addons?enable=ask" } Fix the request Read the capability named in the error. Check its availability for the instance. Review current billing terms before enabling it. Retry only after the configuration has changed. Keep in mind: An error response is not consent to a purchase. Do not hardcode a price from this illustrative response into the application. Common causes New tenant exploring paid endpoints during onboarding. Different tenant in the same org has the addon - tokens are per-instance, not org-wide. Free-configuration customer hitting a paid surface from a tutorial. Continue See error handling and retries, or return to error examples. 401 - missing Authorization header Previous Page 403 - token valid but for a different instance Next Page --- ## 403 - token valid but for a different instance | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/403-forbidden Errors 403 - token valid but for a different instance ← Errors examples What happened The credential is recognized but does not authorize this action on the requested resource. Resolve access without changing the request blindlyThe credential was recognized, but it lacks access to this operation or tenant. 01 Check the identityConfirm the account and target instance. 02 Review the required permissionCompare the operation with the granted access. 03 Ask an administratorCorrect the intended grant or target. 04 Verify the allowed operationRetry only after the access issue is resolved. Request that triggers it A token for tenant A used against tenant B's URL. curl -X POST "https://$OC_HOST/v1/tenants/other-tenant/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"sql": "SELECT id FROM shop.products LIMIT 1"}' Read the response { "error": "forbidden", "message": "token does not authorise access to tenant 'other-tenant'", "retry": false } Fix the request Check that the credential belongs to the intended instance and identity. Inspect the permissions required for this operation. Ask an authorized administrator to correct the grant if appropriate. Retry after the permission change. Keep in mind: Changing tokens at random or repeating the same request does not resolve the missing permission. Common causes Tenant id hardcoded in a snippet that was copied between environments. Staging token used against a production endpoint. Tenant id and instance hostname out of sync after a rename. Multi-tenant app router building the URL from one source and the token from another. Token scope was narrowed (e.g. read-only) and the call needs a permission the scope doesn't grant. Continue See error handling and retries, or return to error examples. 402 - addon required Previous Page 404 - instance / endpoint not found Next Page --- ## 404 - instance / endpoint not found | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/404-instance Errors 404 - instance / endpoint not found ← Errors examples What happened The requested instance address or identifier cannot be found. A saved URL may refer to a deleted, incorrect or unfinished instance. Correct an instance address or readiness problemUse the actual connection details instead of guessing an instance URL. 01 Check the target instanceConfirm it exists and is ready. 02 Copy its connection detailsUse the address shown by the Connect instructions. 03 Update and verifyCorrect the application configuration and check the connection. Request that triggers it A request to a hostname that doesn't belong to any tenant. curl -X POST "https://nope.db.originchain.ai/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"sql": "SELECT id FROM shop.products LIMIT 1"}' Read the response { "error": "not_found", "message": "no instance is provisioned at this endpoint", "retry": false } Fix the request Copy the current connection details from the console. Check the selected instance and its provisioning state. Update the application’s configuration. Retry against that instance. Keep in mind: Keep the provided address intact instead of guessing or removing path segments. Common causes Typo in the instance subdomain. A copied instance address that differs from the connection details shown in the console. Instance was destroyed; the env var still points at the old endpoint. Pre-launch hostname queued in DNS but provisioning hasn't completed yet. Calling /api/v1 instead of /v1, or a roadmap endpoint that hasn't shipped. Continue See error handling and retries, or return to error examples. 403 - token valid but for a different instance Previous Page 404 - schema not registered Next Page --- ## 404 - schema not registered | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/404-schema Errors 404 - schema not registered ← Errors examples What happened The named schema is absent from the selected tenant or namespace. Register or address the intended schemaRegister referenced schemas first when the new schema depends on them. 01 Check the current connectionConfirm the instance and tenant. 02 Find the qualified schemaCompare the namespace and table with the schema list. 03 Correct the name or registerCreate the intended missing schema with its dependencies. 04 Verify the requestConfirm it now uses the expected schema. Request that triggers it A direct GET against a schema id that doesn't exist. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/schemas/does.not.exist" \ -H "Authorization: Bearer $OC_TOKEN" Read the response { "error": "schema_not_found", "message": "no schema 'does.not.exist' for tenant", "retry": false } Fix the request Check the qualified schema name. List schemas on the current connection. Register missing referenced schemas first. Register or select the intended schema and retry. Keep in mind: Schema definitions in another tenant do not satisfy this request. Common causes Schema registered on staging but not yet on prod. Typo in the namespace - shop. vs shops.. Schema was deleted (via a destructive-data confirm) and a downstream service still references it. Multi-region deploy where the new region missed a migration step. Continue See error handling and retries, or return to error examples. 404 - instance / endpoint not found Previous Page 409 - addon already enabled Next Page --- ## 409 - addon already enabled | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/409-addon-already-enabled Errors 409 - addon already enabled ← Errors examples What happened The capability is already enabled. Sending the same enable request again conflicts with its current state. Confirm an add-on that is already activeDo not repeat activation or assume another purchase is needed. 01 Read the current configurationFind the add-on that returned the conflict. 02 Compare the requested stateCheck that the enabled capability is the intended one. 03 Continue with the featureUse the active configuration once it matches. Request that triggers it Re-enabling an addon that's already on. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/addons" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"addon": "ask"}' Read the response { "error": "addon_already_enabled", "message": "addon 'ask' is already enabled for this tenant", "retry": false } Fix the request Read the instance’s current capability state. Check that it matches the requested configuration. Treat an already-satisfied setup step as complete. Continue with the feature operation. Keep in mind: Do not repeatedly enable or buy the capability to resolve this response. Common causes Provisioning script run twice in CI. Dashboard click that re-fired through a stale tab. Migration that enabled the addon manually, then a Terraform run that tried to enable it again. Two team members enabling the same addon from different sessions. Continue See error handling and retries, or return to error examples. 404 - schema not registered Previous Page 409 - optimistic-concurrency conflict Next Page --- ## 409 - optimistic-concurrency conflict | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/409-occ-conflict Errors 409 - optimistic-concurrency conflict ← Errors examples What happened A conditional write used an old row version. Optimistic concurrency control means the write is accepted only if the row still has the version supplied in If-Match. Reconcile an edit against the latest versionA conflict prevents a stale update from silently replacing a newer one. 01 Read the latest recordFetch its current fields and version. 02 Reconcile the editDecide which changes still apply. 03 Use the new versionSend a conditional write with the current version. 04 Check the outcomeVerify success or handle another conflict within a bounded retry policy. Request that triggers it A conditional PUT where the If-Match version no longer matches. curl -X PUT "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.customers/c_42" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "If-Match: 17" \ -H "Content-Type: application/json" \ -d '{"id": "c_42", "email": "alice@example.com", "tier": "platinum"}' Read the response { "error": "write_conflict", "message": "row 'c_42' is at version 18, expected 17", "retry": true, "current_version": 18 } Fix the request Read the latest row and version. Reapply and validate the intended change against that row. Submit the new value with the new If-Match version. Stop or retry within a bounded application policy if it conflicts again. Keep in mind: Version checks are opt-in; ordinary writes are last-writer-wins. Repeating the unchanged request with the old version will fail again. Common causes Two workers picking up the same job from a queue and racing on the same row. Background reconciler and user-facing edit landing in the same millisecond. Re-using a stale version number from an in-memory cache. Mobile client with an offline edit syncing after the server already advanced. Wrong row's version copied into If-Match from another response. Continue See error handling and retries, or return to error examples. 409 - addon already enabled Previous Page 413 - request body too large Next Page --- ## 413 - request body too large | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/413-payload-too-large Errors 413 - request body too large ← Errors examples What happened The request body exceeds the limit accepted by the receiving endpoint or gateway. The response below illustrates an 8 MiB limit; it is not the current limit for every route. The row API limits distinguish an 8 MiB single-row body from a 64 MiB JSON batch. Split a request to fit its actual route limitLimits differ by route; count the encoded request bytes rather than the number of records alone. 01 Measure the encoded bodyInclude the JSON and request format overhead. 02 Check the route limitUse the documented cap for this endpoint. 03 Send smaller batchesKeep each body below the limit. 04 Track each responseRecord which batches succeeded before proceeding. Request that triggers it A bulk insert whose encoded file exceeds the actual limit on its request path. Do not expect the example 8 MiB response from a batch endpoint configured with a larger limit. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.products/_batch" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ --data-binary @huge-batch.json Read the response { "error": "payload_too_large", "message": "request body 12.4 MiB exceeds limit of 8 MiB", "retry": false, "limit_bytes": 8388608 } Fix the request Measure the encoded request size. Split the data into smaller batches. Keep each batch below the request limit. Track each batch result before continuing. Keep in mind: Use the current endpoint limits and SDK behavior; do not assume every SDK chunks requests automatically. Common causes A single batch insert containing every record from a CSV dump. Rows that include large base64-encoded blobs (images, PDFs). Wide vector embeddings on many rows (768-dim float32 = 3 KiB per row before JSON overhead). A debug payload that accidentally inlined a stack trace or a large log fragment. Forgetting to paginate an upstream source. Continue See error handling and retries, or return to error examples. 409 - optimistic-concurrency conflict Previous Page 422 - semantically invalid manifest Next Page --- ## 422 - semantically invalid manifest | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/422-semantic Errors 422 - semantically invalid manifest ← Errors examples What happened The body has valid syntax, but its schema meaning is invalid. In this example a relationship refers to an incompatible or missing target definition. Correct a schema that parses but is invalidValid syntax does not guarantee valid table relationships or matching column types. 01 Read the rejected ruleIdentify the missing target or incompatible definition. 02 Compare both schemasCheck source and target names, types and keys. 03 Fix dependencies and fieldsRegister prerequisites and correct the relation definition. 04 Validate the new submissionCheck that the corrected schema is accepted. Request that triggers it A manifest where a foreign key points at a column that doesn't exist on the target table. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/schemas" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/toml" \ --data-binary @- <<'TOML' [table] name = "shop.orders" [[column]] name = "id" type = "string" primary_key = true [[column]] name = "customer_id" type = "string" [[foreign_key]] column = "customer_id" references = "shop.customers.missing_pk" TOML Read the response { "error": "invalid_manifest", "message": "foreign key target 'shop.customers.missing_pk' does not exist", "retry": false } Fix the request Read the referenced schema and field names in the error. Inspect both source and target definitions. Register dependencies and correct the relationship. Submit the corrected schema. Keep in mind: Valid TOML or JSON alone does not prove that referenced fields and types are compatible. Common causes FK target table not registered yet (apply manifests in the right order). Typo in the FK target column name. The target key is missing from the table-level primary_key array, such as primary_key = ["id"]. Vector column's declared dim doesn't match the embedding model. Two indexes with the same name on one table. CHECK constraint with the field expr (legacy) instead of the current expression. Continue See error handling and retries, or return to error examples. 413 - request body too large Previous Page 429 - rate limited (per-token cap) Next Page --- ## 429 - rate limited (per-token cap) | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/429-rate-limited Errors 429 - rate limited (per-token cap) ← Errors examples What happened The request exceeded an existing request budget. Services sharing the same credential may contribute to the same limit. Wait before making another requestCheck the stored outcome before repeating any write whose result is uncertain. 01 Read the retry guidanceInspect Retry-After and the reported rate limit. 02 Reduce request pressureWait and lower concurrency or request frequency. 03 Retry within a limitUse bounded backoff for reads; reconcile uncertain writes first. 04 Check recoveryConfirm requests succeed without continuing a tight retry loop. Request that triggers it Any request after the per-token cap is hit. -i shows the headers. curl -i -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"sql": "SELECT id FROM shop.products LIMIT 1"}' Read the response HTTP/1.1 429 Too Many Requests Retry-After: 7 Content-Type: application/json { "error": "rate_limited", "message": "API key has exceeded its per-second request quota", "retry": true, "retry_after_seconds": 7 } Fix the request Read Retry-After or the retry delay in the response. Wait before a bounded retry. Reduce request concurrency or batch supported operations. Review the configured quota if the workload regularly exceeds it. Keep in mind: For uncertain writes, reconcile the previous outcome before retrying. Do not create extra credentials to bypass the limit. Common causes Backfill script with no per-request delay. One token shared across many services that each assume they have the full budget. A retry loop that doesn't honour Retry-After and amplifies the spike. Multiple replicas of a worker that all woke up after a deploy and started together. A frontend that fires a fetch per keystroke instead of debouncing. Continue See error handling and retries, or return to error examples. 422 - semantically invalid manifest Previous Page 500 - internal server error Next Page --- ## 500 - internal server error | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/500-backend Errors 500 - internal server error ← Errors examples What happened The service failed while handling the request. A write may have an unknown outcome if the failure happened after it was accepted. Investigate a backend failure before retryingA failed response does not prove that a write was rolled back. 01 Keep the error detailsRecord the trace ID and time without secrets. 02 Check the stored stateDetermine whether an attempted write already took effect. 03 Choose the next actionBound read retries; reconcile writes or contact support. 04 Verify the outcomeConfirm the intended state rather than only the HTTP status. Request that triggers it Any normally-valid request that surfaces a bug or unhandled internal condition. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"sql": "SELECT id FROM shop.products LIMIT 1"}' Read the response { "error": "internal_error", "message": "unexpected backend error; please retry. If this persists, contact support with the trace id below.", "retry": true, "trace_id": "0b1c2d3e-4f50-6172-8390-a1b2c3d4e5f6", "status_page": "https://status.originchain.ai" } Fix the request Keep the request or trace ID and time. For a read, use bounded backoff. For a write, check the stored result before repeating it. Contact support with non-secret diagnostics if the failure persists. Keep in mind: A server error does not prove that a write was rolled back. A fresh idempotency key alone does not make replay safe. Common causes A new bug surfaced by a recent deploy. The engine running out of memory while handling a large query. A storage read or write failure. An unexpected internal failure; the trace ID helps support locate it. An internal dependency (the platform or billing service) was momentarily down. Continue See error handling and retries, or return to error examples. 429 - rate limited (per-token cap) Previous Page 502 - engine unreachable Next Page --- ## 502 - engine unreachable | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/errors/502-engine-unreachable Errors 502 - engine unreachable ← Errors examples What happened The service could not reach the database engine. This may be temporary, but it does not establish whether an earlier write completed. Handle an engine that cannot be reachedAvoid changing production topology or repeating unknown writes to test connectivity. 01 Check instance statusLook for a readiness or temporary connection problem. 02 Back off on readsRetry a read within a bounded policy. 03 Reconcile uncertain writesCheck whether a write landed before attempting it again. 04 Escalate if it persistsKeep the error details for investigation. Request that triggers it Any request that lands in that window - a restart, a deploy, or a writer changeover. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"sql": "SELECT id FROM shop.products LIMIT 1"}' Read the response { "error": "engine_unreachable", "message": "control plane could not reach the engine for this tenant", "retry": true, "trace_id": "5f4e3d2c-1b0a-9988-7766-554433221100", "status_page": "https://status.originchain.ai" } Fix the request Check instance and service status. Retry reads with bounded backoff. Reconcile uncertain writes before resubmitting. Contact support with the trace ID if connectivity does not recover. Keep in mind: Keep retries bounded. Do not change production topology simply because one request failed. Common causes A writer changeover in an active-passive pair - a standby takes over as writer. Promotion is operator-driven by default; the engine also has an opt-in automatic promotion path, off by default, which depends on an external restart hook and refuses to promote a standby that is not fully caught up. Planned restart for a config change. A transient network blip inside the service. Engine briefly unresponsive during a heavy compaction. A rolling deploy of the engine binary. Continue See error handling and retries, or return to error examples. 500 - internal server error Previous Page Full-text search examples Next Page --- ## Full-text search examples | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/fts Fts Full-text search examples ← All examples Index text before searching it. Choose word matching for required terms, phrase matching for word order, or BM25 for ranked results. Search entries and source rows are updated separately. Start with Make text searchable, then find the word wireless. That pair needs one document and shows the whole write-to-result flow. Add more documents before comparing ranking scores or grouped totals. From indexed words to a useful text resultLoad the matching sample before trying boolean, ranked or summary requests. 01 Index the sample textUse the same table, field and ID in later requests. 02 Choose a text questionLook for a word, a phrase or ranked matches. 03 Inspect the returned IDsRead scores or summaries only where that request supports them. Search and summarize text Make text searchable — Add a document’s words to a full-text index. Find documents containing a word — Search an indexed field for a word. Require every query word — Find documents containing all query words, in any order and not necessarily next to each other. Find words in order — Match adjacent words in query order after the field’s analyzer has processed them. Rank text matches — BM25 ranks documents using term frequency and document length. Combine matches from several fields — Search title and description separately, then combine their scores in your application. Summarize matching documents — Search text and calculate summaries across its matches, such as counts by category. Offer query suggestions — Suggest words or phrases from an indexed field. Control equivalent and ignored words — Synonyms represent equivalent words. Before adapting a recipe Use a test database, load the named sample data, and check the expected result. Read each page’s limits before changing the query. See connection and SDK notes. 502 - engine unreachable Previous Page Summarize matching documents Next Page --- ## Summarize matching documents | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/fts/aggregations Fts Summarize matching documents ← FTS examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Search text and calculate summaries across its matches, such as counts by category. A facet is a stored value used for a summary. Before you run it: An over-limit match set is refused rather than summarized partially. Facet values must be written first. A bucket is a group of matching documents, such as all blue products. The top-level field selects the indexed text collection; color and price inside aggs are saved facet values. The small write below is enough to inspect the response shape, but the illustrated totals require the corresponding full set of documents. Summarize the complete set of text matchesA refused oversized match set should not be displayed as a partial total. 01 Store text and facetsWrite searchable words and the separate summary fields. 02 Find the bounded match setUse every match permitted by the aggregation limit. 03 Group and add valuesCount colors or sum prices across those matched documents. 04 Check the summaryConfirm the groups describe the whole accepted match set. Follow the example Write text and facet values with the setup below. Choose search and aggregation fields separately. Send the request. Read the buckets or calculated values. Write text and facet values An aggregation reads per-document records, not the indexed text. Postings written by the text-indexing sample carry no attribute values, so give each document a facets map first. Re-posting the same doc_id replaces its record. # Attach the values the aggregation will fold over. "text" is the stored # text highlighting reads; "facets" maps a facet field to its values. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description/doc" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "doc_id": "p001", "text": "Over-ear headphones with active noise cancellation", "facets": { "color": ["red"], "price": ["249"] } }' Run the request Bucket every matching document by color and sum price inside each bucket. Omit search entirely and the tree runs over every document indexed under the field. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/_aggs" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "field": "description", "search": { "query": { "bool": { "must": [{ "match": { "field": "description", "query": "headphones" } }], "must_not": [{ "term": { "field": "description", "value": "refurbished" } }] } } }, "aggs": { "by_color": { "terms": { "field": "color" }, "aggs": { "revenue": { "sum": { "field": "price" } } } } } }' Check the result Summaries use the complete match set within the limit, not just displayed top hits. { "doc_count": 2, "aggs": { "by_color": { "kind": "buckets", "buckets": [ { "key": "red", "doc_count": 2, "aggs": { "revenue": { "kind": "value", "value": 349.0 } } } ], "sum_other_doc_count": 0 } } } doc_count is the size of the set the tree was evaluated over. Every result is tagged with kind - buckets, value, stats, cardinality and so on - so a client can dispatch on the shape without knowing which aggregation produced it. Understand the behavior Two different "field" keys. The top-level field names the FTS field whose per-document records hold the values. The field inside each aggregation names the facet being bucketed. They are rarely the same string. Buckets cover the whole match set. Ranked search stops at a top-k; an aggregation cannot, or it would answer a different question with a number that looks right. The executor is asked for every match, so a terms count counts all of them. Too many matches is a refusal, not a sample. A match set above the hit ceiling (OC_FTS_MAX_HITS, default 10,000) returns 400 naming the limit rather than quietly aggregating a prefix. Trees nest. Each bucket carries its own aggs map, up to MAX_AGG_DEPTH = 8 levels. terms buckets default to count-descending. Facet values are stored as strings and coerced to numbers by the numeric aggregations, which is why "249" sums correctly. Important limits and checks Aggregating a field that has no per-document records. Indexing text writes postings only. Without a /doc write carrying facets, there is nothing to fold and the bucket lists come back empty. Sending an empty aggs object. Refused with 400 - an empty tree would return an object that reads like a result. A pipeline aggregation at the top level. cumulative_sum and its siblings act on a parent bucket list; at the root there is none, so the request is refused rather than answered with zeroes. Expecting top_k to bound the cost. It is ignored here by design. If the query matches too much, narrow the query - the endpoint will not hand back a prefix. Putting doc_values_field in the search block. Refused: the aggregated field is already the value source, and the two could only disagree. Continue Continue to rank text matches. Full-text search examples Previous Page Rank text matches Next Page --- ## Rank text matches | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/fts/bm25 Fts Rank text matches ← FTS examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. BM25 ranks documents using term frequency and document length. Use it to see stronger text matches first. Before you run it: Scores from different queries are not directly comparable. Highlight, facet and fuzzy options apply to the documented BM25 path. The one-document sample is enough to check that p001 is found. Add other documents before judging ranking. A BM25 score describes how strongly the query words match relative to other indexed documents; it is not a percentage confidence that an answer is correct. Rank text matches with BM25Scores compare results within this query; they are not confidence percentages. 01 Index searchable textBuild the sample field's term statistics. 02 Run the ranked queryRequest BM25 with the desired result limit. 03 Read highest scores firstInspect the matching IDs and available stored text. Follow the example Index documents and any stored text needed for highlights. Set mode: bm25 explicitly. Choose a maximum result count. Read the hits in score order. Run the request First index the sample text. Use the same table and field in the search request; storing a row alone does not create its search entry. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" \ --data-urlencode "q=wireless headphones" \ --data-urlencode "mode=bm25" \ --data-urlencode "k=10" Check the result Higher scores rank first for this query. Highlights or facets change the response to an object with hits and facets. [ { "doc_id": "p001", "score": 9.42 }, { "doc_id": "p027", "score": 7.18 }, { "doc_id": "p014", "score": 4.55 } ] A bare array of { doc_id, score } objects - no { "mode": ..., "hits": [...] } wrapper. Read highlighted or faceted results The plain bare-array shape only changes when you add highlight=true or facets=. Then - and only then - BM25 returns an object with a hits array (each hit carrying optional highlights) and a facets block. Highlights require the doc text to have been stored via POST /fts/:t/:f/doc first. { "hits": [ { "doc_id": "p001", "score": 9.42, "highlights": { "description": ["Over-ear wireless headphones with…"] } }, { "doc_id": "p027", "score": 7.18, "highlights": {} } ], "facets": { "category": [{ "value": "electronics", "count": 2 }] } } k, fuzzy, highlight, facets, and explain are BM25-only - they are silently ignored in boolean and phrase modes. Understand the behavior The query is tokenised, then for each token the engine fetches the posting list along with term frequencies and document lengths. Each candidate document gets a BM25 score using the Lucene defaults: k1 = 1.2, b = 0.75. Score grows with how often the rare terms appear and shrinks if the document is much longer than average. A top-k heap keeps the highest scorers; everything else is discarded. Optional query params: fuzzy=1 for single-character typo tolerance, highlight=true to return matched-snippet text, facets=col,col for grouped counts alongside hits. Important limits and checks Comparing scores across queries. A BM25 score of 9.4 means nothing on its own and can't be compared to the 9.4 from a different query. Use scores to rank within one result set only. Forgetting k. If you omit it, you get a default cap. Set k to what you actually need; ranking the entire corpus is wasted work. Reaching for BM25 when boolean would do. If you only need "does it match", boolean is cheaper and the answer is the same set. Continue Continue to combine matches from several fields. Summarize matching documents Previous Page Require every query word Next Page --- ## Require every query word | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/fts/boolean-and Fts Require every query word ← FTS examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Find documents containing all query words, in any order and not necessarily next to each other. Before you run it: Terms are combined with AND. Use phrase mode when order and adjacency matter. First run the text-indexing setup. Its p001 text contains both wireless and headphones, so it matches this request. One missing query word excludes a document. The response example includes extra documents that must be indexed separately. Require both search words in a documentAND requires both terms anywhere in the indexed text; it does not require a phrase. 01 Enter two termsSearch for wireless and headphones. 02 Intersect their matchesKeep IDs found in both term lists. 03 Open matching documentsDocuments containing only one term are excluded. Follow the example Index the sample text. Put the required words in one query. Run boolean search. Check that each result contains every term. Run the request Tokens are space-separated in q. Some clients show this URL-encoded as wireless+headphones - same thing. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" \ --data-urlencode "q=wireless headphones" \ --data-urlencode "mode=boolean" Check the result The response is a list of matching document IDs without scores. ["p001", "p027"] Bare array of doc_id strings (the intersection), sorted lexicographically. No wrapper object, no scores. Understand the behavior The query is tokenised into a list - here ["wireless", "headphones"]. The engine fetches the posting list for each token and intersects them. Smallest list first keeps the work bounded by the rarest term. The intersection is the answer. No scoring is computed. Important limits and checks Assuming OR behaviour. Multi-token boolean is strictly AND - there is no OR mode. For OR, run two separate queries and union the returned arrays client-side. Expecting proximity. AND doesn't care where the tokens sit - "wireless mouse and wired headphones" matches "wireless headphones". Use phrase mode if you need them adjacent. Adding a rare token to "help match more". AND only narrows - every extra token can only remove docs, never add. Continue Continue to find words in order. Rank text matches Previous Page Find documents containing a word Next Page --- ## Find documents containing a word | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/fts/boolean-single Fts Find documents containing a word ← FTS examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Search an indexed field for a word. This mode returns document IDs without relevance scores. Before you run it: The analyzer normalizes words. This is a word match, not a ranking of likely answers. The indexing recipe adds only p001. With that data, searching wireless should return that ID. The larger response below illustrates the same format with additional documents; it is not a promise that those IDs were created for you. Lexicographic order means text order by ID, not best-match order. Find documents that contain one wordBoolean search returns matching IDs, not a relevance ranking. 01 Index the sample wordsMake wireless searchable in the chosen field. 02 Search the wordThe field's text rules process the search term. 03 Read matching IDsOpen the associated records; do not treat ID order as relevance. Follow the example Index the sample documents. Reuse the same table and field names. Put one word in q. Open the returned IDs in the source data. Run the request First index the sample text. Use the same table and field in the search request; storing a row alone does not create its search entry. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" \ --data-urlencode "q=wireless" \ --data-urlencode "mode=boolean" Check the result The response is a bare array of IDs in lexicographic order. ["p001", "p014", "p027"] The body is the array itself - there is no { "mode": ..., "doc_ids": [...] } wrapper. Parse it and iterate directly. Understand the behavior The query is tokenised with the same analyser used at index time - lowercased and split on whitespace/punctuation. The single token is looked up in the inverted index. The posting list for that token is the answer. Because there's no scoring step, boolean mode is the cheapest query shape - constant work per matching doc, no per-doc maths. Important limits and checks Expecting a ranked order. The returned array is sorted lexicographically by doc_id, not by relevance. Don't read any ranking into the order. Looking for a .doc_ids field. The response is the bare array - ["p001", "p014"] - not an object. Accessing .doc_ids on it returns undefined. Expecting case sensitivity. The query token is lowercased to match indexing - q=Wireless and q=wireless behave identically. Passing multiple tokens and expecting OR. Multi-token boolean is AND; see match every search term. Continue Continue to require every query word. Require every query word Previous Page Make text searchable Next Page --- ## Make text searchable | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/fts/index-doc Fts Make text searchable ← FTS examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Add a document’s words to a full-text index. Keep its ID aligned with the source row so the application can open each match. Before you run it: Updating a source row does not update this index automatically; submit changed text again. A full-text index is a lookup from words to document IDs. The sample writes one document, p001, under shop.products/description. After the write, use single-word search for wireless; with only this sample loaded, expect p001. A source row is optional for this index operation but needed if your application later fetches product details. Index words, then find their document IDNative text indexing and source-row writes are separate operations. 01 Choose p001 and a fieldKeep the table and field names identical across requests. 02 Index its textWait for the successful indexing response. 03 Search for wirelessLook for p001 in the matching IDs. 04 Read the source if storedUse its ID to fetch the original row separately. Follow the example Choose the table, field and document ID. Send the text. Check the write response. Search for a word just indexed. Run the request FTS is a runtime endpoint - there is no [[extractions.fts]] block on the schema and no setup step. The first POST creates the index. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "doc_id": "p001", "text": "Wireless over-ear headphones with active noise cancellation and 30-hour battery life." }' Check the result The write returns 201 with an empty body. Reusing an ID replaces that document’s indexed text. HTTP/1.1 201 Created (empty body) A successful index returns 201 Created with no response body. There is no tokens_indexed count or confirmation JSON - check the status code, not the body. Understand the behavior The text is tokenised, lowercased, and the per-token postings are written to the inverted index keyed by (schema, field, token). If a doc with this doc_id already exists in this field's index, the previous postings are removed and the new ones written in a single atomic batch. There is no window where both versions are visible. Each field is an independent index. Indexing description does nothing to title. :table and :field are opaque path segments - they are not validated against any schema. They must match exactly (byte-for-byte) between the index POST and the search GET. Index under shop.products and query shop_products and you get a silent empty result, not an error. Important limits and checks Forgetting to re-index on writes. Updating the source row's text in /rows does not update the FTS index. You have to POST to the FTS endpoint again, or wire a hook that does it for you. Using something other than the primary key for doc_id. Search returns doc_ids - if it's not the row's PK you'll need an extra lookup on every hit. Indexing multi-MB blobs as a single doc. Very large documents bloat the postings and hurt scoring. Split into chunks (e.g. one doc_id per paragraph or per page) and let the search side merge. Continue Continue to find documents containing a word. Find documents containing a word Previous Page Combine matches from several fields Next Page --- ## Combine matches from several fields | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/fts/multi-field Fts Combine matches from several fields ← FTS examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Search title and description separately, then combine their scores in your application. This example gives title matches more weight. Before you run it: This native route does not turn several field names into one weighted query. Fetch enough candidates from each field before merging. The cURL tab shows the four HTTP calls; it does not perform the final merge for you. Use the application-language examples to combine scores by doc_id. With only p001 indexed in both fields, the merge should still produce one item, not two. Search two fields and combine them in your appThe application merges separate field searches; this example is not one native multi-field request. 01 Index title and descriptionUse the same document ID in both fields. 02 Search each fieldRun a BM25 request for each indexed field. 03 Merge by document IDApply your chosen field weights in the application. 04 Show one ranked listAvoid displaying the same document twice. Follow the example Index both fields with the same IDs. Run BM25 for each field. Merge results by ID. Apply the shown weights and sort. Run the request Two POSTs to set up (one per field), two GETs to query, one client-side merge step. The doc_id on both fields is the same row PK so the merge can join on it. # Step 1: index the same row into two separate fields curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/title" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "doc_id": "p001", "text": "Wireless Headphones - Pro" }' curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "doc_id": "p001", "text": "Over-ear wireless headphones with noise cancellation." }' # Step 2: query each field, then merge client-side curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/title" \ -H "Authorization: Bearer $OC_TOKEN" \ --data-urlencode "q=wireless headphones" --data-urlencode "mode=bm25" --data-urlencode "k=20" curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" \ --data-urlencode "q=wireless headphones" --data-urlencode "mode=bm25" --data-urlencode "k=20" Check the result The application produces the final weighted order. // merged, sorted client-side [ { "doc_id": "p001", "score": 28.92 }, // strong title + description hit { "doc_id": "p027", "score": 14.50 }, // description-only hit { "doc_id": "p014", "score": 9.10 } ] Understand the behavior Each field has its own inverted index and its own document statistics. BM25 on title is computed only against other titles - so a match in a 4-word title scores very high. The two result sets share the doc_id namespace because you used the same PK on both POSTs. You merge by summing weighted scores per doc_id. Docs that match in both fields naturally float to the top; docs that match in only one are still present but with their single-field score. Important limits and checks Trying to do the merge server-side. There is no multi-field query mode - merging is your app's responsibility. That's deliberate: it keeps the weights tunable without redeploying. Concatenating fields into one big text blob. You lose the field-level statistics that make title boost work in the first place. Keep them separate. Using too small a k. If a doc only matches one field, it must be inside that field's top-k to appear in the merge. Pull a larger k per field than you intend to surface. Using different doc_ids across fields. The merge joins on doc_id. Use the row's primary key on every field's POST so that matches from each field refer to the same document. Continue Continue to summarize matching documents. Make text searchable Previous Page Find words in order Next Page --- ## Find words in order | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/fts/phrase Fts Find words in order ← FTS examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Match adjacent words in query order after the field’s analyzer has processed them. Before you run it: Phrase mode is not fuzzy matching. Analysis can remove punctuation and change case. The indexed sample contains the adjacent words noise cancellation, so p001 should match. An analyzer is the rule that splits and normalizes text before comparison. Phrase matching follows those processed words, not the original punctuation byte for byte. Find words together in the same orderPhrase matching uses processed tokens, not fuzzy matching or arbitrary substrings. 01 Index token positionsLoad the sample text containing noise cancellation. 02 Search the phraseRequire those processed words next to each other. 03 Read matching IDsOpen the documents that preserve the requested word order. Follow the example Index the sample text. Choose a phrase. Set mode: phrase. Inspect the matching documents. Run the request First index the sample text. Use the same table and field in the search request; storing a row alone does not create its search entry. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" \ --data-urlencode "q=noise cancellation" \ --data-urlencode "mode=phrase" Check the result The result contains IDs whose analyzed words contain the phrase. ["p001"] Same shape as boolean: a bare array of doc_id strings, no wrapper, no scores. Phrase mode just narrows which docs qualify. Understand the behavior The query is tokenised the same way as the indexed text. The engine pulls posting lists for each token along with token positions inside each document. A doc matches only if the positions are consecutive: position(ti+1) = position(ti) + 1 for every adjacent token pair. Important limits and checks Expecting stemming to bridge word forms. The API analyzer is Unicode-tokenize + lowercase only - it does not stem. q=noise cancel will not match a doc that says "noise cancellation"; the literal token cancellation must be present. Punctuation between tokens. Most analysers strip punctuation - "noise, cancellation" in the source text still phrase-matches q=noise cancellation. Expecting fuzzy behaviour. Phrase is strict - one typo and the phrase doesn't match. Use BM25 with fuzzy=1 if you need typo tolerance. Continue Continue to rank text matches. Combine matches from several fields Previous Page Offer query suggestions Next Page --- ## Offer query suggestions | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/fts/suggest Fts Offer query suggestions ← FTS examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Suggest words or phrases from an indexed field. The native endpoint supports prefix completion, spelling suggestions and phrase rewrites. Before you run it: An empty result is valid; an unindexed field is a different error. The flags below describe partial frequency information. First index the sample description. It contains headphones, so prefix head has a word to complete. Suggestions come from that indexed vocabulary; the endpoint does not invent words from an external dictionary. Suggest words already known to the indexSuggestions come from this field's vocabulary, not an external dictionary. 01 Index the vocabularyLoad words such as headphones in the selected field. 02 Enter a prefixSend head with the documented suggestion settings. 03 Read candidate wordsUse the returned suggestions; an empty list can be valid. Follow the example Index the vocabulary to suggest from. Choose completion, term or phrase. Set bounded candidate and result counts. Read suggestions and truncation flags. Run the request Autocomplete against an indexed field. Like _aggs and _search, _suggest hangs off the schema and takes the field in the body. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/_suggest" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "kind": "completion", "field": "description", "prefix": "head", "size": 5 }' Check the result The result includes suggestions and available frequency information. { "kind": "completion", "prefix": "head", "completions": [ { "text": "headphones", "df": 3, "total_tf": 4, "score": 3.0 }, { "text": "headset", "df": 1, "total_tf": 1, "score": 1.0 } ], "source": "segmented", "frequency_ranked": true, "df_exact": true, "scanned": 2 } The response echoes the kind it was asked for, so all three fit one client type. df is the number of documents containing the term and score is that same count as a float - the library scores a completion by its document frequency rather than inventing a formula. Try another suggestion type Same URL, same auth, different kind. A term suggestion reports the typed word, its own document frequency, and the candidates within the edit budget: { "kind": "term", "field": "description", "text": "headphnes", "max_edits": 1 } { "kind": "term", "entries": [ { "text": "headphnes", "df": 0, "options": [ { "text": "headphones", "distance": 1, "df": 3, "score": 0.82 } ], "candidates_truncated": false } ], "source": "segmented", "frequency_ranked": true, "df_exact": true } A phrase suggestion corrects every term at once and ranks the whole rewrite, so it can prefer a candidate that is a worse individual match but a far better neighbour: { "kind": "phrase", "field": "description", "text": "wireles headphnes", "max_edits": 1 } { "kind": "phrase", "input": ["wireles", "headphnes"], "input_score": 0.0, "options": [ { "text": "wireless headphones", "terms": ["wireless", "headphones"], "score": 0.61, "term_score": 0.74, "cooccurrence_score": 0.48, "corrected_terms": 2 } ], "source": "segmented", "cooccurrence_available": true, "df_exact": true, "cooccurrence_probes": 4 } Understand the behavior The prefix is analyzed, and the last token wins. "noise cance" completes cance, not the whole string. The analyzed prefix is echoed back so you can see what was actually used. Defaults. size 5, max_edits 2, mode missing, min_word_length 4; phrase adds candidates_per_term 4 and confidence 1.0. Ordering is stable. Completions sort by document frequency, then total term frequency, then the term itself - the trailing lexicographic key means equal-frequency completions come back in the same sequence every run. "order": "lexicographic" turns ranking off when you do your own. Every response carries honesty flags. source says whether frequencies came from the segmented dictionary or a legacy presence set; frequency_ranked says whether the list is ranked at all; df_exact is true only when no segment holds deletions; candidates_truncated warns that a fuzzy expansion was cut before the right answer could be considered. Caps refuse rather than clamp. A size above MAX_SUGGEST_SIZE (100) or a max_scan above MAX_PREFIX_SCAN (100,000) is a 400 - a clamped scan would return a top-k computed over an arbitrary slice of the dictionary. Important limits and checks Expecting a correction for a correctly-spelled word. The default mode is missing: a term already in the dictionary is not second-guessed, so a known word may have no suggested correction. Use popular or always if you want otherwise. Treating an empty list as an error. A prefix nothing starts with is 200 with "completions": []. The field is indexed, so "no completions" is a true answer - only an unindexed field is a 404. Trusting df as a live count. It counts postings, including postings whose document has since been deleted, so it is an upper bound. df_exact tells you when that gap is closed; re-check with a real query if it matters. Ignoring frequency_ranked. When it is false the list is alphabetical rather than best-first, and showing the first entry as "did you mean" is then arbitrary. Sorting term options by score yourself. The list already arrives best-first - nearest edit distance, then frequency. Re-sorting on a blended score usually just reproduces it. Continue Continue to control equivalent and ignored words. Find words in order Previous Page Control equivalent and ignored words Next Page --- ## Control equivalent and ignored words | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/fts/synonyms-stopwords Fts Control equivalent and ignored words ← FTS examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Synonyms represent equivalent words. Stopwords are omitted by the analyzer. Configure both for the field that needs them. Before you run it: A configuration change does not rewrite old postings. An empty stopword list disables stopwords rather than preserving the old list. Start with a test field and a few documents containing the terms you will compare. A synonym map groups words such as tv and television; a stopword list chooses words to discard. Test both old and newly indexed documents after a change, because stored postings are not rewritten automatically. Apply text rules and check old documentsChanging field settings does not rewrite text that was indexed earlier. 01 Define the complete settingsSupply the intended synonym groups and stopword list. 02 Apply them to the fieldThe new configuration replaces those field settings. 03 Reindex when neededRebuild old postings affected by the text-rule change. 04 Compare old and new matchesCheck examples such as tv and television. Follow the example Review the current configuration. Write a complete synonym map or stopword list. Test searches using the changed words. Reindex existing documents when analysis changes require it. Set equivalent words The body maps each canonical term to the words that should mean the same thing. Send the complete desired map every time - there is no merge. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description/synonyms" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "synonyms": { "television": ["tv", "telly"], "headphones": ["headset", "cans"] } }' Check the result The new configuration replaces the old one; it is not appended. 201 Created with an empty body. Both installers answer the same way; a malformed map is a 400. Nothing needs restarting - the records are read per request, so the next query already sees them: curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" \ --data-urlencode "q=tv" \ --data-urlencode "mode=bm25" That search now ranks documents containing television as well as those containing tv, and the reverse query does the same. Set ignored words The array is the complete stopword list for the field. When set, it is used instead of the built-in list for the analyzer language. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description/stopwords" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "stopwords": ["the", "a", "with", "for"] }' An empty array is not a no-op - it is how you turn stopword removal off for the field entirely: curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description/stopwords" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "stopwords": [] }' Understand the behavior Synonyms work from both ends. At index time every occurrence of a canonical term also writes postings under each of its synonyms. At query time a term that appears as either a canonical or a synonym expands to the whole class. That is what makes tv and television symmetric without writing the index twice. Expansion is capped at 32 synonyms per class to bound query-time work - a term mapping to a thousand others would otherwise issue a thousand posting-list scans. Stopwords apply on the analyzer-aware path. They are consulted when a document is indexed with an analyzer block, and by the query nodes that carry an analyzer, so that both sides tokenize the same way. An index write with no analyzer uses the default tokenizer and the override does not enter into it. Both are configuration, not content. They silently change what every later query on the field matches and how it scores, for every reader, without touching a single document - so they are charged as a schema-level change rather than a row write, and need the corresponding privilege. Configuration is read on subsequent applicable requests without restarting. Reindex existing documents when their stored tokens must change. Important limits and checks Treating either call as an append. Both calls replace the stored configuration. Include every entry you want to keep, and store the complete map in version control. Expecting an empty stopword array to be ignored. It means "no stopwords for this field", not "leave things as they were" - which is exactly how you disable the built-in list, and exactly how you erase a list you meant to keep. Expecting a stopword change to rewrite existing postings. It governs analysis from the next write onward. Documents already indexed keep the postings they were given; reindex them if you need the old ones gone. Installing on the wrong field. Both records are keyed by (schema, field). A map installed on title does nothing at all for a query against description. Writing a class longer than the cap. Only the first 32 members of a class are retained. Check generated maps before submitting them. Continue Continue to make text searchable. Offer query suggestions Previous Page Graph examples Next Page --- ## Graph examples | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph Graph Graph examples ← All examples Declare a relationship in the schema before using these requests. Start with direct neighbors, then choose a bounded traversal, path calculation or whole-graph analysis. Several algorithms require a table that relates to itself. Choose a graph question from real relationshipsEach recipe names its own order, social or cycle sample; load the appropriate one. 01 Declare the relationDefine how one record links to another. 02 Load the named sampleUse the records required by the chosen recipe. 03 Ask a graph questionInspect direct links, paths, groups or relative scores. 04 Read the result shapeCheck IDs, direction and traversal limits before using the result. Follow and analyze connections Find directly linked records — Read records one relationship away. Find records that link to a target — Follow a relationship backwards to find rows that point to a selected record. Explore nearby connections — Breadth-first search visits nearby records before more distant ones. Check whether records are connected — Check for a directed path between two records within a chosen number of hops. Find the lowest path cost — Dijkstra’s algorithm finds the total cost of the cheapest route. List routes without repeated nodes — Find routes between two records without repeating a node inside each route. Rank a chosen set of linked records — PageRank estimates importance from incoming links. Find connected groups of three — Find triples where every pair is linked. Separate disconnected groups — Find groups connected within themselves but disconnected from each other. Find closely connected communities — Louvain groups records with more links inside their group than between groups. Group records using their neighbors — Label propagation repeatedly lets nearby nodes adopt a common label. Find records that connect groups — Betweenness measures how often a node lies on shortest paths between other nodes. Find influential neighbors — Eigenvector centrality scores a node higher when it connects to other high-scoring nodes. Find the best few routes — Return up to k routes ordered by cost when an application needs alternatives rather than one distance. Sample a route through the graph — A random walk chooses one neighbor at each step. Find nodes with similar graph roles — Node2Vec learns embeddings from graph walks. Combine links with row features — GraphSAGE learns embeddings from relationships and numeric row features. Prepare the social graph The community and graph-learning recipes use social.users, a relation named follows, and IDs such as alice and erin. This is different from the following relation used in the profile-writing example. Use a disposable test database: do not replace an existing social.users definition. Run this Bash setup once using your tenant-scoped connection. It creates five people and their links. The four numbers in feat are deliberately small sample features for the GraphSAGE recipe, not real user attributes. Create and load the five sample people curl --fail-with-body -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/schemas" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: text/plain" \ --data-binary @- <<'TOML' namespace = "social" table = "users" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "follows" ty = "list" [[columns]] name = "feat" ty = "list" [[relations]] name = "follows" from_col = "follows" bidirectional = true target = { namespace = "social", table = "users", pk = "id" } TOML curl --fail-with-body -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/social.users/_batch" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '[ {"id":"alice","follows":["bob","carol"],"feat":[1.0,0.0,0.5,0.2]}, {"id":"bob","follows":["carol","dave"],"feat":[0.9,0.1,0.4,0.2]}, {"id":"carol","follows":["alice","dave"],"feat":[0.8,0.2,0.6,0.1]}, {"id":"dave","follows":["erin"],"feat":[0.1,0.9,0.2,0.8]}, {"id":"erin","follows":[],"feat":[0.0,1.0,0.1,0.9]} ]' Alice can reach Erin through Bob or Carol, then Dave. Erin has no outgoing links. This small graph helps check direction, endpoints and response shape; it is not a meaningful benchmark or a dataset for judging a trained model's quality. Scores in individual recipes illustrate their format and need not match this sample dataset. Prepare orders linked to products The neighbor, reverse, BFS and path recipes use order o001, product p001, and the relation bought_product. Create this separate sample dataset in a test database. It uses o001 without an underscore; the SQL examples use different IDs. Create one product and the order that points to it curl --fail-with-body -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/schemas" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: text/plain" \ --data-binary @- <<'TOML' namespace = "shop" table = "products" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true TOML curl --fail-with-body -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/schemas" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: text/plain" \ --data-binary @- <<'TOML' namespace = "shop" table = "orders" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "product_id" ty = "str" [[relations]] name = "bought_product" from_col = "product_id" bidirectional = true target = { namespace = "shop", table = "products", pk = "id" } TOML curl --fail-with-body -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.products" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '{"id":"p001"}' curl --fail-with-body -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.orders" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '{"id":"o001","product_id":"p001"}' The forward lookup starts at o001 and returns p001. The reverse lookup starts at p001 and returns o001. Larger response examples on the recipe pages require more rows and links. Before adapting a recipe Use a test database, load the named sample data, and check the expected result. Read each page’s limits before changing the query. See connection and SDK notes. Control equivalent and ignored words Previous Page List routes without repeated nodes Next Page --- ## List routes without repeated nodes | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/all-simple-paths Graph List routes without repeated nodes ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Find routes between two records without repeating a node inside each route. These are called simple paths. Before you run it: Dense graphs can contain many routes. Keep both bounds deliberate. For the quickstart cycle, u1 → u2 → u3 is a route from u1 to u3. Continuing around the cycle would repeat u1, so it is not a simple path. Read the pks list in order; each list is one route, not a set of alternatives. List paths without repeating a nodeBound both the maximum path length and the number of returned paths. 01 Choose u1 and u3Set the source and destination keys. 02 Follow links without cyclesDo not revisit a node within the same path. 03 Inspect the ordered keysEach returned list describes one bounded route. Follow the example Prepare the self-referencing relationship. Set source and destination keys. Bound max_depth and max_paths. Inspect the returned sequences. Set up the relationship First complete the graph quickstart to create graph_demo.people and the u1 → u2 → u3 → u1 cycle. The follows relation is declared in the schema's [[relations]] block. See schemas/reference#relations. Run the request curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/graph_demo.people/all_simple_paths" \ --data-urlencode "rel=follows" \ --data-urlencode "src=u1" \ --data-urlencode "dst=u3" \ --data-urlencode "max_depth=3" \ -H "Authorization: Bearer $OC_TOKEN" Check the result Each path includes its starting and ending records. [{"pks": ["u1", "u2", "u3"]}] An array of { pks: [...] } objects, one per discovered path. pks includes both endpoints, in walk order. Understand the behavior Bounded DFS from src, tracking the path stack to enforce the "no repeated node" rule. Stops descending past max_depth and stops emitting past max_paths. The number of simple paths can grow combinatorially with depth - that's why both caps exist. Important limits and checks Not capping max_depth. The path count is exponential in depth. Even 4-5 hops on a moderately dense graph can hit the max_paths cap immediately. Using this when you only need one. If you just want the shortest, use dijkstra. If you just want yes/no, use path. Continue Continue to find the best few routes. Graph examples Previous Page Find records that connect groups Next Page --- ## Find records that connect groups | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/betweenness Graph Find records that connect groups ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Betweenness measures how often a node lies on shortest paths between other nodes. High values can reveal bridges in a network. Before you run it: If the work budget is exceeded, use the suggested sample count or reduce the graph rather than retrying the same exact request. First load the five-person social graph. It creates the exact social.users table and follows relation used below. A bridge connects parts of a network that would otherwise need a longer route. The score is a structural clue, not proof that the person or account is suspicious. Find records that connect shortest routesSampled results are estimates; a high score alone does not prove suspicious activity. 01 Load the linked recordsChoose the self-relation to analyze. 02 Inspect shortest routesUse the configured exact or sampled analysis. 03 Score the connecting nodesCount how often records bridge those routes. 04 Check the analysis metadataRead estimated and pivot details before interpreting scores. Follow the example Prepare a self-referencing relationship. Choose exact calculation or explicit sampling. Run within node and work limits. Inspect high-scoring nodes and their links. Set up the relationship The relation must be declared in the schema's [[relations]] block and must target the table it is declared on. See schemas/reference#relations. Run the request rel is required. max_nodes defaults to the 100,000-node ceiling. Exact calculation is the default; samples=K explicitly chooses an estimate using K pivot nodes. seed controls which pivots are selected. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/social.users/betweenness" \ --data-urlencode "rel=follows" \ -H "Authorization: Bearer $OC_TOKEN" Check the result Sampled results include estimated status and pivot information alongside scores. [ { "pk": ["dave"], "betweenness": 8.0 }, { "pk": ["carol"], "betweenness": 5.0 }, { "pk": ["bob"], "betweenness": 1.0 }, { "pk": ["alice"], "betweenness": 0.0 }, { "pk": ["mallory"], "betweenness": 0.0 } ] [ { "pk": ["dave"], "betweenness": 7.6, "estimated": true, "pivots": 500 }, { "pk": ["carol"], "betweenness": 4.8, "estimated": true, "pivots": 500 } ] One row per node, sorted by score descending, with pk as the primary-key array. In exact mode - the first body above - each row has exactly two fields: there is no estimated and no pivots key at all, so a parser written against the exact shape keeps working. Add samples=K and you get the second body: every row is tagged estimated: true with the pivot count, which is what lets a consumer holding only the response tell that it is looking at an approximation. Understand the behavior Brandes' algorithm runs a single-source shortest-path pass from every node and accumulates dependency scores on the way back. Cost grows with nodes times edges, so this endpoint refuses on predicted work, not on node count. The refusal is a tagged graph_work_budget_exceeded 400 that quotes the node and edge counts, the predicted seconds, and the samples= value that would fit - it tells you what to do instead of timing out. Sampled mode runs the same pass from K randomly chosen pivots instead of from every node, which is what makes a large graph fit inside a request. seed fixes pivot selection and has a fixed default, so a sampled result is reproducible even when you do not pass one. Sampling only helps where the graph has a distinguishable head. Take the ratio of the top score to the median over the rows you get back: where that ratio is large the sampled ranking tracks the exact one closely, and where it is close to one every node has nearly the same betweenness and no ranking of that graph means much - including the exact one. Important limits and checks Assuming a hub scores highly. Degree and betweenness answer different questions. A node with many neighbours who all know each other is a poor bridge and scores near zero. Retrying a work-budget 400. It is not a transient failure. The engine is telling you the exact call is too big and naming the samples= value that fits - change the request, do not repeat it. Comparing a sampled score against an exact one. Estimated scores are only approximately on the same scale. Compare rankings rather than values, and check the estimated flag before you do either. Passing max_nodes=0 or samples=0. Both are refused with a 400. An empty universe and a zero-pivot estimate are not meaningful requests. Continue Continue to rank a chosen set of linked records. List routes without repeated nodes Previous Page Explore nearby connections Next Page --- ## Explore nearby connections | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/bfs Graph Explore nearby connections ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Breadth-first search visits nearby records before more distant ones. A hop is one relationship edge. Before you run it: This traversal counts hops; it does not use edge weights. First load the order-to-product sample dataset. It creates shop.orders.bought_product with the exact IDs used below. With this one-link sample dataset, product p001 is one hop from order o001. More distant results need more linked rows; increasing max_depth does not create those links. Explore links one hop at a timeThe depth limit bounds the search; the starting record is not a returned neighbor. 01 Start with o001Treat the order as depth zero. 02 Expand its relationFollow bought_product up to the requested depth. 03 Read p001 at depth oneUse hop counts to see how far each match is. Follow the example Prepare the relationship and rows. Choose a starting key. Set max_depth in hops. Read each returned key and depth. Set up the relationship The relation must be declared in the schema's [[relations]] block. See schemas/reference#relations. Run the request curl "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/shop.orders/bfs?rel=bought_product&pk=o001&max_depth=3" \ -H "Authorization: Bearer $OC_TOKEN" Check the result Each reachable node has its shortest hop distance. The start node is excluded. [ { "pk": "p001", "depth": 1 }, { "pk": "p014", "depth": 1 }, { "pk": "u091", "depth": 2 }, { "pk": "u117", "depth": 2 }, { "pk": "c003", "depth": 3 } ] An array of { pk, depth } objects. Depth is the shortest hop-count from the source; the source itself isn't in the result. Understand the behavior The engine maintains a visited set and a frontier queue, expanding one depth at a time. Each ring is built by a batched adjacency lookup against the previous frontier - one point-read per node, no scans. Traversal stops when the frontier is empty or depth reaches max_depth. Important limits and checks Forgetting max_depth. On dense graphs, a missing or very large depth can return millions of nodes. Set a real bound - 2 or 3 is usually enough. Treating depth as cost. bfs counts hops, not weights. If your edges have meaningful weights, use dijkstra. Continue Continue to check whether records are connected. Find records that connect groups Previous Page Separate disconnected groups Next Page --- ## Separate disconnected groups | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/components Graph Separate disconnected groups ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Find groups connected within themselves but disconnected from each other. Before you run it: Treat _component as an opaque string key, not a nested JSON object. First load the five-person social graph. It creates the exact social.users table and follows relation used below. This asks which records can be connected when link direction is ignored. It is different from finding smaller communities inside one connected group. Separate a graph into connected groupsLinks are treated as undirected; isolated records still belong to a group. 01 Read the self-relationStart with the table's records and their links. 02 Follow connected neighborsCollect records that can reach each other without considering direction. 03 Group matching labelsRecords with the same component value belong together. Follow the example Prepare the self-referencing relationship. Run components for the whole table. Group results by their component value. Check isolated records too. Set up the relationship The relation must be declared in the schema's [[relations]] block and must target the table it is declared on. See schemas/reference#relations. Run the request rel names the relation. The optional include_rows=true switch also echoes each row's full body alongside its component id; leave it off unless you need the columns, because the default response carries only what the algorithm actually computed. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/social.users/components" \ --data-urlencode "rel=follows" \ -H "Authorization: Bearer $OC_TOKEN" Check the result Every row belongs to a component, including rows without links. [ { "pk": ["alice"], "_component": "[\"alice\"]" }, { "pk": ["bob"], "_component": "[\"alice\"]" }, { "pk": ["carol"], "_component": "[\"alice\"]" }, { "pk": ["heidi"], "_component": "[\"heidi\"]" }, { "pk": ["ivan"], "_component": "[\"heidi\"]" }, { "pk": ["judy"], "_component": "[\"heidi\"]" }, { "pk": ["mallory"], "_component": "[\"mallory\"]" } ] One entry per node. pk is the node's primary-key array. _component is the canonical JSON encoding of the component root's primary key, which makes it a string containing a JSON array, not an array. Treat it as an opaque grouping key: nodes that share it are in the same island. With include_rows=true each entry additionally carries the row's own columns, next to the same _component field. Understand the behavior Union-find over the schema's whole node universe, with every rel edge treated as undirected. Each row is emitted exactly once whether or not it has edges, so the number of distinct _component values is the number of islands. The compact {pk, _component} shape is the default because the algorithm's entire answer is one id per node. Echoing row bodies made the response grow with row width without adding information. include_rows=true restores the earlier verbatim-row shape for callers that depended on it. The partitioning is identical either way - only the payload changes. Important limits and checks Treating _component as a key you can look up. It is a canonical-JSON string, not a bare primary key and not an integer. Group on it; do not try to resolve it back to a row. Reaching for include_rows=true by habit. It multiplies the response by your row width. Get the partition first, then fetch only the rows you actually want by primary key. Expecting isolated rows to be absent. A row with no edges is a component of one and is present in the response. Continue Continue to find closely connected communities. Explore nearby connections Previous Page Find the lowest path cost Next Page --- ## Find the lowest path cost | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/dijkstra Graph Find the lowest path cost ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Dijkstra’s algorithm finds the total cost of the cheapest route. This endpoint returns the cost, not the route’s sequence of records. Before you run it: Unspecified edges cost 1. Use a path-returning endpoint when the application needs the route itself. The weights below assign cost 1 to u1 → u2 and cost 2 to u2 → u3. That route costs 3 in total. A weight is an application-defined cost such as distance or delay; it is not the number of records returned. Find the lowest total path costWeights must be non-negative; this example returns a cost, not the route itself. 01 Start at u1Choose u3 as the destination. 02 Add edge weightsThe sample path costs one plus two. 03 Read the minimum costCheck that the expected result is three. Follow the example Prepare the relationship and endpoints. Assign nonnegative weights with the documented keys. URL-encode weights_json in the URL. Read the returned cost. Set up the relationship Complete the graph quickstart first. This example uses graph_demo.people and its follows relation. The relation must be declared in the schema's [[relations]] block. See schemas/reference#relations. Run the request weights_json is a URL-encoded JSON object keyed by "src|dst" with a numeric weight. An empty {} means "every edge weighs 1" and Dijkstra degenerates to shortest hop-count. WEIGHTS='{"u1|u2":1.0,"u2|u3":2.0}' curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/graph_demo.people/dijkstra" \ --data-urlencode "rel=follows" \ --data-urlencode "src=u1" \ --data-urlencode "dst=u3" \ --data-urlencode "weights_json=$WEIGHTS" \ -H "Authorization: Bearer $OC_TOKEN" Check the result A reachable target returns a cost; an unreachable one returns null. { "cost": 3.0 } One field: cost: number | null. null means no path exists. The endpoint returns the cost only - if you need the path itself, use all_simple_paths. Understand the behavior Classic Dijkstra over a min-heap, expanding the cheapest frontier node. Edges missing from weights_json fall back to a weight of 1. For the top-K cheapest paths instead of a single shortest, use the k-shortest endpoint - loop-free paths in increasing weight. Important limits and checks Negative weights. Dijkstra assumes non-negative edges. Negative weights produce undefined results - reformulate as a positive cost, or pick a different algorithm. Forgetting to URL-encode weights_json. The JSON contains {}, quotes, and the | separator - use --data-urlencode or your SDK's helper rather than concatenating into the URL. Continue Continue to find the best few routes. Separate disconnected groups Previous Page Find influential neighbors Next Page --- ## Find influential neighbors | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/eigenvector-centrality Graph Find influential neighbors ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Eigenvector centrality scores a node higher when it connects to other high-scoring nodes. It runs over the self-referencing relationship’s table. Before you run it: This scale differs from PageRank. The endpoint does not accept a custom node universe. First load the five-person social graph. It creates the exact social.users table and follows relation used below. An iteration is one repeated score update. Tolerance is the amount of change small enough to stop. Read the ranking within this graph; the score is not a probability. Score a node through its connected neighborsThis is a relative graph score, not a probability or the PageRank node-set query. 01 Load the self-relationUse the table's records and links. 02 Repeat neighbor score updatesStop at the tolerance or iteration limit. 03 Compare the resulting scoresInspect which nodes connect to other strongly scored nodes. Follow the example Prepare the relationship. Set iteration and tolerance limits. Run the calculation. Compare scores within the result. Set up the relationship The relation must be declared in the schema's [[relations]] block and must target the table it is declared on. See schemas/reference#relations. Run the request rel is required. max_iter (default 50) bounds the power iteration and tol (default 1e-6) is the convergence threshold. max_iter=0 is refused with a 400. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/social.users/eigenvector_centrality" \ --data-urlencode "rel=follows" \ --data-urlencode "max_iter=50" \ --data-urlencode "tol=1e-6" \ -H "Authorization: Bearer $OC_TOKEN" Check the result Each result includes its primary key and eigenvector score. [ { "pk": ["dave"], "eigenvector": 0.51 }, { "pk": ["carol"], "eigenvector": 0.44 }, { "pk": ["bob"], "eigenvector": 0.36 }, { "pk": ["alice"], "eigenvector": 0.29 }, { "pk": ["mallory"], "eigenvector": 0.0 } ] One row per node, sorted by score descending. pk is the primary-key array and the score field is named eigenvector. The score field name differs on every centrality endpoint - betweenness returns betweenness and pagerank returns score - so a shared parser has to know which endpoint produced the body it is holding. Understand the behavior Power iteration: start from a uniform vector, multiply repeatedly by the adjacency matrix, renormalise, and stop when the change falls below tol or after max_iter rounds. The iteration runs on the adjacency matrix plus the identity rather than the adjacency matrix alone. That shift is what stops a bipartite graph oscillating between two states and never converging. Scores are relative, not absolute. Only the ordering and the ratios between scores carry meaning. No node universe is required, which is the practical difference from pagerank: pagerank makes you name the subgraph up front, this endpoint scores the table as it stands. Important limits and checks Expecting pagerank's numbers. Eigenvector centrality has no damping factor and no random-restart term, so it concentrates far more weight on the densest region of the graph. The two rankings will differ and neither is wrong. Reading a zero as a bug. A node with no inbound edges receives no weight. Isolated rows legitimately score zero. Reusing a betweenness parser. The score field is called eigenvector here, and reading row.betweenness gives you nothing. Continue Continue to rank a chosen set of linked records. Find the lowest path cost Previous Page Combine links with row features Next Page --- ## Combine links with row features | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/graphsage Graph Combine links with row features ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. GraphSAGE learns embeddings from relationships and numeric row features. Each row needs a feature array of the declared length. Before you run it: max_pool and lstm are preview paths whose HTTP training does not train their weights. Missing or wrongly sized features fail validation. First load the five-person social graph. It creates the exact social.users table and follows relation used below. Use the sample dataset's feat array and feature_dim: 4. Features are numeric measurements you choose; all rows must use the same meaning and order for each position. The tiny sample dataset checks the training-to-query flow, not prediction quality. Combine node features with neighborhood structureUse the documented mean aggregator and consistent feature order for this example. 01 Load links and four featuresEvery node needs its numeric features in the same order. 02 Train with neighboring featuresThe mean aggregator incorporates nearby nodes. 03 Persist the embeddingsSave the learned vectors for later queries. 04 Query similar nodesInspect the returned node IDs before using the matches. Follow the example Prepare complete features and the relationship. Choose mean for the fully trained aggregator path. Train with persist: true. Query a node and inspect its matches. Set up the relationship Beyond the [[relations]] block, GraphSAGE needs a per-row feature vector: a column holding an array of numbers, the same width on every row. It can be a declared column or an undeclared JSON array field on the row. The width you pass as feature_dim must match that column exactly - a mismatch is a 400, never a silent pad or truncate. See schemas/reference#relations. Train and save the embeddings rel and feature_col are required. feature_dim must match the array width. num_layers is capped at 4 and neighbor_sample_size at 50. The default mean aggregator is fully trained. max_pool and lstm remain preview paths: HTTP training learns the node embeddings but leaves their aggregator weights at their initial values. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/social.users/graphsage" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "rel": "follows", "feature_col": "feat", "feature_dim": 4, "embedding_dim": 64, "hidden_dim": 64, "num_layers": 2, "neighbor_sample_size": 10, "aggregator": "mean", "epochs": 5, "seed": 42, "persist": true }' Check training results { "embeddings": { "alice": [0.0311, -0.0142, 0.0207], "bob": [0.0288, -0.0166, 0.0193] }, "vocab_size": 11, "training_pairs": 3960, "final_loss": 0.5842, "embedding_dim": 64, "feature_dim": 4, "persisted": true } The same envelope node2vec returns, with two differences: the width field is called embedding_dim rather than dim, and feature_dim echoes the input width back so you can confirm the engine read the column you meant. Vectors are shortened above - each one is embedding_dim floats long. Find similar nodes Identical grammar to the node2vec query: the relation is a path segment, query names the node and k the number of neighbours, and metric accepts cosine, dot, l2 or manhattan, defaulting to cosine. The two persisted sets are stored separately, so a relation can carry both a node2vec and a GraphSAGE index at once. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/social.users/graphsage/follows/topk" \ --data-urlencode "query=alice" \ --data-urlencode "k=5" \ --data-urlencode "metric=cosine" \ -H "Authorization: Bearer $OC_TOKEN" Read the matched nodes [ { "pk": "bob", "score": 0.97 }, { "pk": "dave", "score": 0.88 }, { "pk": "carol", "score": 0.81 } ] A flat array of { pk, score }, best first, with the query node excluded from its own results. Until a training call has run with persist: true this route answers 503 with a message pointing at the persistence step - a missing prerequisite rather than a failure. Understand the behavior Each layer samples up to neighbor_sample_size neighbours and averages their representations with the node's own. That averaging is the mean aggregator, and num_layers decides how far out the neighbourhood reaches. Features are read per row from the feature column. Both a declared column and an undeclared JSON array field on the row work. The same seed, graph, features and configuration give byte-identical vectors. persist: true writes one blob per schema and relation, stored alongside but separately from the node2vec blob, so both indexes can exist for the same relation. Response size is capped exactly as node2vec is: vocab_size times embedding_dim above one million floats is a 400. A persisted set that has gone bad can be inspected with a health call on the same path and retrained in place with a rebuild call, which retrains from the rows and edges already in the store. No re-ingest is needed, and only the derived embedding blob is rewritten - no row is touched. Important limits and checks Match feature_dim to the numeric array length. Missing or incorrectly sized features return 400. Choose mean for the fully trained path; max_pool and lstm do not train their own aggregator weights over HTTP. Train with persist: true before querying; otherwise the query route returns 503. Keep num_layers at or below 4 and neighbor_sample_size at or below 50; larger values return 400. Expected result Queries search the persisted embeddings from training. Continue Continue to find nodes with similar graph roles. Find influential neighbors Previous Page Find the best few routes Next Page --- ## Find the best few routes | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/k-shortest Graph Find the best few routes ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Return up to k routes ordered by cost when an application needs alternatives rather than one distance. Before you run it: k is required and cannot exceed 50. Weight and endpoint rules are listed below. First load the five-person social graph. It creates the exact social.users table and follows relation used below. In the sample dataset, Alice reaches Erin through Bob or Carol, then Dave. With no weight column, cost counts links. The response may contain fewer than three routes even though the request asks for three. Compare alternative routes from Alice to ErinIf no weight column is supplied, route cost uses hop count. 01 Choose Alice and ErinSet the source, target and requested number of paths. 02 Compare available routesThe sample alternatives pass through Bob or Carol, then Dave. 03 Read the lowest costs firstInspect up to k routes; fewer can exist. Follow the example Prepare the relationship. Use source and target as the endpoint parameters. Set k and optional weight_col. Read the ordered paths and costs. Set up the relationship The relation must be declared in the schema's [[relations]] block. If you pass weight_col, the relation's target table must also declare that column. See schemas/reference#relations. Run the request This endpoint names its endpoints source and target, not src and dst the way path, dijkstra and all_simple_paths do. k is required and is capped at 50; asking for more is a 400 rather than a silent truncation. By default every edge weighs 1, so the ranking is by hop count - pass weight_col to read each edge's weight from a named column on the destination row instead. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/social.users/k-shortest" \ --data-urlencode "rel=follows" \ --data-urlencode "source=alice" \ --data-urlencode "target=erin" \ --data-urlencode "k=3" \ -H "Authorization: Bearer $OC_TOKEN" Check the result Unreachable targets return an empty list. Returned paths contain their nodes and costs. { "paths": [ { "nodes": ["alice", "carol", "dave", "erin"], "cost": 3.0 }, { "nodes": ["alice", "bob", "carol", "dave", "erin"], "cost": 4.0 } ] } An object with a paths array, one entry per route, ascending by cost. nodes is the walk in order as plain strings, including both endpoints. Fewer than k entries simply means the graph has no more loop-free routes. An unreachable target is a 200 with "paths": [], not a 404, and a source equal to target comes back as a single zero-cost path. Understand the behavior Yen's algorithm finds the shortest path, then repeatedly forces a deviation at each node along it and keeps the cheapest result it has not already emitted. Routes are loop-free by construction: no node repeats inside a single path. With no weight_col every edge weighs 1, so the ranking is by hop count and matches what a breadth-first search would find. With weight_col set, each edge's weight is read from that column on the destination row and coerced to a float. The relation has to exist on the schema for that lookup, and an unknown relation name is a 400. k above 50 is rejected with the ceiling quoted in the message, so callers learn to budget instead of silently receiving a truncated list. Important limits and checks Sending src and dst. They are source and target on this endpoint. The names differ from the other path endpoints, and the wrong name is a rejected request. Treating an empty paths array as an error. Unreachable is a normal 200. Check the array length, not the status code. Expecting cost to mean hops once weight_col is set. With weights coming from a column, cost is the sum of those column values and carries whatever units that column has. Asking for a large k just in case. Above 50 the whole request is refused, so you get nothing rather than the first fifty. Continue Continue to find the lowest path cost. Combine links with row features Previous Page Group records using their neighbors Next Page --- ## Group records using their neighbors | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/label-propagation Graph Group records using their neighbors ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Label propagation repeatedly lets nearby nodes adopt a common label. It finds communities without a preset group count. Before you run it: The iteration cap does not guarantee convergence. Use a seed when comparing repeat runs. First load the five-person social graph. It creates the exact social.users table and follows relation used below. A label is a temporary group identifier. Group records by equal labels; a larger label does not mean a better or larger community. Form groups by sharing neighbor labelsThe seed and iteration limit affect this bounded grouping process. 01 Give each node a labelStart from the loaded self-relation. 02 Update from neighboring labelsNodes adopt the common label among their neighbors. 03 Read the final groupsEqual labels identify a group; their values are not rankings. Follow the example Prepare the self-referencing relationship. Set an iteration limit and explicit seed. Run the request. Group equal labels. Set up the relationship The relation must be declared in the schema's [[relations]] block and must target the table it is declared on. See schemas/reference#relations. Run the request rel is required and max_iter defaults to 20. Set seed explicitly for repeatable runs. If omitted, the engine uses the current Unix timestamp and does not return that chosen seed. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/social.users/label_propagation" \ --data-urlencode "rel=follows" \ --data-urlencode "max_iter=20" \ --data-urlencode "seed=42" \ -H "Authorization: Bearer $OC_TOKEN" Check the result Labels identify groups and need not be contiguous numbers. [ { "pk": ["alice"], "label": 0 }, { "pk": ["bob"], "label": 0 }, { "pk": ["carol"], "label": 0 }, { "pk": ["dave"], "label": 0 }, { "pk": ["heidi"], "label": 7 }, { "pk": ["ivan"], "label": 7 }, { "pk": ["judy"], "label": 7 }, { "pk": ["mallory"], "label": 10 } ] One row per node, ordered by primary key. pk is the primary-key array and label is an unsigned integer. Labels start as one-per-node identifiers and most of them die off during convergence, so the surviving values are not contiguous and carry no ordering - the only thing a label means is equality. Two nodes with the same label are in the same community. Understand the behavior Every node starts with its own label. Each round visits nodes in a shuffled order and moves each node to whichever label most of its neighbours hold. The shuffle is the only thing the seed drives. Ties within a tally are broken deterministically by the smaller label, so the same seed on the same graph gives byte-identical output. The pass repeats until no label changes or max_iter rounds have run. There is no convergence guarantee, which is exactly why the iteration cap exists. Self-loops are ignored - a node never votes for itself by force. max_iter=0 is refused with a 400 rather than returning an unconverged answer. Important limits and checks Omitting seed. The engine falls back to the current unix timestamp and does not tell you which one it used. Two calls a second apart can return different groupings with nothing in the response to explain the difference. Reading labels as group numbers. They are not dense, not ordered and not stable across graphs. Compare them for equality and nothing else. Expecting louvain's answer. Label propagation optimises nothing globally. On a graph without sharp community structure it can collapse most of the nodes into one label, which is a real result and not an error. Cross-check with louvain before trusting a partition. Continue Continue to find closely connected communities. Find the best few routes Previous Page Find closely connected communities Next Page --- ## Find closely connected communities | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/louvain Graph Find closely connected communities ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Louvain groups records with more links inside their group than between groups. One connected component can contain several communities. Before you run it: IDs can change when the graph changes. Do not use them as permanent business identifiers. First load the five-person social graph. It creates the exact social.users table and follows relation used below. A community has relatively many links inside it. Modularity is the score used to compare those groupings; the tolerance controls when further grouping stops. Discover groups with dense internal linksCommunity IDs identify the result groups; they are not ranks or permanent business identifiers. 01 Read the self-relationUse the table's linked records. 02 Improve the groupingLouvain seeks more links within each community. 03 Stop at the configured boundsUse the tolerance and level limits. 04 Read community assignmentsGroup record keys that share a community ID. Follow the example Prepare a self-referencing relationship. Choose calculation limits. Run the community request. Inspect rows grouped by community number. Set up the relationship The relation must be declared in the schema's [[relations]] block and must target the table it is declared on. louvain refuses a relation that points at another table, and the error names both tables. See schemas/reference#relations. Run the request rel is required. tolerance defaults to 1e-4 and stops the calculation when the modularity improvement falls below it. max_levels defaults to 10 and caps the grouping rounds. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/social.users/louvain" \ --data-urlencode "rel=follows" \ --data-urlencode "tolerance=1e-4" \ --data-urlencode "max_levels=10" \ -H "Authorization: Bearer $OC_TOKEN" Check the result Community numbers identify groups, not a ranking. { "communities": [ { "pk": "alice", "community": 0 }, { "pk": "bob", "community": 0 }, { "pk": "carol", "community": 0 }, { "pk": "dave", "community": 0 }, { "pk": "heidi", "community": 1 }, { "pk": "ivan", "community": 1 }, { "pk": "judy", "community": 1 }, { "pk": "mallory", "community": 2 } ] } An object with a single communities array - not a bare array, and not the row shape the other algorithm endpoints use. Here pk is a plain string and community is an integer from 0 through k - 1, where k is the number of detected communities. Ids are assigned in order of first appearance by lexicographic primary key, so the lexicographically smallest key is always in community 0 and a rerun over an unchanged graph produces the same numbering. Understand the behavior Phase one moves each node into whichever neighbouring community gives the largest modularity gain. Phase two collapses each community into a single node and repeats. The loop stops when the modularity delta between levels falls below tolerance, when phase one stops moving nodes, or when max_levels is reached. Community ids are dense and deterministic, so two runs over the same graph are directly comparable and can be stored as-is. The endpoint refuses graphs above its 500,000-node ceiling. The per-level pass is linear in nodes plus edges, and a multi-million-node call will not land inside a request budget. Important limits and checks Reading the response as an array. It is { "communities": [ ... ] }. Indexing the body directly gets you nothing. Expecting pk to be an array here. louvain returns a plain string, while components, betweenness, label_propagation and eigenvector_centrality all return a primary-key array. The response grammar genuinely differs per endpoint - write the parser per endpoint. Comparing community ids across graphs. The numbering comes from this graph's own key order. Ids from a different graph, or from the same graph after new rows land, are not comparable. Continue Continue to group records using their neighbors. Group records using their neighbors Previous Page Find directly linked records Next Page --- ## Find directly linked records | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/neighbors Graph Find directly linked records ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Read records one relationship away. In a graph, rows are nodes and declared relationships are edges. Before you run it: A foreign-key-shaped column alone is not enough: declare the relationship. First load the order-to-product sample dataset. It creates shop.orders.bought_product with the exact IDs used below. With that sample dataset, the source is order o001 and the one target is product p001. The result contains the target key, not the product fields. Find the product linked to an orderA declared relation is required; a similar-looking column name is not enough. 01 Start at order o001Use the order's primary key. 02 Follow bought_productTraverse the declared outgoing relation once. 03 Receive product p001The result identifies the target record. 04 Fetch product fieldsRead the product row when you need its details. Follow the example Declare the relationship. Write the linked sample rows. Pass the source key and relationship name. Read the target keys. Set up the relationship The schema for shop.orders must declare a [[relations]] block with name = "bought_product". See schemas/reference#relations. Without it, the engine returns 404. Run the request curl "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/shop.orders/neighbors?rel=bought_product&pk=o001" \ -H "Authorization: Bearer $OC_TOKEN" Check the result The response lists forward neighbors, without a ranking guarantee. [ "p001", "p014", "p027" ] A flat array of target primary keys. Order is the insertion order of the edges; do not rely on it being sorted. Understand the behavior Adjacency is laid down at write time, keyed by (tenant, relation, source_pk). The read is a single point lookup against that key - no scan, no join. Cost is independent of total table size; it scales only with the fan-out of this one row. Important limits and checks Relation not declared. Adding a foreign-key column isn't enough - the relation must be in the schema's [[relations]] table. Wrong direction. neighbors is forward only. For "who points at this row?", use reverse. Continue Continue to find records that link to a target. Find closely connected communities Previous Page Find nodes with similar graph roles Next Page --- ## Find nodes with similar graph roles | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/node2vec Graph Find nodes with similar graph roles ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Node2Vec learns embeddings from graph walks. It can find records in similar positions in the network. Before you run it: A training response alone is not queryable unless persist is true. Keep the dimension, response-size and walk-budget limits below. First load the five-person social graph. It creates the exact social.users table and follows relation used below. An embedding is a numeric description learned from link patterns. This is different from embedding profile text. Train and save the vectors before calling the second endpoint. Turn graph structure into searchable vectorsTraining must persist the embeddings before the separate similarity query can use them. 01 Load the relationshipsProvide the graph used for the training walks. 02 Train and save embeddingsPersist the vectors learned from the graph structure. 03 Query a node's neighborsSearch the saved embeddings using its node ID. 04 Inspect similar node IDsThe query node itself is excluded from these results. Follow the example Prepare the self-referencing relationship. Train with the shown settings. Set persist: true to make the result queryable. Query a node for similar nodes. Set up the relationship The relation must be declared in the schema's [[relations]] block. node2vec needs no feature columns - it learns from structure alone. See schemas/reference#relations. Train and save the embeddings rel is the only required field; every other knob has a default, so a body of just the relation name is a complete request. Set persist: true to store the vectors under the schema and relation so the topk route becomes available. Without it the call is a pure computation: it trains in memory, returns the vectors and writes nothing. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/social.users/node2vec" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "rel": "follows", "dim": 64, "walks_per_node": 10, "walk_length": 40, "window_size": 5, "epochs": 5, "seed": 42, "persist": true }' Check training results { "embeddings": { "alice": [0.0142, -0.0318, 0.0091], "bob": [-0.0077, 0.0264, -0.0155], "carol": [0.0203, -0.0119, 0.0288] }, "vocab_size": 11, "training_pairs": 4820, "final_loss": 0.6931, "dim": 64, "persisted": true } embeddings maps each node's primary key to its vector, and each vector is dim floats long - they are shortened above to keep the example readable. vocab_size is how many nodes appeared in a walk, training_pairs how many skip-gram pairs were consumed, and final_loss the loss at the end of the last epoch. persisted mirrors the request flag and is true only when the blob was actually written, so you can tell whether the next call will work without probing for it. Find similar nodes The relation name moves into the path here, because that is how the persisted blob is keyed. query is the node you are asking about and k is how many neighbours you want. metric accepts cosine, dot, l2 or manhattan and defaults to cosine. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/social.users/node2vec/follows/topk" \ --data-urlencode "query=alice" \ --data-urlencode "k=5" \ --data-urlencode "metric=cosine" \ -H "Authorization: Bearer $OC_TOKEN" Read the matched nodes [ { "pk": "bob", "score": 0.94 }, { "pk": "carol", "score": 0.91 }, { "pk": "dave", "score": 0.72 } ] A flat array of { pk, score }, best first, with the query node itself excluded. pk is a plain string here, not the primary-key array the algorithm endpoints return. Fewer than k hits means the persisted set is smaller than k; asking for more than the engine's node ceiling truncates the result rather than failing the call. Understand the behavior Training samples biased random walks from every node, then runs skip-gram with negative sampling over the resulting sequences. p and q bias the walks exactly as they do on the random-walk endpoint. The same seed, graph and configuration produce byte-identical vectors, so a retrain is reproducible. persist: true writes one blob per schema and relation, and the next persist replaces it atomically. What is stored is the trained vectors themselves rather than the recipe - replaying training elsewhere would not land on the same numbers. The response is capped at one million floats, which is vocab_size times dim. Above that the call is refused with a 400, because a body that large stops being something a normal gateway will carry. dim above 1024 is refused, and so is a walk budget above ten million, where the budget is walks_per_node multiplied by walk_length. Important limits and checks Forgetting persist: true. Training without it returns the vectors and stores nothing, and the topk route then answers 503 telling you to post with persist first. That 503 is a missing prerequisite, not an outage. Putting the relation in the query string on the topk call. It belongs in the path, as .../node2vec//topk. Misspelling a knob. Unknown request fields are dropped rather than rejected by default, so walk_len instead of walk_length trains at the default and still returns 200. Check the names against the body above. Comparing scores across metrics. A cosine similarity and an l2 distance are not on the same scale. Pick one metric and stay with it. Expected result The query returns similar IDs and scores, excluding the query node. Continue Continue to combine links with row features. Find directly linked records Previous Page Rank a chosen set of linked records Next Page --- ## Rank a chosen set of linked records | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/pagerank Graph Rank a chosen set of linked records ← Graph examples Prepare the self-relation in the graph quickstart. Scores below illustrate the response format; they depend on your graph and selected nodes. The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. PageRank estimates importance from incoming links. The nodes list defines which records take part. Before you run it: Scores from different node sets are not directly comparable. For the unchanged three-node quickstart cycle, all three nodes have the same link pattern, so none should be interpreted as a uniquely influential node. nodes=u1,u2,u3 chooses the records being compared; the score is relative to that set. Measure relative importance within chosen nodesScores depend on the supplied node set and its links. 01 Select u1, u2 and u3Use the sample cycle as the analysis set. 02 Pass weight through linksRepeat the PageRank updates across that set. 03 Compare relative scoresThe symmetric three-node cycle should give equal scores. Follow the example Choose the relationship. Pass the full nodes list to rank. Run the calculation. Read the highest scores first. Set up the relationship The relation must be declared in the schema's [[relations]] block. See schemas/reference#relations. Run the request nodes is a comma-separated list of the primary keys that form the universe. Edges to keys outside the list are dropped; the iteration is scoped to what you pass. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/graph_demo.people/pagerank" \ --data-urlencode "rel=follows" \ --data-urlencode "nodes=u1,u2,u3" \ -H "Authorization: Bearer $OC_TOKEN" Check the result Scores sum to 1 across the supplied set. Links outside it are ignored. [ { "pk": "u1", "score": 0.333333 }, { "pk": "u2", "score": 0.333333 }, { "pk": "u3", "score": 0.333333 } ] An array of { pk, score } entries, already sorted by score descending, so the first entry is the top influencer in the universe you passed. Scores sum to 1 across that node set. Understand the behavior Power-iteration PageRank with damping factor 0.85. The induced subgraph is built once from the nodes list; iteration converges on that subgraph only. Caller-scoped universe is intentional - the engine refuses to rank the entire tenant graph because that's almost never what you want and is unbounded in cost. Important limits and checks Omitting nodes=. The engine 400s because it requires the universe up front. Pick the candidate set first; rank second. Comparing scores across different node sets. Scores are relative to the universe you pass. A pk's score in one subgraph isn't comparable to its score in another. Continue Continue to find influential neighbors. Find nodes with similar graph roles Previous Page Check whether records are connected Next Page --- ## Check whether records are connected | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/path Graph Check whether records are connected ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Check for a directed path between two records within a chosen number of hops. Before you run it: False does not rule out a longer path. Reversing the endpoints can change the answer. First load the order-to-product sample dataset. It creates shop.orders.bought_product with the exact IDs used below. The sample dataset has a forward link from o001 to p001, so that source/target pair is reachable within one hop. The boolean result does not return the route itself. Check whether a target is reachableA false result means no path was found within the requested traversal limit. 01 Choose source and targetSupply both record keys and the relation. 02 Set the maximum depthBound how many directed links can be followed. 03 Read reachable or notThis request checks reachability rather than returning a route. Follow the example Prepare the declared relationship. Choose starting and target keys. Set a maximum depth. Run the reachability request. Set up the relationship The relation must be declared in the schema's [[relations]] block. See schemas/reference#relations. Run the request curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/shop.orders/path" \ --data-urlencode "rel=bought_product" \ --data-urlencode "src=o001" \ --data-urlencode "dst=p001" \ --data-urlencode "max_depth=3" \ -H "Authorization: Bearer $OC_TOKEN" Check the result The response tells you whether a path was found within that bound. { "reachable": true } One field: reachable: true | false. false means "not within max_depth" - it isn't proof there's no path at higher depth. Understand the behavior Same BFS frontier as bfs, but it stops the instant dst appears in any expansion. Worst case (no path) costs the same as a bounded bfs; best case is a single hop. Use this over bfs whenever you only need the boolean - the savings come from not materialising the visited set. Important limits and checks Reading false as "no path". It only means "no path within max_depth". Raise the depth only within a deliberate work limit. Simple-path enumeration is bounded too, so it does not prove unlimited reachability. Swapping src and dst on a one-way relation. path is direction-sensitive. If you need the inverse direction, check that the relation is bidirectional. Continue Continue to find the lowest path cost. Rank a chosen set of linked records Previous Page Sample a route through the graph Next Page --- ## Sample a route through the graph | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/random-walk Graph Sample a route through the graph ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. A random walk chooses one neighbor at each step. It samples local structure without listing all possible routes. Before you run it: The step cap is 1000. Repeatability requires the same seed and unchanged graph. First load the five-person social graph. It creates the exact social.users table and follows relation used below. The sample starts at Alice and can finish early at Erin because Erin has no outgoing links. A repeated node is allowed; this is a sampled walk, not a route that must avoid repeats. Sample a walk through people Alice followsA walk can revisit nodes and may stop early when no outgoing link remains. 01 Start at AliceSet a seed and a maximum number of steps. 02 Choose one link per stepSample from the available outgoing neighbors. 03 Read the visited sequenceThis is one walk, not a list of every possible route. Follow the example Choose a relationship and starting key. Set a step limit and explicit seed. Use p and q of 1 for an unbiased walk. Inspect the visited keys. Set up the relationship The relation must be declared in the schema's [[relations]] block. See schemas/reference#relations. Run the request rel, start, steps and seed are required. steps is capped at 1000. The optional p and q values bias the walk; p=1 and q=1 produce the unbiased behavior. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/social.users/random-walk" \ --data-urlencode "rel=follows" \ --data-urlencode "start=alice" \ --data-urlencode "steps=5" \ --data-urlencode "seed=42" \ -H "Authorization: Bearer $OC_TOKEN" Check the result The walk includes its start, can repeat nodes and stops at a dead end. { "start": "alice", "walk": ["alice", "carol", "dave", "erin", "dave", "erin"] } walk begins with the start node, so its length is at most steps plus one. It can be shorter: the walk stops as soon as it reaches a node with no outbound edges. A dead-end start returns a walk containing only that node, and a node with a self-loop walks in place. Understand the behavior At each hop the walker picks uniformly among the current node's outbound edges on rel, driven by a seeded generator. The same graph, start, step count and seed always produce the same body, so two identical calls are byte-identical on the wire. With p or q present the walk becomes second-order: p controls how likely it is to step straight back where it came from, and q how likely it is to move away from the previous node's neighbourhood. Setting both to 1 reduces to the uniform walk by construction. steps above 1000 is refused with a 400 quoting the cap, and p=0 is refused because a zero return parameter is not a valid bias. Important limits and checks Omitting seed. It is a required parameter, not an optional one, and the request is rejected without it. Assuming the walk has steps plus one entries. It stops early at a dead end. Read the length rather than trusting it. Reading a repeated node as a bug. A walk is not a path. It revisits nodes freely, and a two-cycle will bounce between the same pair. Drawing conclusions from one walk. A single seeded walk is one draw from a distribution. Aggregate many walks across many seeds before you believe a pattern. Continue Continue to find nodes with similar graph roles. Check whether records are connected Previous Page Find records that link to a target Next Page --- ## Find records that link to a target | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/reverse Graph Find records that link to a target ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Follow a relationship backwards to find rows that point to a selected record. Before you run it: Bidirectional lookup is required. A target with many incoming links can produce a large response. First load the order-to-product sample dataset. It creates shop.orders.bought_product with the exact IDs used below. With that sample dataset, pass product key p001 and expect order key o001. This request reverses the declared relation; it does not reverse the spelling of the table names. Find orders that point to a productThe relation must be configured for reverse traversal. 01 Start at product p001Use the target record's primary key. 02 Follow incoming linksRead the reverse side of bought_product. 03 Receive order o001Inspect the source IDs that reference this product. Follow the example Enable reverse traversal in the relationship. Write the linked rows. Pass the target primary key. Read the returned source keys. Set up the relationship The relation must be declared with bidirectional = true - which is the default. If a relation is one-way only, reverse on it returns 400. See schemas/reference#relations. Run the request curl "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/shop.orders/reverse?rel=bought_product&pk=p001" \ -H "Authorization: Bearer $OC_TOKEN" Check the result The result lists incoming rather than outgoing neighbors. [ "o001", "o042", "o118" ] A flat array of source primary keys. Same shape as neighbors, just walking the other direction. Understand the behavior When the relation is bidirectional, the write path lays down a second adjacency entry keyed by the target. reverse is then a point lookup against that inbound entry - identical cost profile to neighbors. The cost is the price of bidirectionality: storage roughly doubles for the edge, but reads stay O(fan-in). Important limits and checks Relation set to bidirectional = false. reverse refuses to run. Re-declare the relation or use forward traversal from the other side. High fan-in nodes. A "popular" product can have hundreds of thousands of inbound edges. Check the response-size limit before fetching the list. Splitting it for display in your application does not reduce the database response size. PageRank answers a different question about influence. Continue Continue to explore nearby connections. Sample a route through the graph Previous Page Find connected groups of three Next Page --- ## Find connected groups of three | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/graph/triangles Graph Find connected groups of three ← Graph examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Find triples where every pair is linked. This can reveal tightly connected parts of a network. Before you run it: The engine work budget can stop a large calculation. There is no custom depth setting on this route. First load the five-person social graph. It creates the exact social.users table and follows relation used below. Alice, Bob and Carol form a triangle when directions are ignored. Check that the three returned keys are arrays, such as ["alice"], rather than assuming they are plain strings. Find three people connected to each otherThis recipe treats the self-relation links as undirected when finding triples. 01 Load the social linksInclude the links between Alice, Bob and Carol. 02 Check every pairKeep triples where each pair is connected. 03 Read each triple onceInspect the canonical ordering of the three record keys. Follow the example Use a relationship from a table to itself. Load records and links. Run the triangle request. Read each returned triple. Set up the relationship The relation must be declared in the schema's [[relations]] block and must target the table it is declared on - triangle enumeration walks one table's own edge set, and a relation pointing at another table is refused. See schemas/reference#relations. Run the request rel is the only parameter this endpoint accepts. There is no depth, no start node and no cap: the answer is every triangle in the relation. curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/social.users/triangles" \ --data-urlencode "rel=follows" \ -H "Authorization: Bearer $OC_TOKEN" Check the result The calculation treats the relationship as undirected and ignores self-links. [ { "a": ["alice"], "b": ["bob"], "c": ["carol"] }, { "a": ["heidi"], "b": ["ivan"], "c": ["judy"] } ] One object per triangle. a, b and c are primary-key arrays, not strings - the array is what a composite primary key needs, so a single-column key arrives as a one-element array. The three keys come back in canonical order, so the same triangle is always reported the same way and you can deduplicate on the triple. Understand the behavior The relation is symmetrised before enumeration, so a triangle is found whether its three edges point around the ring or at each other. Enumeration runs inside the query executor rather than as a standalone library call, so it inherits the same cancellation and result-budget handling as the rest of the read path. A self-loop is not an edge for this purpose and contributes no triangle. On a graph big enough to blow the scan budget the request is refused with a tagged graph_work_budget_exceeded 400 instead of being allowed to exhaust memory. Important limits and checks Expecting direction to matter. The relation is walked as undirected. alice pointing at bob and bob pointing at alice are the same edge here. If direction is the question, triangles is the wrong endpoint. Reading a as a string. Each of a, b and c is an array. For a single-column primary key you want row.a[0]. Pointing rel at another table. The relation has to target the table it is declared on. A cross-table relation is refused rather than quietly returning nothing. Continue Continue to separate disconnected groups. Find records that link to a target Previous Page MySQL wire protocol examples Next Page --- ## MySQL wire protocol examples | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/mysql Mysql MySQL wire protocol examples ← All examples These recipes describe existing MySQL-protocol listeners. MySQL is not offered as a new connection method. The examples do not establish current PostgreSQL database-login write support. Start with the connection and table setup. Keep its connection and model available when running the transaction snippets. These examples use the MySQL protocol as a way to send SQL; they do not start a separate MySQL server. Use an existing MySQL-compatible connectionThese recipes do not create a listener; write access depends on its credential mode. 01 Confirm the existing listenerRead its supported connection and credential requirements. 02 Connect over verified TLSKeep certificate validation enabled. 03 Choose a supported taskUse the documented query, catalog or permitted write recipe. 04 Inspect the resultVerify behavior before adopting it in your application. Existing MySQL listener examples Run SQL on an existing MySQL listener — Connect over TLS and run basic row operations. Commit or roll back writes — Commit related writes together or discard them on an existing writable MySQL listener. Insert or update a primary key match — ON DUPLICATE KEY UPDATE inserts a row or updates its existing primary-key match on the described listener. Read table metadata — Tools read metadata to discover tables and columns. Check the connection first Read the compatibility requirements. Confirm the existing listener, TLS and credential mode before running a write. Current PostgreSQL database logins are read-only; they are not a replacement connection for the write examples on this page. MySQL is a registered trademark of Oracle Corporation and/or its affiliates. OriginChainDB is not affiliated with, endorsed by, or sponsored by Oracle Corporation. OriginChainDB implements a compatible wire protocol so that existing MySQL clients can connect to it; it does not distribute MySQL software. Find connected groups of three Previous Page Run SQL on an existing MySQL listener Next Page --- ## Run SQL on an existing MySQL listener | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/mysql/connect-and-crud Mysql Run SQL on an existing MySQL listener ← MySQL examples Connection requirements This recipe needs an existing listener using shared credentials. A per-user MySQL session is read-only. Database RBAC grants or row-level policies require that per-user model, so the writes below do not apply there. Check credential requirements. Use the HTTP API for authorized writes when this listener is read-only. Current PostgreSQL database logins are also read-only. Connect over TLS and run basic row operations. This recipe describes an existing listener, not the PostgreSQL database-login path. Before you run it: Writes require the documented shared-credential mode. Per-user credentials and current PostgreSQL database logins are read-only. Connect an ORM to the sample orders tableWrites here require an existing shared-credential listener; automatic ORM synchronization is not supported. 01 Create the sample schemaSet up orders through an authorized interface first. 02 Connect mysql2 and SequelizeUse verified TLS and explicit model definitions. 03 Run the CRUD sequenceCreate, read, update and finally delete the test order. 04 Check each operationConfirm the stored state instead of assuming ORM feature parity. Follow the example Confirm listener and credential capabilities. Create the schema before declaring the ORM model. Open the shown TLS connection. Run operations and check the data. Before running the client, create orders in the namespace that this connection uses, with a string id primary key, string customer, integer total_cents and string status. Use an authorized writable interface; a read-only login cannot perform this setup. Table definition for the existing writable listener CREATE TABLE orders ( id TEXT PRIMARY KEY, customer TEXT, total_cents BIGINT, status TEXT ); The JavaScript snippet needs the sequelize and mysql2 packages and the five OC_* connection variables shown in the code. Declaring Order in JavaScript does not create the database table. Run the create/read/update/delete sequence once in a test table: its final step removes o_1. Connect the client import mysql2 from "mysql2"; import { Sequelize, DataTypes } from "sequelize"; const sequelize = new Sequelize(process.env.OC_DB, process.env.OC_DB_USER, process.env.OC_DB_PASSWORD, { host: process.env.OC_MYSQL_HOST, port: 3306, dialect: "mysql", dialectModule: mysql2, dialectOptions: { ssl: { minVersion: "TLSv1.2", rejectUnauthorized: true } }, logging: false, }); // Declared in code, on purpose: the listener answers no SHOW form, so an ORM // cannot discover this table for itself. const Order = sequelize.define( "Order", { id: { type: DataTypes.STRING, primaryKey: true }, customer: DataTypes.STRING, total_cents: DataTypes.INTEGER, status: DataTypes.STRING, }, { tableName: "orders", timestamps: false, freezeTableName: true }, ); await sequelize.authenticate(); await Order.create({ id: "o_1", customer: "c_7", total_cents: 4200, status: "open" }); const open = await Order.findAll({ where: { status: "open" }, order: [["total_cents", "DESC"]], limit: 10, }); await Order.update({ status: "shipped" }, { where: { id: "o_1" } }); await Order.destroy({ where: { id: "o_1" } }); Run the equivalent SQL If you are driving the session from a CLI or a thin driver rather than an ORM, this is what the four statements look like. INSERT INTO orders (id, customer, total_cents, status) VALUES ('o_1', 'c_7', 4200, 'open'); SELECT id, customer, total_cents FROM orders WHERE status = 'open' ORDER BY total_cents DESC LIMIT 10; UPDATE orders SET status = 'shipped' WHERE id = 'o_1'; DELETE FROM orders WHERE id = 'o_1'; Understand the behavior Each statement is parsed in MySQL's dialect, rewritten construct by construct into the engine's, and re-rendered before it runs. Backtick-quoted identifiers and all three LIMIT spellings are handled on the way through. The ORM sends these as prepared statements. Placeholders are bound server-side, so values never reach the parser as text. This writable example applies to the shared-credential listener only. A configuration requiring per-user grants or row policies uses the separate read-only authentication model described above. Important limits and checks Calling sync(). sequelize.sync() introspects with SHOW, which is refused. Create the table with a schema or a CREATE TABLE, and declare it in code. Leaving TLS to the default. A shared-credential listener with no certificate serves in cleartext without complaining. Ask for TLS in the client and require it on the listener - see TLS. An unbounded DELETE. MySQL's DELETE … LIMIT is refused, so bound the statement with WHERE instead of a row cap. MySQL is a registered trademark of Oracle Corporation and/or its affiliates. OriginChainDB is not affiliated with, endorsed by, or sponsored by Oracle Corporation. OriginChainDB implements a compatible wire protocol so that existing MySQL clients can connect to it; it does not distribute MySQL software. Expected result The example demonstrates inserts, filtered reads, updates and deletes on that listener. Continue Continue to commit or roll back writes. MySQL wire protocol examples Previous Page Read table metadata Next Page --- ## Read table metadata | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/mysql/reflection-and-catalog Mysql Read table metadata ← MySQL examples Tools read metadata to discover tables and columns. This page shows supported information_schema queries for an existing listener. Before you run it: SHOW forms are refused. Do not assume ORM schema synchronization or every discovery query is compatible. Metadata means information about the table, not its customer rows. The queries below look for namespace shop and table orders; change those filters to the namespace and table you actually created. An empty catalog result can mean the filter names do not match. Discover table structure through supported catalog viewsUse information_schema; SHOW discovery and automatic schema synchronization are not supported. 01 Name the intended tableFilter for the actual namespace and table. 02 Query catalog viewsRead supported columns, keys and constraint information. 03 Compare the tool's needsCheck which discovery requests the ORM makes. 04 Declare models where neededConfigure explicit fields when automatic discovery is unsupported. Follow the example Connect with the documented permissions. Run the catalog queries. Compare results with your tool’s requirements. Declare models explicitly when automatic discovery is unsupported. Supported catalog queries Five views, served by the same shared catalog the other wire protocols read: tables, columns, table_constraints, key_column_usage, referential_constraints. -- List the tables in a schema. SELECT table_name FROM information_schema.tables WHERE table_schema = 'shop'; -- Describe one table's columns. SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_schema = 'shop' AND table_name = 'orders'; -- Constraints, and the columns they cover. SELECT constraint_name, constraint_type FROM information_schema.table_constraints WHERE table_name = 'orders'; SELECT constraint_name, column_name FROM information_schema.key_column_usage WHERE table_name = 'orders'; Unsupported catalog queries SHOW TABLES; -- refused SHOW DATABASES; -- refused SHOW COLUMNS FROM orders; -- refused SHOW CREATE TABLE orders; -- refused SHOW INDEX FROM orders; -- refused SHOW WARNINGS; -- refused SHOW VARIABLES LIKE 'sql_mode'; -- refused The refusal is deliberate, and it is the safer of the two options. The shared front door carries a compatibility shim for a different protocol that answers any SHOW x with a single fabricated row reading x = 'on'. Left alone, SHOW TABLES would return that row: a confident, wrong answer. Refusing at the dialect boundary turns it into an error you can see. Configure the ORM explicitly // Safe: you tell the ORM the shape, it never asks the database. const Order = sequelize.define( "Order", { id: { type: DataTypes.STRING, primaryKey: true }, customer: DataTypes.STRING, total_cents: DataTypes.INTEGER, status: DataTypes.STRING, }, { tableName: "orders", timestamps: false, freezeTableName: true }, ); // Not safe on this listener - each of these introspects with SHOW: // await sequelize.sync(); // await sequelize.getQueryInterface().describeTable("orders"); // await sequelize.getQueryInterface().showIndex("orders"); // Also not available: associations. Model the join in your query instead of // asking the ORM to follow a relation for you. // Order.belongsTo(Customer); // will not load Check compatibility before adoption This listener suits explicitly declared ORM models and the documented single-table queries. Association loading is not supported. For other operations, check the SQL endpoint. Current PostgreSQL database logins remain read-only; they do not provide universal ORM parity. MySQL is a registered trademark of Oracle Corporation and/or its affiliates. OriginChainDB is not affiliated with, endorsed by, or sponsored by Oracle Corporation. OriginChainDB implements a compatible wire protocol so that existing MySQL clients can connect to it; it does not distribute MySQL software. Expected result Supported views return table, column and constraint information. Continue Continue to run sql on an existing mysql listener. Run SQL on an existing MySQL listener Previous Page Commit or roll back writes Next Page --- ## Commit or roll back writes | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/mysql/transactions Mysql Commit or roll back writes ← MySQL examples Connection requirements This recipe needs an existing listener using shared credentials. A per-user MySQL session is read-only. Database RBAC grants or row-level policies require that per-user model, so the writes below do not apply there. Check credential requirements. Use the HTTP API for authorized writes when this listener is read-only. Current PostgreSQL database logins are also read-only. Commit related writes together or discard them on an existing writable MySQL listener. Before you run it: This does not provide writes through per-user credentials or PostgreSQL database logins. Use one statement per call. First complete the client and orders setup, keeping its sequelize connection and Order model in scope. Run the commit and rollback snippets as separate blocks: each declares a variable named tx. The IDs o_2 and o_3 should be unused in the test table. Keep related ORM writes in one transactionUse an existing writable shared-credential listener and pass the transaction to every call. 01 Open a transactionKeep its transaction object in scope. 02 Attach each writeSend one statement per call with that transaction object. 03 Commit or roll backChoose whether the grouped writes should remain. 04 Check the stored rowsVerify committed rows exist and rolled-back rows are absent. Follow the example Confirm shared-credential write access. Pass the transaction object to every ORM call. Run the commit example. Run rollback and check that its row is absent. Commit the writes const tx = await sequelize.transaction(); try { await Order.create( { id: "o_2", customer: "c_7", total_cents: 900, status: "open" }, { transaction: tx }, ); await Order.update({ status: "paid" }, { where: { id: "o_2" }, transaction: tx }); await tx.commit(); } catch (err) { await tx.rollback(); throw err; } // After the commit the row is there, with status "paid". const saved = await Order.findByPk("o_2"); Roll back the writes const tx = await sequelize.transaction(); await Order.create( { id: "o_3", customer: "c_9", total_cents: 100, status: "open" }, { transaction: tx }, ); await tx.rollback(); // The important half of the test: the row is NOT there afterwards. const gone = await Order.findByPk("o_3"); // null Run the equivalent SQL START TRANSACTION; INSERT INTO orders (id, customer, total_cents, status) VALUES ('o_2', 'c_7', 900, 'open'); UPDATE orders SET status = 'paid' WHERE id = 'o_2'; COMMIT; START TRANSACTION; INSERT INTO orders (id, customer, total_cents, status) VALUES ('o_3', 'c_9', 100, 'open'); ROLLBACK; Understand the behavior Sessions start in autocommit: each statement commits separately. START TRANSACTION groups subsequent statements until COMMIT or ROLLBACK. Disabling autocommit opens transactions implicitly. Enabling it again commits the open transaction. Important limits and checks Forgetting to pass the transaction. A statement issued without { transaction: tx } runs outside the block and will not be rolled back with it. Batching statements to save a round trip. Multi-statement queries are refused. Send one statement at a time. Assuming rollback was tested for you. Assert the row is gone, as above. That assertion is the whole value of the test. MySQL is a registered trademark of Oracle Corporation and/or its affiliates. OriginChainDB is not affiliated with, endorsed by, or sponsored by Oracle Corporation. OriginChainDB implements a compatible wire protocol so that existing MySQL clients can connect to it; it does not distribute MySQL software. Expected result Committed rows remain; rolled-back writes do not appear. Continue Continue to insert or update a primary key match. Read table metadata Previous Page Insert or update a primary key match Next Page --- ## Insert or update a primary key match | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/mysql/upsert-on-duplicate-key Mysql Insert or update a primary key match ← MySQL examples Connection requirements This recipe needs an existing listener using shared credentials. A per-user MySQL session is read-only. Database RBAC grants or row-level policies require that per-user model, so the writes below do not apply there. Check credential requirements. Use the HTTP API for authorized writes when this listener is read-only. Current PostgreSQL database logins are also read-only. ON DUPLICATE KEY UPDATE inserts a row or updates its existing primary-key match on the described listener. Before you run it: Ambiguous secondary-unique-index cases are refused. REPLACE INTO and INSERT IGNORE have different meanings and are not substitutes. Use the same orders table with id as its primary key. The first statement writes o_1. Running it again with a different total_cents or status demonstrates an update; running it twice unchanged only repeats the same values. Insert an order or update its primary-key matchAmbiguous secondary-unique-index cases are refused; this needs the documented writable listener. 01 Prepare the keyed orders tableUse id as the unambiguous primary key. 02 Insert order o_1Run the supported duplicate-key update form. 03 Send a changed valueRepeat for o_1 with a different amount or status. 04 Read the updated fieldsConfirm the existing primary-key row changed. Follow the example Confirm shared-credential write access. Create an unambiguous primary key. Run the upsert twice. Read back the changed fields. Run the upsert INSERT INTO orders (id, customer, total_cents, status) VALUES ('o_1', 'c_7', 4200, 'open') ON DUPLICATE KEY UPDATE total_cents = VALUES(total_cents), status = VALUES(status); How the upsert is translated INSERT INTO orders (id, customer, total_cents, status) VALUES ('o_1', 'c_7', 4200, 'open') ON CONFLICT (id) DO UPDATE SET total_cents = EXCLUDED.total_cents, status = EXCLUDED.status; VALUES(col) becomes EXCLUDED.col - the value the statement tried to insert. Understand the behavior MySQL's syntax leaves the conflict target implicit - "duplicate key" does not say which key. The engine's upsert needs it named, so the translator resolves it from the catalog and writes it in. When that resolution is ambiguous it stops instead of guessing. A table carrying a secondary unique index is refused, because picking the wrong arbiter would silently update on the wrong key - a wrong answer rather than an error. On such a table, write the upsert as an explicit INSERT … ON CONFLICT through the SQL endpoint, where you name the target yourself. Why REPLACE INTO is different mysql> REPLACE INTO orders (id, status) VALUES ('o_1', 'open'); ERROR 1235 (42000): REPLACE INTO is not supported — its delete-then-insert semantics reset unmentioned columns to their defaults, which is not what the engine's upsert does. Use INSERT … ON DUPLICATE KEY UPDATE. REPLACE INTO deletes the old row and inserts a replacement; omitted fields can therefore change. The engine upsert preserves existing values, so REPLACE INTO is refused rather than treated as an upsert. INSERT IGNORE is also refused because it suppresses errors. MySQL is a registered trademark of Oracle Corporation and/or its affiliates. OriginChainDB is not affiliated with, endorsed by, or sponsored by Oracle Corporation. OriginChainDB implements a compatible wire protocol so that existing MySQL clients can connect to it; it does not distribute MySQL software. Expected result The supported form is translated to an engine upsert. Continue Continue to read table metadata. Commit or roll back writes Previous Page SQL examples Next Page --- ## SQL examples | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql Sql SQL examples ← All examples Start with a small sample table. Choose the recipe for the filter, calculation or write you need, then check its limits before using it on production data. For your first query, follow Read the columns you need from its table definition through its response. The filtering and join examples reuse its customers and the three-order sample. Advanced calculation examples use a separate numeric-ID dataset linked on those pages. Choose the SQL operation your question needsUse the matching sample table; advanced recipes may use a different dataset. 01 Start with sample rowsCreate and load the table named by the recipe. 02 Choose a questionSelect fields, filter rows, join tables or calculate a result. 03 Run its SQLKeep parameters separate from the query where supported. 04 Verify the outputCheck fields, row counts and changes before adapting the query. Read and change rows Read the columns you need — Select customer IDs and email addresses. Find rows with an exact value — Find customers whose region is IN. Match any value in a list — Find orders with either of two statuses. Find values within a range — Find orders whose amount is between two limits. Combine matching records — Join each order to its customer. Keep records without a match — List every customer, including customers who have no orders. Summarize rows by status — Group orders by status and calculate counts and amounts. Sort and page through rows — Use ORDER BY to choose the order, LIMIT to choose the page size, and OFFSET to skip earlier rows. Calculate across related rows — Window functions add a ranking or running calculation while keeping each original row. Filter with another query’s results — Find orders belonging to customers in a selected region. Update one row by primary key — Change one known row through SQL. Remove rows deliberately — Check the rows selected by a filter before deleting them. Follow a hierarchy — Expand an organization chart from one employee. Use everyday SQL patterns — Choose a recipe for a named subquery, bound values, time buckets, conditional values or catalog lookup. Before adapting a recipe Use a test database, load the named sample data, and check the expected result. Read each page’s limits before changing the query. See connection and SDK notes. Insert or update a primary key match Previous Page Remove rows deliberately Next Page --- ## Remove rows deliberately | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql/delete-via-sql Sql Remove rows deliberately ← SQL examples Remove rows deliberately Check the rows selected by a filter before deleting them. The examples show a direct delete and a delete buffered inside a transaction. Before you run it: SQL DELETE without WHERE empties the table. Use a selective filter and verify the rows before sending the write. Load the introductory orders sample dataset first. It contains o_001, o_002 and o_003 with customer_id, amount_cents and status. Use a disposable copy because this recipe changes those rows. Preview and commit a single-order deletionUse the same session ID for the transaction and confirm the target before deleting. 01 Preview order o_003Run a matching SELECT in the test table. 02 Begin the transactionKeep the session ID for all following statements. 03 Delete the intended rowBuffer the primary-key deletion in that transaction. 04 Commit and checkConfirm the row is absent after the commit. Follow the example Run SELECT with the intended filter first. Choose the direct or transaction example. Keep the same session ID through COMMIT. Check the write count and read back the keys. Supported operations DELETE over /sql executes. On its own it removes the matched rows in a single durable frame and answers with rows_affected. A WHERE = takes a typed single-row fast path; any other supported predicate - and a composite primary key - lowers to a scan-based delete. Inside BEGIN; ... COMMIT; the same statement buffers instead, reporting rows_buffered until commit. Delete inside a transaction Inside an open transaction, a primary-key DELETE buffers a row-removal op and the COMMIT applies it durably in one frame. Carry the same session id across all three calls so they share one transaction buffer. # Supported SQL route: wrap the DELETE in an explicit transaction. # The same session id must accompany BEGIN, the DELETE, and COMMIT so # the buffered row-removal is applied atomically on COMMIT. SID="sess-$(date +%s)" # 1. open the transaction curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "X-OC-Session-Id: $SID" \ -H "Content-Type: application/json" \ -d '{ "sql": "BEGIN" }' # 2. buffer the delete (matched by primary key) curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "X-OC-Session-Id: $SID" \ -H "Content-Type: application/json" \ -d '{ "sql": "DELETE FROM shop.orders WHERE id = '\''o_003'\''" }' # 3. commit - the buffered row-removal lands durably here curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "X-OC-Session-Id: $SID" \ -H "Content-Type: application/json" \ -d '{ "sql": "COMMIT" }' Check the transaction result // the DELETE step, inside the open transaction: { "kind": "delete", "schema": "shop.orders", "pk": "o_003", "rows_buffered": 1 } // the COMMIT step - the buffered op is now durable: { "kind": "tx", "op": "commit", "ops_committed": 1 } rows_buffered is 1 when the row existed (and 0 when it didn't). The removal is not visible to other readers until COMMIT returns ops_committed: 1. Delete through the row API When you already hold the primary key and don't need SQL, delete the row through the typed row endpoints. The row delete path carries the same idempotency-key plumbing as the rest of the typed /rows surface. Delete without a transaction With no BEGIN around it, the same statement autocommits: the rows are removed in one frame before the response returns, and rows_affected counts them. Foreign keys are enforced on this path too. Note that /sql is the one surface that accepts a bare DELETE FROM t with no WHERE and empties the table - the typed row endpoints refuse that shape. # This statement commits without an explicit transaction. # Check rows_affected, then read back the key to confirm the result. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sql": "DELETE FROM shop.orders WHERE id = '\''o_003'\''" }' Check the direct-delete result { "kind": "delete", "schema": "shop.orders", "rows_affected": 1 } Add RETURNING order_id, total_cents (or RETURNING *) and the response also carries a rows array holding the deleted rows' values, projected to that column list. A no-match delete answers rows_affected: 0 with an empty rows array rather than an error. Expected result The transaction example deletes o_003. If you then run the direct-delete example without restoring that row, expect rows_affected: 0, because it is already gone. Restore the sample only in your test database if you want to compare both deletion paths from the same starting state. Continue Continue to update one row by primary key. SQL examples Previous Page Summarize rows by status Next Page --- ## Summarize rows by status | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql/group-by-aggregate Sql Summarize rows by status ← SQL examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Group orders by status and calculate counts and amounts. An aggregate turns several rows into a summary value, such as SUM or COUNT. Before you run it: Every selected field must be grouped or calculated by an aggregate. HAVING filters the finished groups. Turn order rows into a status summaryGrouping produces one result row per status, not one row per order. 01 Start with individual ordersRead each row's status and amount. 02 Group equal statusesCollect paid and pending orders into their groups. 03 Calculate each groupCount orders and compute the requested sum or average. 04 Filter group results if neededHAVING applies after the group calculation. Follow the example Load the order sample. Group by status. Run the count, total and average query. Read one summary row per status. Run the request First register and load the orders sample: shop.orders has id, customer_id, amount_cents and status. Use its three sample rows for the results shown here. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sql": "SELECT status, COUNT(*) AS n, SUM(amount_cents) AS total, AVG(amount_cents) AS avg_amt, MIN(amount_cents) AS min_amt, MAX(amount_cents) AS max_amt FROM shop.orders GROUP BY status" }' Check the result The result contains one row per group rather than one row per order. { "kind": "select", "rows": [ { "status": "paid", "n": 2, "total": 6240, "avg_amt": 3120.0, "min_amt": 1250, "max_amt": 4990 }, { "status": "pending", "n": 1, "total": 12900, "avg_amt": 12900.0, "min_amt": 12900, "max_amt": 12900 } ] } Important limits and checks Selecting a non-grouped column. Every column in SELECT must either be in GROUP BY or wrapped in an aggregate. Standard SQL rule. Filtering on aggregates. Use HAVING - it executes server-side (e.g. GROUP BY status HAVING COUNT(*) > 3). It runs after grouping, so it can reference aggregates that WHERE can't. Continue Continue to sort and page through rows. Remove rows deliberately Previous Page Combine matching records Next Page --- ## Combine matching records | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql/inner-join Sql Combine matching records ← SQL examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Join each order to its customer. A join matches rows from two tables using a shared value, here the customer ID. Before you run it: Keep the matching rule explicit so the query combines the intended records. For the sample, two paid orders carry customer_id: "c_1", which matches Alice's id. Each order becomes one result row containing its amount and Alice's email. The customer is not copied into the order table; the query brings the fields together. Attach customer details to matching ordersOrders without a matching customer do not appear in an inner join. 01 Start with the order rowsRead each order's customer_id. 02 Match the customer keyJoin it to customers.id. 03 Return combined fieldsEach matching order includes its customer's email. Follow the example Create and load both tables. Match orders.customer_id to customers.id in ON. Select the columns you need. Read the combined rows. Run the request First load the customers sample and orders sample. This query matches shop.orders.customer_id to shop.customers.id; keep those field names when using the sample. The general schema walkthrough uses a different order field named customer. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sql": "SELECT o.id, o.amount_cents, c.email FROM shop.orders o INNER JOIN shop.customers c ON o.customer_id = c.id WHERE o.status = '\''paid'\'' LIMIT 50" }' Check the result Only orders with a matching customer appear. Qualified names distinguish fields from the two tables. { "kind": "select", "rows": [ { "o.id": "o_001", "o.amount_cents": 4990, "c.email": "alice@example.com" }, { "o.id": "o_003", "o.amount_cents": 1250, "c.email": "alice@example.com" } ] } Note that result keys are dotted - "o.id", "c.email" - because the engine carries the table alias through to disambiguate same-named columns on both sides. Understand the behavior The planner picks the smaller side (here customers) to build a hash table. It then scans the larger side and probes the hash table for each row. The WHERE predicate is pushed into the orders-side scan, so only paid orders enter the join. Important limits and checks No ON condition. Use an explicit ON condition for this INNER JOIN. A CROSS JOIN is a different operation and can multiply the result size; check its supported scope before using it. Ambiguous column names. If both sides have a column called id, qualify with the alias - o.id, c.id. Continue Continue to keep records without a match. Summarize rows by status Previous Page Keep records without a match Next Page --- ## Keep records without a match | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql/left-join Sql Keep records without a match ← SQL examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. List every customer, including customers who have no orders. LEFT JOIN keeps the left table’s rows when the right table has no match. Before you run it: A right-table filter in WHERE can remove unmatched customers. Put match-specific filters in ON when those customers must remain. The sample customer c_3 has no order. A LEFT JOIN keeps that customer and fills the missing order fields with null, meaning there is no matching value. An INNER JOIN would leave that customer out. Keep customers even when they have no ordersPut right-table conditions in ON when unmatched customers must remain. 01 Start with every customerKeep the customer table on the left. 02 Match any order rowsJoin orders through the customer key. 03 Keep an unmatched customerCustomer c_3 remains with null order fields. Follow the example Load the linked customer and order samples. Put customers on the left of the join. Run the query. Find the customer whose order fields are null. Run the request First load the customers sample and orders sample. This query matches shop.orders.customer_id to shop.customers.id; keep those field names when using the sample. The general schema walkthrough uses a different order field named customer. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sql": "SELECT c.id, c.email, o.id FROM shop.customers c LEFT JOIN shop.orders o ON c.id = o.customer_id LIMIT 20" }' Check the result The sample keeps customer c_3 and fills missing order fields with null. { "kind": "select", "rows": [ { "c.id": "c_1", "c.email": "alice@example.com", "o.id": "o_001" }, { "c.id": "c_1", "c.email": "alice@example.com", "o.id": "o_003" }, { "c.id": "c_2", "c.email": "bob@example.com", "o.id": "o_002" }, { "c.id": "c_3", "c.email": "carol@example.com", "o.id": null } ] } Important limits and checks Right-side predicates in WHERE. WHERE o.status = 'paid' after a LEFT JOIN turns it back into an INNER JOIN (because the unmatched rows have null status, which fails the predicate). Put right-side predicates in the ON clause if you want LEFT semantics preserved. Confusing LEFT and RIGHT. If you find yourself reaching for RIGHT JOIN, swap the table order and use LEFT - it reads more clearly. Continue Continue to summarize rows by status. Combine matching records Previous Page Sort and page through rows Next Page --- ## Sort and page through rows | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql/limit-roadmap-orderby Sql Sort and page through rows ← SQL examples Use ORDER BY to choose the order, LIMIT to choose the page size, and OFFSET to skip earlier rows. Before you run it: Choose a deliberate sort order when paging. LIMIT alone does not describe which rows come first. Sort results before choosing a pageThe small sample can produce an empty page when the offset is larger than its row count. 01 Order by amountSort the qualifying orders in descending amount order. 02 Skip the requested offsetMove past rows already assigned to earlier pages. 03 Return up to the limitInspect the page and use a stable tie-breaker for repeated amounts. Follow the example Load the linked order sample. Run the query for the three largest amounts. Run the second example to skip ten rows. Check the order and result count. Supported operations ORDER BY (ascending or descending), LIMIT, and OFFSET all execute server-side through the SQL translator - the engine's Sort operator is wired through. Sorting and pagination happen in the engine, not your app. Find the three largest amounts First register and load the orders sample: shop.orders has id, customer_id, amount_cents and status. Use its three sample rows for the results shown here. # ORDER BY + LIMIT + OFFSET all execute server-side. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sql": "SELECT id, amount_cents FROM shop.orders WHERE amount_cents > 0 ORDER BY amount_cents DESC LIMIT 3" }' Choose a page of results Page N skips (N-1) × page size rows. The sample amounts are distinct. In real data, add a unique tie-breaker such as id to ORDER BY when amounts can be equal. Inserts or deletes between requests can still shift offset-based pages. # Page 2 (rows 11-20): ORDER BY + LIMIT + OFFSET. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sql": "SELECT id, amount_cents FROM shop.orders ORDER BY amount_cents DESC LIMIT 10 OFFSET 10" }' Expected result The first request returns all three sample orders, sorted by amount. The second uses OFFSET 10, so it returns no rows with this three-row sample. Add more rows before testing later pages. Continue Continue to filter with another query’s results. Keep records without a match Previous Page Use everyday SQL patterns Next Page --- ## Use everyday SQL patterns | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql/newer-recipes Sql Use everyday SQL patterns ← SQL examples Choose a recipe for a named subquery, bound values, time buckets, conditional values or catalog lookup. Before you run it: The time-bucket recipe does not support ordering by its grouped date_trunc expression; sort that result in your application. Choose a calculation and verify its resultThese recipes cover different SQL tasks; use the dataset and restrictions named in each one. 01 Choose the needed calculationName a subquery, bind a value, bucket dates or inspect the catalog. 02 Use the matching dataLoad the numeric fixture where the recipe requires it. 03 Run one complete recipeKeep its supported query shape and parameter rules. 04 Check its outputApply client-side ordering when the documented form requires it. Follow the example Load the data named by your chosen recipe. Run that request separately. Compare its response with the explanation. Keep its limits when adapting it to your table. Prepare the numeric order sample These advanced examples use numeric order and customer IDs. They do not use the o_001 / c_1 sample dataset from the introductory SQL recipes. Use an empty test database so the shop.orders definitions do not conflict. Create the table and load four orders curl --fail-with-body -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/schemas" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: text/plain" \ --data-binary @- <<'TOML' namespace = "shop" table = "orders" primary_key = ["id"] [[columns]] name = "id" ty = "i64" required = true [[columns]] name = "customer_id" ty = "i64" [[columns]] name = "amount_cents" ty = "i64" [[columns]] name = "status" ty = "str" [[columns]] name = "created_at" ty = "timestamp" TOML curl --fail-with-body -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.orders/_batch" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '[ {"id":1,"customer_id":1,"amount_cents":14900,"status":"paid","created_at":1767225600000}, {"id":4,"customer_id":1,"amount_cents":3900,"status":"paid","created_at":1767225600000}, {"id":3,"customer_id":2,"amount_cents":7200,"status":"pending","created_at":1769904000000}, {"id":6,"customer_id":2,"amount_cents":22000,"status":"paid","created_at":1769904000000} ]' There are two January orders totaling 18,800 cents and two February orders totaling 29,200 cents. The three paid orders total 40,800 cents. These checks help distinguish a query mistake from an incorrectly loaded sample. The bare SQL blocks below can run in the SQL editor. To use HTTP, send the statement as the sql field to the SQL endpoint; the parameter example already shows that JSON body. About these examples Each example below shows one supported request shape and its recorded result. Check SQL support for query restrictions and window functions for running totals. Name a subquery, then aggregate over it A WITH block names the result of a query so a later query can use it. This is called a common table expression, or CTE. Here paid means the paid orders only; the outer query counts and totals them for each customer. WITH paid AS ( SELECT customer_id, amount_cents FROM shop.orders WHERE status = 'paid' ) SELECT customer_id, count(*) AS n, sum(amount_cents) AS total FROM paid GROUP BY customer_id Read the result { "kind": "select", "columns": ["customer_id", "n", "total"], "rows": [ { "customer_id": 1, "n": 2, "total": 18800 }, { "customer_id": 2, "n": 1, "total": 22000 } ] } Recursive CTEs (WITH RECURSIVE) execute over /sql too, under their own bounds — one recursive CTE per statement, UNION ALL between the arms, and depth and row caps on the walk. See WITH RECURSIVE. A shape outside those bounds comes back as a clear 400 naming the constraint it broke, never a silent re-interpretation. Bind values with a params array Keep SQL and values apart: write positional $1, $2 placeholders and pass a params array alongside the statement. Bind user-supplied values instead of interpolating them into the SQL string. { "sql": "SELECT id, amount_cents, status FROM shop.orders WHERE customer_id = $1 AND amount_cents > $2 ORDER BY amount_cents DESC", "params": [1, 1000] } Read the result { "kind": "select", "columns": ["id", "amount_cents", "status"], "rows": [ { "id": 1, "amount_cents": 14900, "status": "paid" }, { "id": 4, "amount_cents": 3900, "status": "paid" } ] } To write a timestamp, bind its value through params rather than using an inline TIMESTAMP '…' literal. The sample table also requires an explicit order ID. Optional: add one dated order after trying the read examples This changes the sample counts and totals. Run it after the examples below, using an unused ID. { "sql": "INSERT INTO shop.orders (id, customer_id, amount_cents, status, created_at) VALUES ($1,$2,$3,$4,$5)", "params": [7, 1, 14900, "paid", "2026-01-04 10:00:00"] } Check the insert response, then read order 7 to confirm the saved date and amount. Roll rows up into time buckets The dashboard shape: bucket a timestamp column by day / month and aggregate per bucket, in a single GROUP BY. SELECT date_trunc('month', created_at) AS m, count(*) AS n, sum(amount_cents) AS rev FROM shop.orders GROUP BY date_trunc('month', created_at) Read the result { "kind": "select", "columns": ["m", "n", "rev"], "rows": [ { "m": 1767225600000, "n": 2, "rev": 18800 }, { "m": 1769904000000, "n": 2, "rev": 29200 } ] } Buckets come back as epoch-milliseconds (1767225600000 = 2026-01-01). Sort the buckets in your app for now — ORDER BY over a date_trunc group key isn't wired through /sql yet. Branch inline with CASE Derive a column from a per-row condition without a second query — CASE WHEN … THEN … ELSE … END evaluates in the SELECT list. SELECT id, amount_cents, CASE WHEN amount_cents >= 10000 THEN 'big' ELSE 'small' END AS tier FROM shop.orders ORDER BY id Read the result { "kind": "select", "columns": ["id", "amount_cents", "tier"], "rows": [ { "id": 1, "amount_cents": 14900, "tier": "big" }, { "id": 3, "amount_cents": 7200, "tier": "small" }, { "id": 4, "amount_cents": 3900, "tier": "small" }, { "id": 6, "amount_cents": 22000, "tier": "big" } ] } Ask the engine about itself The examples query information_schema and pg_catalog, then inspect session state with SHOW and current_schema(). Use the documented catalog fields; these examples do not establish compatibility with every ORM discovery query. SELECT column_name FROM information_schema.columns WHERE table_name = 'orders' Read the result { "kind": "select", "columns": ["column_name"], "rows": [ { "column_name": "id" }, { "column_name": "customer_id" }, { "column_name": "amount_cents" }, { "column_name": "status" }, { "column_name": "created_at" } ] } SHOW search_path → public · SELECT current_schema() → public. SET search_path and GUCs persist for the session. Expected result Each recipe includes its own result to inspect. Continue Continue to the related examples. Sort and page through rows Previous Page Read the columns you need Next Page --- ## Read the columns you need | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql/select-projection Sql Read the columns you need ← SQL examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Select customer IDs and email addresses. Selecting named columns keeps the response focused on the fields your application uses. Before you run it: Use LIMIT when exploring a table to keep the response small. A primary key is the value that identifies one row. Here it is id. A projection simply selects columns: SELECT id, email returns those two fields and leaves region out of the response. Return only the customer fields you needSelecting fewer columns does not remove other stored fields. 01 Three customer rowsThe sample stores id, email and region. 02 Select id and emailRequest those two fields with a result limit. 03 Read the projected rowsThe response omits region while the table keeps it. Follow the example Register the customer schema below. Load the three sample customers. Run the SELECT request in one language tab. Read the rows in the response. Set up the table Register this once with POST /v1/tenants/:t/schemas (Content-Type: text/plain). namespace = "shop" table = "customers" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "email" ty = "str" [[columns]] name = "region" ty = "str" [[columns]] name = "tier" ty = "str" [[indexes]] name = "by_region" columns = ["region"] Load sample rows Load three customers via the bulk-insert endpoint so the response below has something to return. # One-time seed of three customers - skip if you've already loaded data. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.customers/_batch" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '[ { "id": "c_1", "email": "alice@example.com", "region": "IN", "tier": "gold" }, { "id": "c_2", "email": "bob@example.com", "region": "US", "tier": "silver" }, { "id": "c_3", "email": "carol@example.com", "region": "DE", "tier": "gold" } ]' Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sql": "SELECT id, email FROM shop.customers LIMIT 5" }' Check the result The result has kind select. Each row contains the selected column names and values. { "kind": "select", "rows": [ { "id": "c_1", "email": "alice@example.com" }, { "id": "c_2", "email": "bob@example.com" }, { "id": "c_3", "email": "carol@example.com" } ] } Every /sql response carries a kind field. "select" means the engine ran the query and the rows are in rows; each row is a JSON object keyed by column name. How the database handles this request The database reads customer records, keeps only id and email, and stops after at most five rows. In a query plan those operations are named Scan, Project and Limit. Selecting fewer columns changes the response; it does not remove fields from the stored records. Important limits and checks Missing LIMIT. Without a LIMIT, the query returns every row. On large tables that's slow and expensive. Add LIMIT early, drop it only when you mean it. Forgot to qualify the table. Tables are addressed as namespace.table - FROM shop.customers, not FROM customers. Asking for an undeclared column. Selecting a column that doesn't exist in the schema returns 400 unknown_column. Continue Continue to find rows with an exact value. Use everyday SQL patterns Previous Page Filter with another query’s results Next Page --- ## Filter with another query’s results | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql/uncorrelated-in-select Sql Filter with another query’s results ← SQL examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Find orders belonging to customers in a selected region. The inner query returns customer IDs; the outer query uses those IDs as its filter. Before you run it: Compare a large intermediate result with a join. Correlated queries have different execution costs. Think of this as two questions: first, which customer IDs have region IN; second, which orders carry one of those IDs? The inner query supplies the allowed values automatically instead of typing them into an IN list. Filter orders with a separate customer queryThe inner query does not depend on each outer order row. 01 Find customers in INRun the inner customer filter. 02 Collect their customer IDsUse that result as the membership set. 03 Match the outer ordersKeep orders whose customer_id is in the set. Follow the example Load the linked customer and order samples. Check the inner query’s customer IDs. Run the complete IN (SELECT …) query. Compare orders with those customer IDs. Run the request First load the customers sample and orders sample. This query matches shop.orders.customer_id to shop.customers.id; keep those field names when using the sample. The general schema walkthrough uses a different order field named customer. # Orders for customers in the 'IN' region. # The inner SELECT is uncorrelated - it doesn't reference outer columns. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sql": "SELECT id, amount_cents FROM shop.orders WHERE customer_id IN (SELECT id FROM shop.customers WHERE region = '\''IN'\'')" }' Check the result The inner query runs once because it does not refer to the outer row. Its result is held in memory. { "kind": "select", "rows": [ { "id": "o_001", "amount_cents": 4990 }, { "id": "o_003", "amount_cents": 1250 } ] } Queries that refer to the outer row This page shows the uncorrelated shape (the inner runs once, result inlined). Correlated subqueries - where the inner SELECT references an outer column - also execute server-side, evaluated per outer row. You don't have to flatten them to a JOIN (though a JOIN is often the faster plan for large inputs). Correlated EXISTS / NOT EXISTS. WHERE EXISTS (SELECT 1 FROM x WHERE x.id = o.x_id) - runs as a semi-join (anti-join for NOT EXISTS). Correlated IN. WHERE col IN (SELECT k FROM y WHERE y.j = o.j) - evaluated per outer row. Scalar correlated subqueries. WHERE col = (SELECT COUNT(*) FROM y WHERE y.k = o.k) - compared against the per-row scalar. Continue Continue to combine matching records. Read the columns you need Previous Page Update one row by primary key Next Page --- ## Update one row by primary key | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql/update-via-sql Sql Update one row by primary key ← SQL examples Update one row by primary key Change one known row through SQL. A primary key is the column, or set of columns, that identifies the row. Before you run it: This UPDATE path targets one primary-key-pinned row. For several rows, read their keys and update each row separately. Load the introductory orders sample dataset first. It contains o_001, o_002 and o_003 with customer_id, amount_cents and status. Use a disposable copy because this recipe changes those rows. Change one order selected by its primary keyThis example updates a primary-key match; it does not demonstrate a non-key bulk update. 01 Load the test orderConfirm that o_001 is the intended record. 02 Set the new statusUse its primary key in WHERE and set status to shipped. 03 Read back the orderCheck rows_affected and the stored status. Follow the example Find the row’s primary key. Put that key in the UPDATE filter. Check rows_affected. Read the row to confirm the change. Supported operations UPDATE through /sql executes against the engine and returns rows_affected. (Earlier builds only translated the statement - that's no longer the case.) Run the SQL update # UPDATE through /sql executes against the engine. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sql": "UPDATE shop.orders SET status = '\''shipped'\'' WHERE id = '\''o_001'\''" }' Check the response { "kind": "update", "schema": "shop.orders", "rows_affected": 1 } The matched row is mutated in place. rows_affected is 0 when the WHERE matches nothing. Update one key at a time UPDATE via /sql targets one row identified by its primary key - the WHERE must pin the PK (WHERE id = '...'). Set-based updates that match on a non-PK column (e.g. UPDATE shop.orders SET status = 'shipped' WHERE customer_id = 'c_1') are not applied as a bulk mutation. To update many rows, read the matching primary keys first, then issue one PK-pinned UPDATE - or one PUT to the row endpoint - per key. Replace the row through the row API When you already have the complete new row, a PUT to the row endpoint overwrites it atomically in one round-trip and carries the SDK's idempotency-key plumbing. # Alternative: PUT the full row representation directly. # Use this when you want to overwrite the whole row in one shot. curl -X PUT "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.orders/o_001" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "o_001", "customer_id": "c_1", "amount_cents": 4990, "status": "shipped" }' Expected result No matching row produces rows_affected: 0. Continue Continue to remove rows deliberately. Filter with another query’s results Previous Page Find values within a range Next Page --- ## Find values within a range | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql/where-between Sql Find values within a range ← SQL examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Find orders whose amount is between two limits. This example stores prices as integer cents. Before you run it: Use > and < when the endpoints must be excluded. Keep orders inside an inclusive price rangeBoth bounds use cents, matching the stored amount_cents column. 01 Read order amountsUse the integer amounts in the sample table. 02 Apply 1000 through 10000BETWEEN includes both endpoint values. 03 Inspect matching ordersRows below or above the range are excluded. Follow the example Load the orders from the linked setup. Set the lower and upper amounts. Run the query. Check values at both boundaries. Run the request First register and load the orders sample: shop.orders has id, customer_id, amount_cents and status. Use its three sample rows for the results shown here. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sql": "SELECT id, amount_cents FROM shop.orders WHERE amount_cents BETWEEN 1000 AND 10000 LIMIT 50" }' Check the result BETWEEN includes both endpoints: 1000 and 10000 match. { "kind": "select", "rows": [ { "id": "o_001", "amount_cents": 4990 }, { "id": "o_003", "amount_cents": 1250 } ] } Important limits and checks Off-by-one. BETWEEN is inclusive on both ends. If you mean exclusive, use col > low AND col < high. Keep the units consistent. This table uses integer cents, so 1000 means 10.00 in the chosen currency. Exact decimal fields are another option; avoid binary floating-point values when exact monetary comparisons matter. Continue Continue to summarize rows by status. Update one row by primary key Previous Page Find rows with an exact value Next Page --- ## Find rows with an exact value | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql/where-equality Sql Find rows with an exact value ← SQL examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Find customers whose region is IN. An index is a lookup structure that can find matching rows without reading every row. Before you run it: String equality is case-sensitive. Find customers with one exact regionThe equality comparison is case-sensitive in this example. 01 Load the customer sampleEach customer has a region value. 02 Filter region to INUse the exact value in the WHERE condition. 03 Read Alice's matching rowCheck that customers from other regions are excluded. Follow the example Load the customers from the linked setup. Send the query with the region in single quotes. Check the returned region. Use EXPLAIN to check whether the index is used. Run the request First register and load the customers sample, which defines id, email and region and supplies three rows. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sql": "SELECT id, email, region FROM shop.customers WHERE region = '\''IN'\'' LIMIT 10" }' Check the result The sample returns Alice’s customer record. Without an index, the query may scan the table. { "kind": "select", "rows": [ { "id": "c_1", "email": "alice@example.com", "region": "IN" } ] } How the database handles this request The database needs only rows whose region is IN. The sample schema defines by_region, an index on that field. An IndexScan in the plan means the engine uses that lookup; a Scan means it reads rows and tests the filter. Check the actual plan instead of inferring it from the query text. Run EXPLAIN SELECT ... on the same query to see whether your indexes are being used. Important limits and checks Quoting strings as double-quoted. SQL strings use single quotes - WHERE region = 'IN'. Double-quoted identifiers refer to columns, not strings. Case sensitivity. String equality is case-sensitive: 'IN' doesn't match 'in'. Lowercase at write time if you want case-insensitive lookups. Matching several values in one column. Use an IN list to keep that filter concise. Continue Continue to match any value in a list. Find values within a range Previous Page Match any value in a list Next Page --- ## Match any value in a list | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql/where-in Sql Match any value in a list ← SQL examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Find orders with either of two statuses. IN keeps a short list of allowed values in one filter. Before you run it: The notes below explain why NULL needs care with NOT IN. Match any value in a short status listIN tests membership in the list; it does not duplicate a row that matches. 01 Read the sample ordersUse the order status column. 02 Allow pending or paidSupply both accepted values to IN. 03 Read the qualifying ordersThe sample returns the three matching orders once each. Follow the example Register and seed the order table. Put the allowed statuses in the IN list. Run the query. Check the returned statuses against the list. Set up the table Save this definition as orders.toml and send it to POST /v1/tenants/:t/schemas with Content-Type: text/plain before loading rows. The schema walkthrough shows how to register a file; use this page's definition for its sample. namespace = "shop" table = "orders" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "customer_id" ty = "str" [[columns]] name = "amount_cents" ty = "i64" [[columns]] name = "status" ty = "str" [[indexes]] name = "by_status" columns = ["status"] Load sample rows curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.orders/_batch" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '[ { "id": "o_001", "customer_id": "c_1", "amount_cents": 4990, "status": "paid" }, { "id": "o_002", "customer_id": "c_2", "amount_cents": 12900, "status": "pending" }, { "id": "o_003", "customer_id": "c_1", "amount_cents": 1250, "status": "paid" } ]' Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sql": "SELECT id, status FROM shop.orders WHERE status IN ('\''pending'\'', '\''paid'\'') LIMIT 50" }' Check the result Rows match when their status equals a listed value. { "kind": "select", "rows": [ { "id": "o_001", "status": "paid" }, { "id": "o_002", "status": "pending" }, { "id": "o_003", "status": "paid" } ] } How the database handles this request A row matches when its status is pending or paid. The supplied dataset has two paid orders and one pending order, so all three are returned. An index can help the database find those rows; the result still contains each matching row once. Important limits and checks Long lists. Large lists add parsing and query work. For a repeatedly used set of IDs, consider a separate lookup table and a supported join; do not assume temporary-table syntax is available. NOT IN with NULL. If any value in the list is NULL, NOT IN returns no rows (standard SQL three-valued logic). Filter NULL explicitly before negating. Continue Continue to find values within a range. Find rows with an exact value Previous Page Calculate across related rows Next Page --- ## Calculate across related rows | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql/window-functions-roadmap Sql Calculate across related rows ← SQL examples Window functions add a ranking or running calculation while keeping each original row. A partition is the group used for that calculation. Before you run it: Supported frames and combinations are listed below. These examples use window functions in the SELECT list. First load the four-order numeric sample. PARTITION BY customer_id restarts the calculation for each customer. ORDER BY inside OVER chooses the order of that calculation; it does not by itself promise a sorted final response. Add calculations without collapsing the rowsWindow calculations retain individual rows; final result ordering is a separate choice. 01 Group rows into windowsUse the customer as the partition key. 02 Order inside each windowDefine the order needed for ranking or running totals. 03 Calculate alongside each rowReturn the original fields with the new window value. Follow the example Load the sample orders. Run the ranking example within each customer. Run the running-total example. Compare each result with the partition and order in OVER. Supported operations ROW_NUMBER(), RANK(), DENSE_RANK(), LAG() and LEAD() with OVER (PARTITION BY ... ORDER BY ...) all execute server-side through the SQL translator, alongside SUM / AVG / COUNT / MIN / MAX over a window and the value and distribution functions (FIRST_VALUE, LAST_VALUE, NTH_VALUE, NTILE, PERCENT_RANK, CUME_DIST). Explicit ROWS BETWEEN / RANGE frame clauses (running totals, moving windows) execute too — on the frame-respecting functions: the aggregates plus FIRST_VALUE / LAST_VALUE / NTH_VALUE. Ranking and offset functions ignore a frame by definition, so writing one on ROW_NUMBER, RANK, LAG, LEAD or NTILE is refused with a hint rather than silently dropped. Rank orders for each customer Rank each customer's orders by amount - the canonical window use - runs server-side: SELECT id, customer_id, amount_cents, ROW_NUMBER() OVER ( PARTITION BY customer_id ORDER BY amount_cents DESC ) AS rn FROM shop.orders Each row comes back with its rn computed in one pass - no client-side sorting needed. Calculate a running total Add a ROWS BETWEEN frame to accumulate a running total per partition — the classic dashboard shape — in one server-side pass: SELECT id, customer_id, amount_cents, SUM(amount_cents) OVER ( PARTITION BY customer_id ORDER BY id ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) AS running FROM shop.orders With the four-row sample, running totals amounts in ID order within each customer: customer 1 → 14900, 18800; customer 2 → 7200, 29200. Each original order remains in the result beside its running value. The two frame units differ in what they accept. ROWS takes every bound — UNBOUNDED PRECEDING, N PRECEDING, CURRENT ROW, N FOLLOWING, UNBOUNDED FOLLOWING — so a moving window such as ROWS BETWEEN 1 PRECEDING AND CURRENT ROW works. RANGE takes peer bounds only (UNBOUNDED PRECEDING, CURRENT ROW, UNBOUNDED FOLLOWING), where CURRENT ROW spans the whole tie group; a value offset such as RANGE BETWEEN 5 PRECEDING is refused, as are the GROUPS frame unit and EXCLUDE. Check query and frame limits A window function runs over a single-table SELECT. It cannot yet appear in the same SELECT as a JOIN, a GROUP BY or DISTINCT, and the OVER call has to sit in the select list - you can ORDER BY the alias it was given, but not write the call itself into a WHERE or ORDER BY expression. Do the join or the aggregate in a subquery first, then window over its output. Named windows (WINDOW w AS (...) with OVER w) are supported; chaining one named window off another is not. Expected result Rankings and totals appear beside each order instead of collapsing orders into a summary. Continue Continue to summarize rows by status. Match any value in a list Previous Page Follow a hierarchy Next Page --- ## Follow a hierarchy | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sql/with-recursive-roadmap Sql Follow a hierarchy ← SQL examples Expand an organization chart from one employee. A recursive common table expression, or CTE, repeats a query using the previous step’s results. Before you run it: Limits are 100 levels and one million rows. The path supports one recursive CTE with UNION ALL; the restrictions below still apply. Walk an employee hierarchy level by levelRecursion stops when no new rows remain or a configured safety limit is reached. 01 Choose the starting employeeThe first query supplies the initial row. 02 Find the next reportsUse the recursive query to join the next level. 03 Repeat within the limitsContinue through descendants with the documented recursion bounds. 04 Read the hierarchy rowsInspect the returned descendants before adapting the traversal. Follow the example Create the employee sample. Choose the starting employee. Run the UNION ALL query. Inspect descendants and stop conditions. Load a three-person hierarchy Use a disposable test database and the tenant-scoped connection from the example setup notes. A missing manager marks the root; each other row stores its manager's ID. Create and load the employee sample curl --fail-with-body -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/schemas" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: text/plain" \ --data-binary @- <<'TOML' namespace = "hr" table = "employees" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "manager_id" ty = "str" [[relations]] name = "reports_to" from_col = "manager_id" bidirectional = true target = { namespace = "hr", table = "employees", pk = "id" } TOML curl --fail-with-body -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/hr.employees/_batch" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '[ {"id":"ceo"}, {"id":"lead","manager_id":"ceo"}, {"id":"engineer","manager_id":"lead"} ]' The recursive SQL below starts with ceo, finds lead, then finds engineer. It keeps the starting row too. Those three IDs are the expected result; no ordering is promised without an outer ORDER BY. Supported operations WITH and WITH RECURSIVE use the SQL endpoint. A recursive query starts with seed rows and repeats its step until no new rows remain. The sections below show the supported form and its bounds. Walk the employee hierarchy Walk an org chart down from one root. This runs as written: WITH RECURSIVE descendants AS ( SELECT id, manager_id FROM hr.employees WHERE id = 'ceo' UNION ALL SELECT e.id, e.manager_id FROM hr.employees e INNER JOIN descendants d ON e.manager_id = d.id ) SELECT * FROM descendants The response contains the rows reachable from the starting row. Access checks apply to the tables in both the seed and recursive step; a table you cannot read causes the query to fail. Keep the traversal bounded UNION ALL between the seed and step arms. UNION (distinct) is refused - deduplicating would mean hashing every intermediate row. Exactly one CTE in a statement that uses RECURSIVE; chaining a second binding off the recursive one is refused. No per-CTE column list (WITH RECURSIVE t(a, b) AS ...). No aggregate over the recursive relation in the outer projection - SELECT COUNT(*) FROM t is refused, so count client-side. (Over a plain CTE, COUNT(*) does fold - the asymmetry is deliberate.) Two caps bound the walk: a depth cap of 100 iterations, and a separate cap of 1,000,000 accumulated rows. Cyclic or wide-branching data hits one of them and comes back as a 400 naming the cap it hit - it will not spin or exhaust the engine. Add a visited-set predicate to make such a walk terminate with rows instead. Filtering and projecting the recursive relation in the outer query works: SELECT id FROM descendants WHERE id <> 'ceo'. Use graph traversal instead Graph traversal is another way to follow stored relationships, but direction matters. The reports_to relation below points from an employee to a manager. Its forward BFS walks up the organization; it is not a replacement for the SQL descendant query above. Starting that forward walk at ceo returns no descendants in this sample dataset. Use reverse relationship lookup when finding the people who report to a manager. # A hierarchy walk via the graph endpoint instead of WITH RECURSIVE. # Assumes the schema declares manager_id as a [[relations]] block: # # [[relations]] # name = "reports_to" # from_col = "manager_id" # bidirectional = true # # [relations.target] # namespace = "hr" # table = "employees" # pk = "id" curl "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/hr.employees/bfs?rel=reports_to&pk=ceo&max_depth=10" \ -H "Authorization: Bearer $OC_TOKEN" See Graph reference for BFS, shortest path, k-shortest, and the other 16 graph algorithms. Schema reference → relations covers how to declare the relation. Choose SQL or graph traversal BFS takes max_depth as an explicit per-request argument. WITH RECURSIVE is capped too, but by fixed engine limits you tune the query around rather than pass in. Forward + reverse traversal are both indexed (bidirectional relations) - "who reports to X" and "who does Y report to" are equally fast. For weighted paths or shortest-path, you can swap BFS for Dijkstra or k-shortest without rewriting the schema. Expected result Each round adds the next level until there are no new rows or an execution limit is reached. Continue Continue to explore nearby connections. Calculate across related rows Previous Page SQL Server wire examples Next Page --- ## SQL Server wire examples | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sqlserver Sqlserver SQL Server wire examples ← All examples TDS is the connection protocol used by SQL Server clients. These recipes describe existing preview TDS listeners and their limited query compatibility. SQL Server is not offered as a new connection method. The dated driver results apply only to the tested forms. Read invoice data through an existing TDS listenerTDS is an existing preview connection path, not a new listener created by these examples. 01 Prepare the invoice sampleCreate and load it through an authorized interface. 02 Connect a supported driverUse Java or Go with verified TLS. 03 Query the top invoicesRun the documented ordering and result-limit form. 04 Inspect the five rowsCheck the returned invoice fields and amount order. Existing SQL Server listener examples Connect Java to an existing TDS listener — Use the SQL Server JDBC driver over TLS. Connect Go to an existing TDS listener — Use go-mssqldb over TLS. Reuse a parameterized statement — Prepare a supported SQL statement and bind new values for each execution. Use supported T-SQL forms — The listener translates selected T-SQL query syntax into engine SQL. Recognize unsupported T-SQL — Some T-SQL constructs have no supported equivalent here. Prepare the invoice data The Java and Go examples read a table named invoices. Ask an administrator to create and load it through an authorized writable interface in the namespace resolved by your connection. Keep read-only credentials read-only; do not change permissions to make a tutorial run. Small invoice table and five rows Run each statement separately. Use a disposable table; existing invoices must not be overwritten for this example. CREATE TABLE invoices ( id BIGINT PRIMARY KEY, customer_ref TEXT, amount_cents BIGINT, status TEXT ); INSERT INTO invoices (id, customer_ref, amount_cents, status) VALUES (4101, 'ACME-77', 129900, 'open'), (4088, 'ACME-12', 98450, 'open'), (4077, 'ORBIT-3', 61000, 'open'), (4051, 'ACME-77', 44900, 'open'), (4020, 'ORBIT-9', 12750, 'open'); The five amounts appear in descending order in the connection examples. A successful connection with an empty result is different from a connection failure; check the selected namespace and loaded rows. Check the connection first Read the compatibility requirements. Confirm the existing listener, TLS and credential mode before running a write. Current PostgreSQL database logins are read-only; they are not a replacement connection for the write examples on this page. Microsoft, SQL Server and T-SQL are trademarks of the Microsoft group of companies; mssql-jdbc and go-mssqldb are Microsoft's own drivers. They are named here only to describe protocol and dialect compatibility and to identify the versions it was measured against. OriginChainDB is not affiliated with, endorsed by, or sponsored by Microsoft, and does not distribute Microsoft software. Follow a hierarchy Previous Page Connect Go to an existing TDS listener Next Page --- ## Connect Go to an existing TDS listener | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sqlserver/connect-go Sqlserver Connect Go to an existing TDS listener ← SQL Server wire examples Use go-mssqldb over TLS. Build its URL safely so special characters in credentials are encoded. Before you run it: Keep certificate validation on. The driver-bound @p1 parameter is not a general T-SQL variable. Load the invoice sample first. Add the github.com/microsoft/go-mssqldb driver to your Go module. A DSN is the connection address plus settings; net/url encodes its credential fields safely. The four environment variables identify the existing host, database, user and password. Build a safe Go connection and test itsql.Open creates a handle; Ping verifies that the connection works. 01 Load the invoice sampleUse the existing preview listener and test database. 02 Build the connection URLUse net/url to encode credentials and keep TLS verification. 03 Open and pingCheck connectivity before issuing an application request. 04 Run the bound queryPass the value through @p1 and inspect the invoices. Follow the example Confirm the existing preview listener is available. Build the DSN with net/url. Open the handle and call Ping. Run the bound-parameter query. Run the example package main import ( "database/sql" "fmt" "net/url" "os" _ "github.com/microsoft/go-mssqldb" ) func dsn() string { q := url.Values{} q.Set("database", os.Getenv("OC_DATABASE")) q.Set("encrypt", "true") // mandatory - the only way in q.Set("TrustServerCertificate", "false") // validate the chain q.Set("dial timeout", "30") u := url.URL{ Scheme: "sqlserver", // url.UserPassword escapes for you. Never build this by hand. User: url.UserPassword(os.Getenv("OC_DB_USER"), os.Getenv("OC_DB_PASSWORD")), Host: os.Getenv("OC_SQL_HOST") + ":1433", RawQuery: q.Encode(), } return u.String() } func main() { db, err := sql.Open("sqlserver", dsn()) if err != nil { panic(err) } defer db.Close() // sql.Open is lazy. Ping is the first thing that actually connects. if err := db.Ping(); err != nil { panic(err) } rows, err := db.Query( "SELECT TOP 5 id, customer_ref, amount_cents"+ " FROM invoices WHERE status = @p1 ORDER BY amount_cents DESC", "open") if err != nil { panic(err) } defer rows.Close() for rows.Next() { var id, cents int var ref string if err := rows.Scan(&id, &ref, ¢s); err != nil { panic(err) } fmt.Printf("%d %-12s %d\n", id, ref, cents) } if err := rows.Err(); err != nil { panic(err) } } Check the result Ping checks the connection because sql.Open alone may not connect. 4101 ACME-77 129900 4088 ACME-12 98450 4077 ORBIT-3 61000 4051 ACME-77 44900 4020 ORBIT-9 12750 Important details sql.Open does not connect. If a listener is missing or a certificate is unloadable you will not learn it until Ping or the first query, so call Ping at start-up rather than discovering it inside a request. This driver names parameters @p1, @p2, and so on. That is the driver's placeholder syntax and it is fine — it is rewritten to a positional bind before the statement reaches the engine. It is not the same thing as a T-SQL @variable, which is refused. Leave TrustServerCertificate at false. Turning it on does not make a broken listener work — there is no listener to reach when the certificate is the problem — it only stops you noticing who you are talking to. Microsoft, SQL Server and T-SQL are trademarks of the Microsoft group of companies; go-mssqldb is Microsoft's own driver. Named here only to describe protocol compatibility and to identify the version it was measured against. OriginChainDB is not affiliated with, endorsed by, or sponsored by Microsoft, and does not distribute Microsoft software. Recorded driver check: microsoft/go-mssqldb 1.11.0, 21 of 21 checks, on 2026-09-07. This is a historical test record. Continue Continue to reuse a parameterized statement. SQL Server wire examples Previous Page Connect Java to an existing TDS listener Next Page --- ## Connect Java to an existing TDS listener | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sqlserver/connect-jdbc Sqlserver Connect Java to an existing TDS listener ← SQL Server wire examples Use the SQL Server JDBC driver over TLS. TDS is the protocol used by SQL Server clients; the described listener is a preview feature. Before you run it: Dated driver checks below apply to those tested forms, not every SQL Server feature or current production connection. Load the invoice sample first and place the supported SQL Server JDBC driver on your Java classpath. JDBC is Java's database connection interface. Replace the environment placeholders with the existing listener details; the query does not create its table or rows. Read invoices with the Java driverKeep encryption and certificate validation enabled for the existing preview listener. 01 Load five sample invoicesPrepare the table before connecting the example client. 02 Connect with JDBCUse the documented driver settings without putting secrets in logs. 03 Run the TOP queryThe adapter translates the supported limit syntax. 04 Read the ordered resultsCheck the returned invoice amounts against the sample. Follow the example Confirm the existing listener is enabled. Use the shown driver and connection settings. Keep certificate validation on. Run the small query. Set connection variables export OC_SQL_HOST=... # the endpoint your console shows export OC_DATABASE=... export OC_DB_USER=... export OC_DB_PASSWORD=... # never inline this in the URL Run the example import java.sql.*; public class Connect { public static void main(String[] args) throws Exception { String url = "jdbc:sqlserver://" + System.getenv("OC_SQL_HOST") + ":1433" + ";databaseName=" + System.getenv("OC_DATABASE") // TLS is mandatory. Without it there is no listener to reach. + ";encrypt=true" // Validate the chain. Only relax this against a test instance. + ";trustServerCertificate=false" + ";hostNameInCertificate=" + System.getenv("OC_SQL_HOST") + ";loginTimeout=30"; try (Connection conn = DriverManager.getConnection( url, System.getenv("OC_DB_USER"), System.getenv("OC_DB_PASSWORD")); Statement st = conn.createStatement(); ResultSet rs = st.executeQuery( "SELECT TOP 5 id, customer_ref, amount_cents" + " FROM invoices ORDER BY amount_cents DESC")) { while (rs.next()) { System.out.printf("%d %-12s %d%n", rs.getInt("id"), rs.getString("customer_ref"), rs.getInt("amount_cents")); } } } } Check the result The example checks connection setup and the documented driver forms. 4101 ACME-77 129900 4088 ACME-12 98450 4077 ORBIT-3 61000 4051 ACME-77 44900 4020 ORBIT-9 12750 Important details encrypt=true is not a hardening option here, it is the only way in. A listener with no loadable certificate never binds, so a certificate problem shows up as a connection that finds nothing at all: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host ..., port 1433 has failed. If that is what you see, check the certificate before the firewall. Then check whether a listener was ever enabled — it is off by default on every instance. TOP 5 is translated to a LIMIT. The translated set lists what else is rewritten, and the refused set lists what is not. Keep the password out of the URL. The driver takes it as a separate argument, and a URL is the thing that ends up in a log. Microsoft, SQL Server and T-SQL are trademarks of the Microsoft group of companies; mssql-jdbc is Microsoft's own driver. Named here only to describe protocol compatibility and to identify the versions it was measured against. OriginChainDB is not affiliated with, endorsed by, or sponsored by Microsoft, and does not distribute Microsoft software. Recorded driver check: mssql-jdbc 13.4.0 and 12.10.1, 34 of 34 checks each, on 2026-09-07. This is a historical test record. Continue Continue to reuse a parameterized statement. Connect Go to an existing TDS listener Previous Page Reuse a parameterized statement Next Page --- ## Reuse a parameterized statement | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sqlserver/prepared-statements Sqlserver Reuse a parameterized statement ← SQL Server wire examples Connection requirements This recipe needs an existing listener using shared credentials. A per-user TDS session is read-only. Database RBAC grants or row-level policies require that per-user model, so the writes below do not apply there. Check credential requirements. Use the HTTP API for authorized writes when this listener is read-only. Current PostgreSQL database logins are also read-only. Prepare a supported SQL statement and bind new values for each execution. The examples cover repeated execution and a transaction batch. Before you run it: Per-user credentials and current PostgreSQL database logins are read-only. Driver preparation does not support arbitrary stored procedures. Start with the Java connection example and invoice table. This is a fragment: supply its url, user and password, import java.sql.* and java.util.List, and define rows as four-value entries (id, customer_ref, amount_cents, status) using unused IDs. The read loop can run without the later insert batch when the connection is read-only. Reuse a statement while binding new valuesA prepared handle belongs to its connection; writes still require the documented shared-credential mode. 01 Prepare the statementKeep the parameterized query on one connection. 02 Bind the next valuesPass values separately from the SQL text. 03 Execute and reuseCheck each result before changing the bound values. 04 Close the statementRelease its handle and verify any transaction outcome. Follow the example Confirm shared-credential write access. Prepare on the connection. Bind values and execute. Close the statement and check committed rows. Run the example // One PreparedStatement, executed many times, then a batch insert. // The driver turns this into the RPC procedure family on its own - // you never name those procedures yourself. try (Connection conn = DriverManager.getConnection(url, user, password)) { try (PreparedStatement ps = conn.prepareStatement( "SELECT id, customer_ref FROM invoices" + " WHERE status = ? AND amount_cents > ?")) { for (String status : List.of("open", "settled", "void")) { ps.setString(1, status); ps.setInt(2, 50000); try (ResultSet rs = ps.executeQuery()) { while (rs.next()) { System.out.println(status + " " + rs.getInt("id")); } } } } // close() frees the server-side handle conn.setAutoCommit(false); try (PreparedStatement ins = conn.prepareStatement( "INSERT INTO invoices (id, customer_ref, amount_cents, status)" + " VALUES (?, ?, ?, ?)")) { for (Object[] row : rows) { ins.setInt(1, (Integer) row[0]); ins.setString(2, (String) row[1]); ins.setInt(3, (Integer) row[2]); ins.setString(4, (String) row[3]); ins.addBatch(); } int[] counts = ins.executeBatch(); // every statement runs System.out.println("inserted " + counts.length + " rows"); } conn.commit(); } Supported driver calls A SQL Server driver does not send that statement the same way twice. It switches to a prepared handle, and which call it uses depends on the driver and on how many times you have executed: execution 1 sp_executesql statement text + parameter declarations execution 2 sp_prepexec prepare and execute in one round trip -> returns a handle execution 3 sp_execute the handle, with fresh values close sp_unprepare free the handle These are driver protocol calls, not procedures you write yourself. The recorded compatibility check exercised repeated execution and closing the handle; check the supported driver and listener version before adopting the pattern. Unsupported uses Those procedure names belong to the protocol, not to your schema. Serving them is what makes a prepared statement work; it is not stored-procedure support. Calling a procedure you wrote is refused, as is every other procedure by name or by numeric id. -- Calling a procedure YOU wrote is a different thing, and is refused. EXEC dbo.settle_invoice @id = 4101; -- error: that procedure surface does not exist on this engine OriginChainDB has a separate PL/pgSQL-shaped procedure interface through the SQL endpoint. It is not T-SQL stored-procedure support. See the TDS procedure comparison. The current PostgreSQL database-login path is read-only. Important details Handles are per connection. They are freed on every teardown path, they are never recycled after a close, and one connection can never see another's. executeBatch runs every statement in the batch. Earlier builds parsed only the first request in a message and dropped the rest, reporting success for statements that never ran; that is fixed and pinned. OUTPUT parameters are refused, because there is no variable-assignment surface that could produce one. Return values through a result set instead. Integer, floating point, bit, string, numeric and unique-identifier parameters decode exactly. Date and time parameters are best-effort in this preview — their epoch base differs from the engine's stored form. Microsoft, SQL Server and T-SQL are trademarks of the Microsoft group of companies. Named here only to describe protocol and dialect compatibility. OriginChainDB is not affiliated with, endorsed by, or sponsored by Microsoft, and does not distribute Microsoft software. Expected result The driver uses supported prepared-statement calls without concatenating values into SQL. Continue Continue to use supported t-sql forms. Connect Java to an existing TDS listener Previous Page Recognize unsupported T-SQL Next Page --- ## Recognize unsupported T-SQL | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sqlserver/tsql-refused Sqlserver Recognize unsupported T-SQL ← SQL Server wire examples Some T-SQL constructs have no supported equivalent here. Use a documented alternative only after checking that its meaning fits the task. Before you run it: General variables, temporary objects, MERGE and stored procedures are outside this surface. Driver-bound parameters are separate. The statements marked refused are intentional failure cases, not setup instructions. Compare the documented alternative beside each one. To test an invoice query, first load the invoice sample. Replace unsupported T-SQL with an explicit approachA refusal prevents the adapter from pretending that unsupported behavior works. 01 Identify the refused constructFind the unsupported procedure, variable, temporary table or batch syntax. 02 Read the documented boundarySeparate driver parameters from general T-SQL features. 03 Choose a supported approachUse bound values or application logic where the recipe explains it. 04 Check equivalent behaviorVerify the replacement returns or changes the intended data. Follow the example Find the construct below. Read why it is refused. Use the stated alternative if appropriate. Test the revised result. Variables are not supported -- refused DECLARE @cutoff INT = 100000; SELECT id FROM invoices WHERE amount_cents > @cutoff; SELECT @@VERSION; SELECT @@ROWCOUNT; -- do this instead: bind the value as a parameter, so the driver -- carries it and the engine never sees a variable at all. -- JDBC: ps.setInt(1, 100000) -- Go: db.Query("... amount_cents > @p1", 100000) -- Row counts come back through the driver's own update-count API. Note the difference between a T-SQL variable and a driver placeholder. The Go driver writes @p1 for a bind parameter and that is fine — it is rewritten to a positional bind before the statement is parsed. A variable you declared yourself is a different thing, and there is nowhere for it to live. Temporary objects are not supported -- refused SELECT id, amount_cents INTO #recent FROM invoices WHERE status = 'open'; SELECT * FROM #recent; -- do this instead: an ordinary table, or a CTE if the scope is one query. WITH recent AS ( SELECT id, amount_cents FROM invoices WHERE status = 'open' ) SELECT * FROM recent; Keep GO out of requests -- refused: GO is a client-tool directive, not a server statement. INSERT INTO invoices (id, status) VALUES (1, 'open'); GO INSERT INTO invoices (id, status) VALUES (2, 'open'); GO -- do this instead: send one statement per batch. Your driver already -- does that unless you are pasting a script written for a query tool. This one is caught before parsing rather than after, because a SQL Server grammar reads a trailing GO as a column alias — so SELECT 1 GO would parse cleanly and mean something you did not write. A standalone GO line is what is rejected; go used as a column name is untouched. MERGE is not supported -- refused MERGE invoices AS t USING staged AS s ON t.id = s.id WHEN MATCHED THEN UPDATE SET t.status = s.status WHEN NOT MATCHED THEN INSERT (id, status) VALUES (s.id, s.status); -- do this instead INSERT INTO invoices (id, status) SELECT id, status FROM staged ON CONFLICT (id) DO UPDATE SET status = EXCLUDED.status; Check date arithmetic support -- refused: there is no calendar timestamp type behind this surface, -- so there is no sound mapping. Timestamps are ISO-8601 strings. SELECT DATEADD(day, -7, GETDATE()); SELECT DATEDIFF(day, created_at, GETDATE()); SELECT CONVERT(VARCHAR(10), created_at, 112); -- style code = formatting -- do this instead: compute the boundary in your application and bind it. -- Instant cutoff = Instant.now().minus(7, ChronoUnit.DAYS); -- ps.setString(1, cutoff.toString()); SELECT id FROM invoices WHERE created_at >= ?; This surface cannot perform the requested calendar date arithmetic. Calculate it in the application using the required calendar and timezone rules, then bind the resulting values. Other supported queries -- refused: no LIMIT equivalent SELECT TOP 10 PERCENT * FROM invoices; SELECT TOP 10 * FROM invoices ORDER BY amount_cents DESC WITH TIES; -- refused: constrain the statement with a predicate instead DELETE TOP (100) FROM invoices WHERE status = 'void'; -- refused: the INTO clause would be dropped, and the statement would -- report a successful table copy that created nothing. SELECT * INTO invoices_archive FROM invoices; -- do this instead: declare the target, then fill it. CREATE TABLE invoices_archive ( id INT NOT NULL, customer_ref VARCHAR(64), amount_cents INT, status VARCHAR(16) ); INSERT INTO invoices_archive SELECT * FROM invoices; -- refused: ambiguous in T-SQL itself - the column's declared type decides -- whether this concatenates or adds. SELECT 'INV-' + some_column; -- do this instead SELECT CONCAT('INV-', CAST(some_column AS VARCHAR(64))); Stored procedures are not supported -- refused: T-SQL procedures are not a surface this engine has. CREATE PROCEDURE dbo.settle_invoice @id INT AS BEGIN UPDATE invoices SET status = 'settled' WHERE id = @id; END; GO EXEC dbo.settle_invoice @id = 4101; -- OriginChainDB's procedures are a PL/pgSQL-shaped subset and are created -- and called over the SQL endpoint or the PostgreSQL wire. This is a -- rewrite in a different language, not a port. If your application's logic lives in stored procedures, this is the line item that decides the size of the project, and no amount of wire compatibility reduces it. Read the procedures section of the TDS reference, which shows one procedure written both ways, before you estimate. Microsoft, SQL Server and T-SQL are trademarks of the Microsoft group of companies. PostgreSQL is a registered trademark of the PostgreSQL Community Association of Canada. Named here only to describe protocol and dialect compatibility. OriginChainDB is not affiliated with, endorsed by, or sponsored by any of them, and does not distribute their software. Expected result Unsupported constructs produce errors rather than full SQL Server behavior. Continue Continue to use supported t-sql forms. Reuse a parameterized statement Previous Page Use supported T-SQL forms Next Page --- ## Use supported T-SQL forms | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/sqlserver/tsql-translated Sqlserver Use supported T-SQL forms ← SQL Server wire examples Connection requirements This recipe needs an existing listener using shared credentials. A per-user TDS session is read-only. Database RBAC grants or row-level policies require that per-user model, so the writes below do not apply there. Check credential requirements. Use the HTTP API for authorized writes when this listener is read-only. Current PostgreSQL database logins are also read-only. The listener translates selected T-SQL query syntax into engine SQL. Check each form before adapting an existing query. Before you run it: This is query compatibility, not a procedural T-SQL runtime. Writes require the listener’s shared-credential mode. Each pair below shows the SQL you send and its translated equivalent. Run one version, not both as a script. The invoice queries can use the invoice sample; the [order] example illustrates quoting and needs a table with those exact names. Check how supported T-SQL reaches the engineSimilar syntax can differ in null, string or type behavior; inspect the documented translations. 01 Choose a supported formUse the listed quoting, paging, function or type example. 02 Translate to engine SQLThe adapter rewrites that documented form. 03 Check the meaningReview null handling and any type or function differences. 04 Verify the returned dataRun one version and compare its output with expectations. Follow the example Choose a translated form below. Keep its type and NULL behavior. Run it through an existing listener. Compare rows with the expected result. Quote identifiers -- you send SELECT [order].[id], [customer name] FROM [order] WHERE [status] = 'open'; -- the engine executes SELECT "order".id, "customer name" FROM "order" WHERE status = 'open'; A plain, non-reserved name loses its brackets. A name with spaces or punctuation, or one that is a reserved word, becomes a double-quoted identifier instead — so [order] keeps working. If a bracket identifier ever survives the rewrite, the statement is refused rather than passed on under a name the engine would read differently. Read the next page -- you send SELECT TOP 20 id FROM invoices ORDER BY amount_cents DESC; SELECT id FROM invoices ORDER BY id OFFSET 40 ROWS FETCH NEXT 20 ROWS ONLY; -- the engine executes SELECT id FROM invoices ORDER BY amount_cents DESC LIMIT 20; SELECT id FROM invoices ORDER BY id LIMIT 20 OFFSET 40; FETCH is translated before execution. PERCENT and WITH TIES are refused because this path has no equivalent behavior. Use supported functions -- you send SELECT ISNULL(status, 'open') AS status, LEN(customer_ref) AS ref_len, CHARINDEX('-', customer_ref) AS dash_at, IIF(amount_cents > 100000, 'L', 'S') AS bucket, CONVERT(NVARCHAR(32), amount_cents) AS amount_text, GETDATE() AS seen_at FROM invoices; -- the engine executes SELECT COALESCE(status, 'open') AS status, LENGTH(customer_ref) AS ref_len, POSITION('-' IN customer_ref) AS dash_at, CASE WHEN amount_cents > 100000 THEN 'L' ELSE 'S' END AS bucket, CAST(amount_cents AS VARCHAR(32)) AS amount_text, now() AS seen_at FROM invoices; SUBSTRING, REPLACE, LTRIM, RTRIM, UPPER and LOWER need no rewrite. Two differences worth knowing before you rely on them: LEN counts trailing spaces; T-SQL trims them. GETDATE() returns an ISO-8601 UTC string, and every call in one statement returns the same value. Combine strings -- translated: both operands are provably string SELECT 'INV-' + customer_ref -> CONCAT('INV-', customer_ref) -- untouched: both operands are numeric, so this stays arithmetic SELECT amount_cents + tax_cents -> amount_cents + tax_cents -- REFUSED: one string, one unknown. In T-SQL the column's declared type -- decides whether this concatenates or adds, and guessing would be wrong -- half the time. Write CONCAT(...) or CAST(...) and say which you meant. SELECT 'INV-' + some_column -> error Where it does translate, note that CONCAT treats NULL as empty while T-SQL's + propagates it. If NULL handling matters in that expression, write the CASE you mean. Choose supported column types -- you send CREATE TABLE [audit log] ( [id] UNIQUEIDENTIFIER NOT NULL, [note] NVARCHAR(200), [detail] NTEXT ); -- the engine executes CREATE TABLE "audit log" ( id UUID NOT NULL, note VARCHAR(200), detail TEXT ); T-SQL type spellings are normalized in DDL column definitions as well as in casts — but only the ones that change no value representation. The rest are left exactly as you wrote them, on purpose: Normalized: NVARCHAR(n), NCHAR, NTEXT and UNIQUEIDENTIFIER. Left alone, and therefore refused by the engine: BIT (whose T-SQL literals are 1 and 0, not true and false), MONEY and DATETIME2. Mapping them would silently change what the value means, so you get an error and choose a type yourself. Microsoft, SQL Server and T-SQL are trademarks of the Microsoft group of companies. Named here only to describe dialect compatibility. OriginChainDB is not affiliated with, endorsed by, or sponsored by Microsoft, and does not distribute Microsoft software. Expected result Supported forms cover selected quoting, pagination, functions and types. Continue Continue to recognize unsupported t-sql. Recognize unsupported T-SQL Previous Page Vector examples Next Page --- ## Vector examples | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/vector Vector Vector examples ← All examples Start by writing an embedding, then choose the distance metric recommended by the model that produced it. The maintenance recipes cover index coverage, repair and compression. Check the vector write-and-search loopThe three-number sample tests the API; it is not an example of text meaning. 01 Store sample-1Write the complete three-value vector into learning.sample. 02 Search with the same valuesKeep dimension and metric identical to the write. 03 Check the returned IDLook for sample-1 before moving to model-generated embeddings. Try a complete small example This uses three made-up numbers to check the write-and-search flow. It does not demonstrate the meaning of text. Use the tenant-scoped connection from the connection notes, and keep learning.sample separate from collections using a different dimension or metric. First save one vector: curl --fail-with-body -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/learning.sample/put" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '{"id":"sample-1","embedding":[1.0,0.0,0.0],"dim":3,"metric":"cosine"}' Then search with the same three values: curl --fail-with-body -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/learning.sample/topk" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '{"query":[1.0,0.0,0.0],"k":1,"dim":3,"metric":"cosine"}' Look for sample-1 in the result. k: 1 asks for at most one match. The dimension and metric agree in both requests. Next, use a real embedding from your chosen model; the model supplies the numbers, while the database stores and compares them. Search by similarity Store one embedding — An embedding is a list of numbers that represents an item for similarity search. Attach filters to an embedding — Store small metadata fields beside an embedding so a search can be restricted to matching items. Find similar vector directions — Cosine similarity compares vector direction rather than magnitude. Find the nearest points — L2 is Euclidean distance: the straight-line distance between vectors. Search by dot product — Dot product compares both direction and magnitude. Compare speed and retrieval quality — Fast mode searches a narrower part of the index. Search within matching metadata — Combine similarity with exact metadata filters. Remove vectors from an index — Delete embeddings that are no longer needed. Group vectors for IVF search — IVF divides vectors into groups around representative points called centroids. Check IVF coverage and balance — Inspect whether stored vectors are covered by the index and whether one partition contains too many entries. Check and repair the search graph — HNSW links nearby vectors in a graph. Build a compressed vector index — IVF-PQ represents vector groups with compact codes. Combine dense and sparse matches — Dense embeddings capture similarity. Before adapting a recipe Use a test database, load the named sample data, and check the expected result. Read each page’s limits before changing the query. See connection and SDK notes. Use supported T-SQL forms Previous Page Group vectors for IVF search Next Page --- ## Group vectors for IVF search | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/vector/centroids Vector Group vectors for IVF search ← Vector examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. IVF divides vectors into groups around representative points called centroids. Training these points prepares the index to search selected groups. Before you run it: Training needs at least four vectors per partition. Reinstalling replaces the centroid matrix and postings. First store a representative set of vectors in shop.products. The request below asks for 1,024 partitions, so its minimum training set is 4,096 vectors. A one-vector quickstart is not enough. A partition is a group of nearby vectors; postings are the entries that assign vectors to those groups. Train IVF groups and check their coverageThe 1,024-partition example needs at least 4,096 stored training vectors. 01 Load representative vectorsProvide enough vectors for the chosen partition count. 02 Train and install centroidsCreate representative points for the groups. 03 Check assigned postingsRead how many stored vectors received group entries. 04 Inspect coverageInvestigate skipped population instead of assuming every vector is searchable. Follow the example Store enough vectors for the partition count. Run train-and-install-centroids. Wait for the synchronous request. Read the installed-centroid summary. Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/train-and-install-centroids" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "partitions": 1024, "init": "kmeans_plus_plus", "max_iterations": 50, "batch_size": 1024, "convergence_threshold": 1e-5, "seed": 42 }' Check the result The index installs centroids and builds postings for stored vectors without ingesting them again. { "trained": true, "installed": true, "partitions": 1024, "dim": 768, "iterations": 37, "converged": true, "last_max_shift": 0.0000073, "training_corpus_size": 100000, "populated": 100000 } // populate_skipped is present only when the backfill did not run. populated is the number of stored vectors that got a cell posting from this call. When it is well below training_corpus_size, or a populate_skipped string is present, the index is installed but not fully covering the corpus - the coverage report will show it. Request options FieldRequiredNotes partitionsyesHow many Voronoi cells to train. The engine caps this at 65,536, and refuses below the k-means floor described under common mistakes. initno"kmeans_plus_plus" or "random_sample". Defaults to "random_sample". max_iterationsnoMini-batch iteration cap. Defaults to 100. batch_sizenoMini-batch size. Defaults to 1024. convergence_thresholdnoEarly-stop threshold on the per-iteration maximum centroid shift. Defaults to 1e-4. seednoPRNG seed. Pass one if you want two runs over the same corpus to produce the same partitioning. Inspect installed centroids curl "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/centroids" \ -H "Authorization: Bearer $OC_TOKEN" Read the centroid summary { "installed": true, "partitions": 1024, "dim": 768, "centroids_preview": [ [0.0124, -0.0883, 0.0451, 0.0037, -0.0192, 0.0608, -0.0271, 0.0115] /* ... first 4 centroids, first 8 dims of each ... */ ] } The preview is deliberately truncated to the first 4 centroids and the first 8 dimensions of each, so the response stays small whatever partitions × dim is. It is an "is anything installed" check, not a way to export the matrix. A table with nothing installed answers 200 with "installed": false and zeroes - not 404. Understand the behavior The trainer reads up to one million stored vectors, runs mini-batch k-means to max_iterations or until the maximum centroid shift falls under convergence_threshold, and writes the matrix in a single batch. Steps before that write touch nothing, so a failure leaves the previous partitioning in place. Installing is a full replace, and a replace re-draws the cell boundaries. That is why the install then purges the old cell postings and streams the stored corpus back through the new assignment, one page at a time - reading under a short shared lock, assigning with no lock held, appending under a short exclusive one. The walk is not capped: every stored vector gets a posting. If you already have a centroid matrix from your own training run, POST /v1/tenants/:t/vector/:table/install-centroids takes it directly as {"centroids": [[...], [...]]} and derives partitions and dim from the shape of what you send. Important limits and checks Training on too few vectors. The engine refuses with 400 when the stored count is under partitions × 4. Past that floor k-means puts several centroids on the same point. Lower partitions or ingest more before training. Querying IVF before installing. A "index": "ivf" query against a table with no centroids returns 503 with "error": "ivf_centroids_not_installed" and an install_url pointing here. Assuming it is quick. Training and the backfill both run synchronously inside the request. On a large corpus the call holds the connection for seconds - set a generous client timeout. Re-installing and expecting the old postings to survive. They do not, and should not: new centroids mean new cells. The purge and re-populate is the point, and re-running the route converges to the same end state. Reading centroids_preview as the full matrix. It contains up to four centroids and up to eight dimensions from each. Smaller matrices produce a smaller preview. Continue Continue to check ivf coverage and balance. Vector examples Previous Page Remove vectors from an index Next Page --- ## Remove vectors from an index | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/vector/delete Vector Remove vectors from an index ← Vector examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Delete embeddings that are no longer needed. Choose the correct index family and use bulk deletion for a list of IDs. Before you run it: Deleting a source row is separate. Review HNSW repair, bulk limits and ID limits below. For a safe trial, write the sample vector with ID sku-9281 in a disposable table, then delete that ID. The first result should report an existing entry; a second delete should report that it is already absent. Deleting a vector does not delete the source product row. Remove a vector from the correct indexDeleting an embedding does not delete its separate source row. 01 Confirm the IDs and familySelect HNSW, IVF or IVF-PQ for the intended entries. 02 Send the bounded deletionUse a single ID or a list within the bulk limit. 03 Check deletion resultsInspect existence flags or distinct deleted counts. 04 Review HNSW repairDecide whether deleted-node links need the optional repair. Follow the example Confirm IDs and index family. Run a single or bulk delete. Check the returned result or count. For HNSW, decide whether to repair graph links too. Run the request curl -X DELETE "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/sku-9281" \ -H "Authorization: Bearer $OC_TOKEN" Check the result A single delete reports whether the entry existed; bulk deletion counts distinct deleted entries. { "deleted": true } deleted is false when nothing was stored under that id. Nothing is written on that path, so a retry costs you a round trip and nothing else. Query options FieldRequiredNotes indexno"hnsw" (default), "ivf" or "ivf_pq". Picks which index family the delete dispatches into. repairnoHNSW only. true re-links the deleted node's neighbours across the hole instead of leaving a tombstone. Ignored on the IVF and IVF-PQ arms, which shrink their posting lists cleanly. Delete several IDs curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/delete-bulk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "ids": ["sku-9281", "sku-1144", "sku-5520"], "index": "hnsw", "repair": true }' Check the deletion count { "deleted_count": 2, "missing_count": 1 } The two counts always sum to the number of distinct ids you sent - duplicates inside one call are de-duplicated server-side and count once. Understand the behavior On the HNSW arm a delete tombstones the node: the graph slot stays, the embedding goes. repair: true additionally re-links the neighbours across the hole, at a higher per-call cost. In bulk that repair runs as a single sweep at the end of the batch rather than once per id. On the IVF and IVF-PQ arms the id is evicted from its cell's posting list and the payload is deleted; there is no topology to repair. Every successful delete also decrements the tenant's stored-embedding counter, so the quota tracks embeddings currently resident rather than embeddings ever written. A bulk delete writes one entry to the destructive-operations audit trail carrying the counts, the index family and whether repair ran. The ids themselves are deliberately not logged - a vector id is customer-chosen and routinely a document or user key. Important limits and checks Treating a missing id as an error. Both routes return 200 for an id that was not there. Assert on deleted / deleted_count, not on the status code. Forgetting index on an IVF table. The dispatch defaults to HNSW. Delete an IVF row without ?index=ivf and the cell posting still lists it. Sending more than 10,000 ids. That is the per-request cap and it is a 400, not a truncation. Page your own list. Expecting repair to help an IVF delete. It is accepted on both arms so one client shape works everywhere, but it only does anything on HNSW. Very long ids. A vector id over 1 KiB is refused with 400 - the limit exists so the hash and write path stay bounded. Continue Continue to check and repair the search graph. Group vectors for IVF search Previous Page Check and repair the search graph Next Page --- ## Check and repair the search graph | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/vector/hnsw-health Vector Check and repair the search graph ← Vector examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. HNSW links nearby vectors in a graph. Health checks show whether the graph can reach the stored entries. Before you run it: Concurrent writes can conflict with rebuilding. Memory limits and supported diagnostic metrics are listed below. Use a table with a populated HNSW index, such as the single-vector setup expanded with representative data. HNSW is an index that links nearby vectors. A component is a disconnected group; an unreachable entry cannot be reached from the index's starting point. Start with the health request, not the rebuild. Inspect the search graph before rebuildingA rebuild needs the correct metric, sufficient memory and a plan for concurrent writes. 01 Run the health checkInspect disconnected components and unreachable vectors. 02 Review a dry runCheck the proposed metric, memory and rebuild plan. 03 Rebuild when justifiedPause conflicting writes and follow the documented limits. 04 Compare health afterwardsInspect the returned before-and-after reports. Follow the example Run the read-only health request. Inspect unreachable entries and components. Try a dry run before rebuilding. Plan memory use and pause writes if rebuilding. Run the request curl -G "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/hnsw-health" \ -H "Authorization: Bearer $OC_TOKEN" \ --data-urlencode "self_recall=512" Check the result A rebuild reconstructs the index from stored vectors. The health report also offers optional recall checks. { "table": "shop.products", "present": true, "nodes": 41892, "live": 41892, "tombstoned": 0, "reachable_live": 41892, "reachable_fraction": 1.0, "components": 1, "zero_indegree_live": 0, "indegree_percentiles": [1, 4, 9, 16, 27, 48, 91], // min p1 p10 p50 p90 p99 max "mean_outdegree": 15.8, "shattered": false, "damage": [], "build_metric": "cosine", "stored_vectors": 41892, "unindexed_records": 0, "verdict": "healthy: 41892 of 41892 live vectors retrievable, ...", "self_recall": { "metric": "cosine", "applicable": true, "probes": 512, "hits": 512, "self_recall": 1.0, "misses": [], "verdict": "healthy: all 512 probed vectors retrieve themselves ..." } /* plus per-layer shape, norm deciles and advisories */ } self_recall is present only when you ask for it. Everything else comes back on every call. Query options FieldRequiredNotes self_recallnoRun the self-retrieval probe over this many live vectors as well as the topology report. Absent or 0 skips it; the cap is 4096 because each sample is a real query inside this one request. metricnoMetric to probe under. Defaults to the recorded build metric, then the schema's declared distance, then cosine. dimnoVector width. Only needed when the probe runs and the table has no registered vector dimension. Understand the behavior The topology half walks the graph and counts. It catches the failure it was built for - a graph that reaches a small fraction of its own nodes, where no amount of beam widening recovers the rest - and it reports shattered: true with the reasons in damage. The topology half is structurally blind to one thing: an index built for one distance metric and queried under another. That graph is perfectly connected and reports every reachability field as healthy. ?self_recall=N asks the other question, and needs no ground truth to do it - under cosine, L2 or Manhattan a vector is its own exact nearest neighbour, so any miss is a defect. Under dot product that is not true, and the probe says so with "applicable": false rather than returning a number that would read as a failure. That makes the probe the tool for an unstamped index. Run it once per candidate metric; the one the graph was really built under is the one that comes back at 1.0. Then pass that metric to the rebuild, which records it beside the graph so nothing has to guess again. Rebuild the index curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/rebuild-hnsw" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "metric": "cosine", "dry_run": true }' Check the rebuild result { "tenant": "…", "table": "shop.products", "rebuilt": false, // false on a dry run "metric": "cosine", "build_metric_before": null, // null on an index built before the stamp "dim": 768, "vectors": 41892, "estimated_peak_bytes": 137070624, "estimated_build_secs": 55, "health_before": { /* the same report as GET hnsw-health */ }, "health_after": null, // null on a dry run "elapsed_ms": 412 } Drop dry_run to run it for real: rebuilt becomes true and health_after carries the post-rebuild report, so one response shows you the before and the after. Rebuild options FieldRequiredNotes metricconditionalRequired unless the table has a registered vector schema or a recorded build metric. The engine refuses rather than defaulting - a rebuild under the wrong metric produces a well-connected index for the wrong distance, which no health check can detect. dry_runnoReport the plan - current health, vector count, memory estimate, time estimate - and build nothing. Defaults to false. forcenoRebuild even when the diagnostic reads healthy. Defaults to false so a fleet sweep cannot spend hours reindexing tables that are fine. max_bytesnoOverride the per-request memory budget for the build. The default ceiling is 2 GiB; a rebuild whose estimate exceeds it is refused with the estimate in the message. Important limits and checks Rebuilding a table under write load. The build holds no lock, but the final swap refuses with 409 if any vector was written or deleted while it ran - overwriting the graph would leave the new embedding on disk and unreachable by every query. Nothing is written on that refusal, so a retry is free; a continuously written table will not converge until you pause writes to it. Rebuilding a healthy index. That is a 409, on purpose. Add "force": true if you mean it. Guessing the metric. If the table has no schema and no recorded build metric, the rebuild refuses instead of assuming cosine. Use ?self_recall= to find out which metric the graph matches, then state it. Reading self_recall under dot product. Self-retrieval is not a valid signal there, and the probe reports "applicable": false with the numeric fields zeroed. Calling it on a table with no HNSW index. The rebuild answers 404 - there is no graph to rebuild. An IVF or IVF-PQ table is the usual reason. Continue Continue to remove vectors from an index. Remove vectors from an index Previous Page Combine dense and sparse matches Next Page --- ## Combine dense and sparse matches | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/vector/hybrid-topk Vector Combine dense and sparse matches ← Vector examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Dense embeddings capture similarity. Sparse vectors hold selected features and weights. Hybrid search combines their ranked matches for the same record IDs. Before you run it: Sparse indices and values must have equal lengths. The endpoint is refused for row-restricted users; review the access requirements below. First write the dense embedding for sku-9281 in shop.products. The sparse write below uses the same ID. Dense means a full numeric array; sparse means only the non-zero positions and their weights. Use a consistent sparse vocabulary for documents and queries—the example positions do not generate themselves from text. Combine dense and sparse evidence for one itemThe two vector entries need the same ID and a consistent sparse feature vocabulary. 01 Store the dense embeddingWrite the full numeric vector under sku-9281. 02 Store its sparse featuresUse the same ID with matching feature positions and weights. 03 Search both representationsRequest candidates from the dense and sparse sides. 04 Read the fused rankingScores combine ranks; they are not ordinary cosine scores. Follow the example Write dense vectors. Write sparse vectors with the same IDs. Choose candidate counts and fusion settings. Run the hybrid query. Write sparse vectors curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/put_sparse" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "sku-9281", "indices": [17, 402, 5561], "values": [0.82, 1.40, 0.31], "dim": 30000 }' Check the write result 201 Created with an empty body, the same as the dense put. The id is what ties the two sides together: write the sparse vector under the same id as the dense one and the fusion can see both. Run the combined search curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/topk_hybrid" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "dense_query": [0.0124, -0.0883, /* ... 768 floats ... */], "dense_dim": 768, "dense_metric": "cosine", "sparse_query_indices": [17, 402], "sparse_query_values": [0.9, 1.2], "sparse_dim": 30000, "k": 10, "rrf_k": 60 }' Check the result The result uses a fused ranking score, not a cosine distance. [ { "id": "sku-9281", "score": 0.0325 }, { "id": "sku-1144", "score": 0.0161 }, { "id": "sku-5520", "score": 0.0156 } /* ... up to k entries ... */ ] // A bare array - the same hit shape the single-mode topk routes return. score here is the fused rank score, not a distance or a similarity. It is always positive and it compares two hits within one hybrid query - it does not compare to the cosine or L2 scores of an ordinary top-k. Request options FieldRequiredNotes dense_queryyesThe dense embedding. Its length must equal dense_dim. dense_dimyesDense vector width. Must match the table's dimension. dense_metricno"cosine" (default), "dot", "l2" or "manhattan". dense_modeno"fast" or "high_recall", tuning the dense leg only. sparse_query_indicesyesNon-zero component positions. Need not be sorted - the server sorts, and sums the values of any duplicate index. sparse_query_valuesyesThe values at those positions. Same length as the indices. sparse_dimyesFull sparse width. Every index must be strictly below it. kyesHow many fused hits to return. rrf_knoFusion constant, default 60. Raising it flattens the contribution any single list makes; lowering it sharpens it. candidatesnoHow many candidates to pull from each list before fusing. Defaults to the larger of 4k and 40, and is clamped to at least k. Larger means better recall and more work per query. filternoMetadata equality filter, applied to both legs before fusion. Same shape as the filter on the single-mode routes. Understand the behavior Each leg produces a ranked list of candidates hits. Fusion then scores every id by summing 1 / (rrf_k + rank) over the lists it appears in, and returns the top k. Because the sum is over ranks and not over scores, the two legs need no calibration against each other - which is the reason to fuse this way rather than by adding raw similarities. The consequence worth designing around: a document that places second in both lists beats a document that places first in one and is absent from the other. Appearing in both is the signal. Sparse vectors go into their own inverted index, which walks only the posting lists for the terms your query actually names. A document with no term in common with the query has a zero dot product and no defined rank, so it never surfaces from the sparse leg - it can still reach the result through the dense one. Important limits and checks Comparing a hybrid score to a top-k score. They are different quantities. A hybrid score near 0.03 is not "worse" than a cosine score of 0.94; it is a rank sum. Compare hybrid scores only to other hybrid scores from the same rrf_k. Writing the sparse and dense sides under different ids. The id is the join. Two ids means two documents, and fusion has nothing to combine. Sending an index equal to dim. Indices are zero-based and must be strictly below the width - an out-of-bounds component is a 400, on the write and on the query. Sending NaN or an infinity in values. Refused at the boundary with 400 rather than allowed to poison a score. Mismatched array lengths. indices and values must be the same length, on both the write and the query side. Calling it as a row-restricted user. The fused score encodes ranks assigned in lists that include rows a row-level policy would hide, so the route refuses for such a caller rather than serving a leak that looks fused. Continue Continue to find similar vector directions. Check and repair the search graph Previous Page Build a compressed vector index Next Page --- ## Build a compressed vector index | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/vector/ivf-pq-index Vector Build a compressed vector index ← Vector examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. IVF-PQ represents vector groups with compact codes. Choose a preset and decide whether original vectors must remain available. Before you run it: drop_raw_vectors removes original vectors. Restoring them requires ingestion again; it is a destructive choice, not a routine optimization. First store raw vectors in shop.products; an empty table cannot be trained. IVF groups nearby vectors, and product quantization (PQ) stores compact approximations of them. Keep the original vectors for this first test and measure whether the compressed index still finds the matches your application needs. Build a smaller representation and measure its matchesKeep raw vectors for the first trial; dropping them is a separate destructive choice. 01 Start with stored raw vectorsUse a populated table with reproducible source embeddings. 02 Choose the presetReview compression and exact re-ranking behavior. 03 Build the compressed indexConfirm raw_vectors_retained in the response. 04 Query with ivf_pqCompare useful matches before adopting the compressed index. Follow the example Start with stored raw vectors. Choose high_recall or compressed. Review keep_raw and drop_raw_vectors separately. Build and query with index: ivf_pq. Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/create-ivf-pq-index" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "preset": "high_recall", "seed": 42 }' Check the result The response reports the installed settings and retained data. { "trained": true, "installed": true, "preset": "high_recall", "partitions": 1024, "pq_m": 64, "pq_bits": 8, "keep_raw": true, "raw_vectors_retained": true, "dim": 768, "training_corpus_size": 100000 } keep_raw and raw_vectors_retained are different questions and are reported separately on purpose. The first is a query-time policy: may the exact re-rank read the raw vector back. The second is the footprint: are the raw vectors still on disk. Request options FieldRequiredNotes presetyes"high_recall" or "compressed". high_recall uses a finer quantizer and keeps the raw vector so the exact re-rank can run; compressed uses a coarser one and does not re-rank. seednoPRNG seed for the training run. Defaults to 0. Pass one if you need two builds over the same corpus to match. drop_raw_vectorsnoDestructive and opt-in. Discard the raw float embeddings table-wide as part of the build, keeping only the codes. Defaults to false: building an index never destroys data. There is no undo - set it only when the vectors are reproducible from your own source of truth. Understand the behavior The build reads the stored corpus first, because the preset resolves against it. The cell count comes from the corpus size - roughly four times its square root, rounded to a power of two and clamped between 64 and 65,536 - and the quantizer's subvector count comes from the vector dimension: the divisor of dim (at most 64) whose subspace width lands closest to the preset's target, which is 8 for high_recall and 16 for compressed. Codes are 8 bits wide either way. Then it trains, installs the codebook and the centroids, sets the keep_raw policy, and populates the cell postings in bounded chunks so a large corpus never holds the write lock across the whole build. Queries reach the index with "index": "ivf_pq" on the ordinary top-k route. On a table built with keep_raw, refine_k_factor controls how many candidates the exact re-rank re-scores; on a codes-only table there is nothing to re-score against and the field is ignored. Important limits and checks Asking for high_recall and drop_raw_vectors. That combination is refused with 400, and it should be: high_recall's accuracy comes from the exact re-rank, which reads the raw vector back. Honouring the drop would leave the policy pointing at deleted data and quietly degrade every query. Rebuilding a table whose raw vectors were dropped. An index build needs float vectors to train on, and codes cannot be turned back into them. That is a 400 telling you to re-ingest - the only fix. Building on an empty table. 400. Write the vectors first; the preset has nothing to resolve against otherwise. Reading keep_raw: false as "the vectors are gone". It means the exact re-rank will not run. Unless you passed drop_raw_vectors, raw_vectors_retained is still true and the compressed index costs the raw vectors on top of its codes. Calling it on a quorum-replicated tenant. The route refuses with 501 there. The build re-writes the whole corpus and is not expressible as one replicated frame, so accepting it could leave a promoted node with a half-built index. Continue Continue to check ivf coverage and balance. Combine dense and sparse matches Previous Page Check IVF coverage and balance Next Page --- ## Check IVF coverage and balance | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/vector/ivf-rebalance-status Vector Check IVF coverage and balance ← Vector examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Inspect whether stored vectors are covered by the index and whether one partition contains too many entries. This request reports status; it does not rebalance. Before you run it: Stale postings can inflate counts. A recommendation of none does not replace a coverage check. Complete centroid training first. This is an IVF status check, not a way to create that index. Coverage asks whether stored vectors have index entries; balance asks whether those entries are spread evenly across groups. Check coverage before interpreting the balance recommendation. Check coverage before judging IVF balanceThis request reports status; it does not automatically rebuild or rebalance the index. 01 Read IVF statusUse a table with installed centroids. 02 Compare stored and indexed countsCheck coverage and unindexed vectors first. 03 Inspect group sizesCompare the largest partition with the average. 04 Plan any retrainingUse the report to decide on a separate corrective action. Follow the example Request status for an IVF table. Check coverage. Compare the largest partition with its mean size. Use the recommendation to decide whether to retrain. Run the request curl "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/ivf-rebalance-status" \ -H "Authorization: Bearer $OC_TOKEN" Check the result The response includes counts, skew and a recommended action. { "total_live": 100000, "partitions": 1024, "live_per_cell": [112, 96, 143, 87 /* ... one entry per cell ... */], "skew": 1.46, "action": "none", "stored_vectors": 100000, "unindexed": 0, "coverage": 1.0 } action is one of "none", "recommended" or "required", set from skew against the engine's thresholds. Response fields FieldRequiredNotes total_live-Vectors with a cell posting, summed across every cell. partitions-Installed centroid count. Equals the length of live_per_cell. live_per_cell-Posting count per cell, indexed by cell id. A cell that was never written reports 0. skew-max(live_per_cell) / mean(live_per_cell), or 0.0 on an empty corpus. A perfectly even index sits at 1.0. action-"recommended" above a skew of 2.0, "required" above 5.0, otherwise "none". stored_vectors-Vectors stored under this table, counted from the keys, whether or not they are cell-assigned. unindexed-stored_vectors - total_live. Vectors with no cell posting: written before the centroids were installed, or left behind by a skipped backfill. coverage-total_live / stored_vectors, clamped to 1.0. This is the number to alert on. Understand the behavior The report walks each cell's posting list and counts entries; it does not decode the payloads behind them. That makes it cheap enough to poll, and it means "live" is a posting count rather than a verified row count - an index with stale postings from an interrupted re-install can over-report total_live. Re-training and re-installing is the cleanup, not a per-call scan. stored_vectors, unindexed and coverage exist for one failure shape that every other field hides: a table with ten thousand vectors stored and zero of them indexed. Nothing else on this response raises a flag there - every cell is empty, so skew is 0.0 and action is "none" - while every IVF query against that table returns nothing. Skew matters for latency rather than correctness. A query probes a fixed number of cells; if one cell holds ten times its share, the queries that land on it do ten times the work. That is what the action hint is tracking. Important limits and checks Reading total_live alone. It cannot distinguish "the index is small" from "the index is empty and the data is elsewhere". Read coverage with it, every time. Calling it on an HNSW table. There are no centroids, so the route answers 503 with "error": "ivf_centroids_not_installed". That is the same refusal an IVF query gets, and it means the same thing. Waiting for a rebalance to happen. Nothing is automatic. "action": "required" is the engine telling you to call train-and-install-centroids yourself. Treating a low coverage as a query-tuning problem. No nprobe setting reaches a vector that has no posting. Re-install the centroids so the backfill runs. Continue Continue to group vectors for ivf search. Build a compressed vector index Previous Page Attach filters to an embedding Next Page --- ## Attach filters to an embedding | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/vector/put-metadata Vector Attach filters to an embedding ← Vector examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Store small metadata fields beside an embedding so a search can be restricted to matching items. Before you run it: There is no partial metadata-update operation in this example; replace the vector entry. Start with the single-vector setup, then replace that sample entry with the metadata below. Metadata means small values saved beside the vector, such as a category and stock flag. It is separate from fields in the source product row. Save filter values beside the vectorMetadata is separate from the source row; changing it replaces the vector entry. 01 Choose exact filter fieldsPrepare values such as category and in_stock. 02 Include them in the writeStore metadata with the full vector under the source ID. 03 Search with matching valuesUse the same value types and spelling in the equality filter. Follow the example Choose the fields needed for filtering. Include them as metadata in the write. Use the source record’s ID. Run the filtered-search example. Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/put" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "sku-9281", "embedding": [0.0124, -0.0883, /* ... 768 floats ... */], "dim": 768, "metric": "cosine", "metadata": { "category": "running-shoes", "price_bucket": "100-200", "in_stock": true } }' Apply the metadata filter The filter is an equality predicate on metadata keys. See filtered vector search for the search call. Equality only - for range filters (e.g., price < 100), filter the result client-side. Important limits and checks Forgetting to bucket continuous values. Filter equality on prices is useless ($129.50 ≠ $129.99). Store a bucket field like "price_bucket": "100-200" instead. Updating metadata. To change a vector's metadata, re-put with the new metadata. Partial metadata updates aren't supported. Expected result Similarity search can apply equality checks to the stored metadata. Continue Continue to search within matching metadata. Check IVF coverage and balance Previous Page Store one embedding Next Page --- ## Store one embedding | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/vector/put-single Vector Store one embedding ← Vector examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. An embedding is a list of numbers that represents an item for similarity search. Give it the source record’s ID so results can be matched back to the record. Before you run it: Later vectors must match the dimension count. A separate source row is not updated automatically. Choose an unused collection for a first trial. The array below is shortened: replace the comment and ellipsis with all 768 numeric values, or change dim to the length of a real test vector consistently in both write and query. JSON comments are not valid request data. This call stores an embedding you provide; it does not call an embedding model. Store a supplied embedding under its source IDThis write does not call an embedding model or update a separate source row. 01 Generate the full vectorUse your chosen embedding model outside this request. 02 Choose ID and dimensionsUse the source ID and the vector's actual length. 03 Write the embeddingKeep the collection's first dimension and metric settings consistent. 04 Query in the same spaceUse a query from the same model and preprocessing. Follow the example Generate an embedding with your chosen model. Choose its table, ID and distance metric. Send the write. Query with an embedding from the same model. For a first API check without an embedding model, run the complete three-value example. The longer example below shows how the same request is shaped for model-generated embeddings. Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/put" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "sku-9281", "embedding": [0.0124, -0.0883, 0.0451, /* ... 768 floats ... */], "dim": 768, "metric": "cosine" }' Check the result The first write establishes dimensions and metric. Writing the same ID replaces that vector. { "ok": true } Re-putting the same id overwrites the previous vector. Request options FieldRequiredNotes idyesString. Usually the row's primary key. embeddingyesArray of floats. Length must equal dim. dimyesLocked at the first put. metricnoDefault "cosine". Locked at the first put. Important limits and checks dim mismatch. If you switch models partway through, all puts after the first model fail with 400 dim_mismatch. Use a fresh table for the new model. Float precision. Doubles convert to f32 on the wire. ~7 decimal digits of precision is plenty for similarity but not for exact equality. Continue Continue to find similar vector directions. Attach filters to an embedding Previous Page Find similar vector directions Next Page --- ## Find similar vector directions | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/vector/topk-cosine Vector Find similar vector directions ← Vector examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Cosine similarity compares vector direction rather than magnitude. Use it when the embedding model recommends this metric. Before you run it: The query metric must match the table metric. Compare scores within the same model and metric. Complete store one embedding first. Reuse its collection, 768 dimensions and cosine metric. The displayed array is shortened; supply the complete query vector. With only one stored item, expect at most that one ID—not the larger illustrative result list below. Rank matching vector directionsScores compare vectors from the same model and metric; a higher cosine score is closer. 01 Use a cosine collectionStore full vectors with the model's expected preprocessing. 02 Create the matching queryKeep the model, dimensions and cosine metric consistent. 03 Read up to k matchesInspect IDs in descending score order. Follow the example Store vectors in a cosine table. Create a query embedding with matching model and dimensions. Choose k, the maximum result count. Read scores from highest to lowest. Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": [0.0124, -0.0883, 0.0451, /* ... 768 floats ... */], "k": 10, "dim": 768, "metric": "cosine" }' Check the result Scores range from -1 to 1; higher means a closer direction. [ { "id": "sku-9281", "score": 0.9421 }, { "id": "sku-1144", "score": 0.9187 }, { "id": "sku-5520", "score": 0.8903 } ] The HTTP response is a JSON array of hits, with no hits wrapper. The IDs and scores above illustrate the shape; your stored data determines the results. score is cosine similarity in [-1, 1]. Higher = closer. 1.0 is identical direction, 0 is orthogonal, -1 is opposite. Request options FieldRequiredNotes queryyesArray of floats. Length must equal the table's locked dim. kyesHow many hits to return. Typical: 5 - 50. dimyesMust match the table's locked dim. metricnoDefault "cosine". Must match the metric the table was put with. Important limits and checks Cosine similarity vs cosine distance. Some libraries return 1 - similarity (a distance, lower = closer). OriginChainDB returns similarity directly - higher = closer. Don't sort the wrong way. Metric mismatch. Query with the collection's configured metric. A stored-index mismatch returns 409 vector_metric_mismatch; a contradiction with declared schema metadata can be rejected earlier with 400. Inspect the error body before changing a request. Query from a different model. Embeddings from text-embedding-3 are not comparable to embeddings from all-MiniLM. The same dim does not mean the same vector space. Continue Continue to search within matching metadata. Store one embedding Previous Page Search by dot product Next Page --- ## Search by dot product | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/vector/topk-dot Vector Search by dot product ← Vector examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Dot product compares both direction and magnitude. Use the scoring method recommended by your embedding model. Before you run it: Normalize both stored and query vectors if you intend dot-product ranking to match cosine. Do not normalize only one side. Use the vector-write pattern in a fresh collection, with metric: "dot" on the write as well as the query. Do not reuse the cosine sample collection unchanged. Supply all vector values; a shortened array is not runnable JSON. Rank vectors by direction and magnitudeIf normalization is needed, apply it consistently to stored and query vectors. 01 Use a fresh dot collectionSet dot on writes rather than reusing the cosine sample unchanged. 02 Query in the same vector spaceUse matching dimensions and normalization. 03 Read highest scores firstVector length can affect this score; it is not necessarily bounded. Follow the example Store vectors with the dot metric. Create a query vector of matching dimensions. Choose k and query. Read the highest scores first. Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": [0.0124, -0.0883, 0.0451, /* ... 768 unit-normalised floats ... */], "k": 10, "dim": 768, "metric": "dot" }' Check the result Larger scores rank first. Scores are unbounded unless both sides are normalized. [ { "id": "sku-9281", "score": 0.9418 }, { "id": "sku-1144", "score": 0.9180 }, { "id": "sku-5520", "score": 0.8895 } ] The HTTP response is a JSON array of hits, with no hits wrapper. The IDs and scores above illustrate the shape; your stored data determines the results. score is the inner product. Higher = closer. If both sides are unit-length the score falls in [-1, 1]; if not, the score is unbounded. Request options FieldRequiredNotes queryyesArray of floats. Follow the embedding model's normalization rules consistently for stored and query vectors. kyesNumber of hits to return. dimyesMust match the table's locked dim. metricyesSet to "dot". Must match the metric the table was put with. Important limits and checks Dot on non-normalised vectors. Without normalization, vector length contributes to the score as well as direction. That may be intentional for your model. If it is not, inspect how both stored and query vectors were prepared before changing the scoring method. Normalising one side and not the other. Normalise both stored vectors and the query, or neither. Mixing the two ruins the ranking. Switching mid-table. If half the table was put pre-normalised and half wasn't, dot scores are no longer comparable. Re-embed and re-put. Continue Continue to find the nearest points. Find similar vector directions Previous Page Compare speed and retrieval quality Next Page --- ## Compare speed and retrieval quality | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/vector/topk-fast Vector Compare speed and retrieval quality ← Vector examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Fast mode searches a narrower part of the index. Compare it with high_recall using questions whose useful matches you know. Before you run it: Set the mode explicitly when comparing the two search behaviors. Use the cosine setup, then add enough representative records to compare search quality. Recall means how many useful matches the search finds. Keep the query, result count and dataset the same when changing only mode. Compare search modes on the same questionsBoth modes are approximate; measure useful matches and latency on your workload. 01 Prepare known useful matchesKeep the dataset, query vectors and k fixed. 02 Run fast modeSearch with the narrower candidate exploration. 03 Run high_recall modeRepeat the same requests with wider exploration. 04 Compare the tradeoffMeasure missing useful matches and response times. Follow the example Prepare representative queries. Run them with mode: fast. Repeat with mode: high_recall. Compare response times and useful matches. When to choose another approach Use high_recall when missing a useful match would make the answer unreliable. Compare modes on your own data; table size alone does not establish a speed or quality threshold. Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": [0.0124, -0.0883, 0.0451, /* ... 768 floats ... */], "k": 10, "dim": 768, "metric": "cosine", "mode": "fast" }' Check the result A narrower search may miss matches found by a wider search. The tradeoff depends on the data. [ { "id": "sku-9281", "score": 0.9421 }, { "id": "sku-1144", "score": 0.9187 } ] The HTTP response is a JSON array of hits, with no hits wrapper. The IDs and scores above illustrate the shape; your stored data determines the results. The result fields have the same shape in both modes; the candidate search is what changes. Choose the search mode ValueBehaviour "high_recall"Default. Searches more candidates; still approximate. "fast"Searches fewer candidates. Measure missed matches and latency before choosing it. Important limits and checks Measure end-to-end result quality before changing modes across an application. Neither mode is a latency guarantee; measure a representative workload, including tail latency. Continue Continue to search within matching metadata. Search by dot product Previous Page Search within matching metadata Next Page --- ## Search within matching metadata | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/vector/topk-filtered Vector Search within matching metadata ← Vector examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. Combine similarity with exact metadata filters. The search returns up to k qualifying matches. Before you run it: These are flat equality filters, not ranges or an authorization boundary. Missing or differently cased values do not match. First write metadata. That recipe stores category: "running-shoes", while the request below filters for "shoes". Change the filter to "running-shoes" to match that sample, or deliberately write the category used here. An empty result with mismatched values is expected, not an indexing failure. Find similar items with exact metadata matchesThese filters are not an authorization boundary and do not count every qualifying vector. 01 Read the stored metadataThe linked sample uses category running-shoes. 02 Match the filter spellingUse that category and any required stock value exactly. 03 Search the qualifying vectorsSupply the query embedding and matching metadata conditions. 04 Inspect up to k IDsFewer results or an empty list can be valid. Follow the example Write metadata with each vector. Choose the required metadata values. Send the query vector and filter. Check IDs and result count. Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": [0.0124, -0.0883, 0.0451, /* ... 768 floats ... */], "k": 10, "dim": 768, "metric": "cosine", "filter": { "category": "shoes" } }' Check the result Every returned hit must match all filter keys. The result can contain fewer than k hits because of the available data, search limits or access rules. [ { "id": "sku-9281", "score": 0.9421 }, { "id": "sku-1144", "score": 0.9187 } ] The HTTP response is a JSON array of hits, with no hits wrapper. The IDs and scores above illustrate the shape; your stored data determines the results. The shape matches unfiltered top-k. There is no padding, and the returned count is not an exhaustive count of every matching vector. Filter limits RuleNotes This example uses the equality mapSupply key: value pairs in filter. Typed conditions use the separate filter_expr field where supported. Multiple keys are AND{ "category": "shoes", "in_stock": true } means both must match. Exact match, case-sensitive"Shoes" does not match "shoes". Normalise on insert. Strings, numbers, booleansNested objects and arrays are not filterable. Flatten at put time. Important limits and checks Range filters in the equality map. filter does not accept operators. Use the typed-filter contract where supported; do not send it together with a non-empty equality map. Case-mismatched values. Filter values must match exactly. "shoes" and "Shoes" are different. Lowercase on the way in. Filtering on a field that was never stored. The filter doesn't error - it just matches nothing, and you get an empty hits array. Double-check the metadata was set when you called put. Continue Continue to attach filters to an embedding. Compare speed and retrieval quality Previous Page Find the nearest points Next Page --- ## Find the nearest points | OriginChainDB docs Canonical source: https://originchaindb.com/docs/examples/vector/topk-l2 Vector Find the nearest points ← Vector examples The language tabs use earlier client interfaces. Check SDK versions and connection setup before running them. L2 is Euclidean distance: the straight-line distance between vectors. It includes differences in magnitude. Before you run it: This API returns the negative L2 distance. Higher scores are closer, just as with cosine; scores are not on the same numerical scale. Use the vector-write pattern in a fresh collection with metric: "l2". Use the same dimension and preprocessing for stored vectors and the query. The array below is shortened and must be replaced with real values before sending it. Find nearby points using L2 distanceThe API returns negative distance, so a score closer to zero ranks higher. 01 Use a fresh L2 collectionStore vectors with the l2 metric. 02 Query with matching dimensionsUse the same model and preprocessing as the stored vectors. 03 Keep descending score orderFor example, -0.18 is closer than -0.30. Follow the example Store embeddings in an L2 table. Create a query of matching dimensions. Choose k and run the search. Read scores from highest to lowest: zero is an identical vector; more negative values are farther away. Run the request curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": [0.0124, -0.0883, 0.0451, /* ... 768 floats ... */], "k": 10, "dim": 768, "metric": "l2" }' Check the result Zero means identical vectors. Returned scores are negative distances, so -0.18 is closer than -0.30. [ { "id": "img-0421", "score": -0.1832 }, { "id": "img-9912", "score": -0.2417 }, { "id": "img-3308", "score": -0.3009 } ] The HTTP response is a JSON array of hits, with no hits wrapper. The IDs and scores above illustrate the shape; your stored data determines the results. score is the negative L2 distance. Higher = closer. Keep the API's descending order. Negate the score only if your UI needs to display a positive distance. Request options FieldRequiredNotes queryyesArray of floats. Length must equal the table's locked dim. kyesNumber of hits to return. dimyesMust match the table's locked dim. metricyesSet to "l2". Must match the metric the table was put with. Important limits and checks Sorting by the smallest score. That would put more distant vectors first. Keep descending score order; convert to a positive distance only for display. Choosing a metric without checking the model. Unit-length vectors have equivalent cosine and L2 rankings, but score values differ. Use the metric recommended by the embedding model. Metric mismatch. The metric is locked at table creation. Switching from "cosine" to "l2" means creating a fresh table. Continue Continue to compare speed and retrieval quality. Search within matching metadata Previous Page --- ## Create a free account | OriginChainDB docs Canonical source: https://originchaindb.com/docs/free-account Create a free account Create your account, verify your email and open the instance setup guide. Open Create an account in the live console. Screenshots use local sample data. Complete registration in the live console. From signup to your first databaseAn account and a database instance are separate; screenshots show the local signup preview. 01 Enter your signup detailsReview the required fields and terms. 02 Verify your emailEnter the code sent to your address. 03 Create a free instanceChoose the free configuration in your account. 04 Wait, then open ConnectUse the instance’s details once it becomes ready. 1. Enter your account details Enter your details, review the terms, then choose Send signup code in the live console. Enter your details, review the terms, then choose Send signup code in the live console. Names, password and terms Company is optional; your name is used to name the organization when it is empty. Use a password with at least 12 characters, including a letter and a number. Read the linked agreement and privacy policy before accepting them. Already registered? Sign in instead. 2. Verify your email Enter the six-digit code from your email, then choose Verify & create account. If the code does not work Check that you entered the code for the email shown on the form. Use Resend code if it expires, or Use a different email to correct the address. Follow any waiting time displayed before trying again. The verification screen is not shown here because this local preview cannot send a code or register an account. 3. Create your free instance An instance is the database your application connects to. After verification, follow Create an instance and choose Free when it is offered. That visual guide covers the settings, confirmation and next step to connect. For a real database, wait for provisioning to finish before running your first query. Documentation overview Previous Page Create an instance Choose a configuration, review it and open your new database. --- ## Full-text search | OriginChainDB docs Canonical source: https://originchaindb.com/docs/fts Full-text search Full-text search Full-text search finds words and phrases in text. Choose ranked search when order matters, or boolean and phrase modes when you need a specific match. There are two setup paths: a full-text index attached to a table, and explicit document-index requests. This page explains both. Keep the same document ID when linking a search result back to its source record. Find a passage and its sourceThis shows explicit document indexing; attached table indexes have their own write-maintenance path. 01 Choose the source textKeep a stable ID with each passage or document. 02 Index the wordsSend the text and ID to the document index. 03 Search words or phrasesUse the matching rules supported by the search endpoint. 04 Open the source recordUse the returned ID to retrieve the original content. Table indexes follow your writes Current engine releases maintain table full-text indexes from row inserts, updates and deletes. Verify the installed build and index compatibility on your deployment. Affected older indexes need planned recreation across the 18 October compatibility boundary. The examples below cover the separate document-index API. Plan and verify an index upgrade → The explicit document-index API below uses its own runtime endpoint. You index text under (table, field, doc_id), then search. The doc_id is what links search hits back to your rows - use the row's primary key. :table and :field are opaque path segments - they are not validated against any schema. They must match exactly between the index call and the query call. Index under shop.products and query shop_products and you get a silent empty result, not an error. The default search mode is boolean - omit mode and you get AND-of-terms. Existing table indexes Table full-text indexes are maintained on row writes. The explicit document-index API below is a separate workflow. Full-text and geo indexes created before 18 October 2026 require a one-time recreation, as described in the 19 October release notes. Validate indexed results after rebuilding; recreating an index is operational work, not a documentation-only change. Client examples below describe the referenced interfaces. Use the SDK directory to check which packages are published; source examples are not installation instructions for an unreleased client. 1. Index a text. Tell OriginChainDB to make a piece of text searchable. Re-indexing the same doc_id replaces the old text in the same write - no stale matches. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "doc_id": "sku-9281", "text": "Lightweight road runner with a carbon plate, designed for marathon pace." }' HTTP/1.1 201 Created (empty body) A successful index returns 201 Created with no body. There is no token count or confirmation JSON - check the status code, not the body. FieldWhereWhat it is :tableURLAn opaque label for the index - conventionally your row table, e.g. shop.products. Not checked against any schema; must match byte-for-byte at query time. :fieldURLWhich "logical column" you're indexing under. You can index multiple fields per table - title, description, etc. doc_idbodyA unique ID for this document. Use the row's primary key so hits link back cleanly. textbodyThe text to search. The request body is limited (8 MiB at the engine; gateways may set a lower limit). Very large documents are better split into multiple doc_ids. Indexing only one of several fields. If you want users to search "Wireless headphones" and match products whose title or description contains those words, you need to either concatenate both fields into one text before indexing, or index each field separately and union the results. Forgetting to re-index on updates. When using this explicit document-index endpoint, re-submit the entry when its source changes. Table full-text indexes are maintained automatically on row writes; this instruction applies to entries your application indexes separately. 2. BM25 - ranked search. Return the top-k documents ranked by relevance to the query. This is what most users mean when they say "search". Rare query words count more than common ones; documents where the query words appear more often (relative to length) rank higher. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description?q=carbon+marathon&mode=bm25&k=10" \ -H "Authorization: Bearer $OC_TOKEN" [ { "doc_id": "sku-9281", "score": 9.42 }, { "doc_id": "sku-3140", "score": 4.18 } ] Plain BM25 returns a bare array of { doc_id, score }, best first - no { "mode": ..., "hits": [...] } wrapper. The wrapper object only appears when you add highlight=true or facets= (then you get { "hits": [...], "facets": {...} }); explain=true returns a separate scoring-breakdown object. Query params — all BM25-only; ignored in boolean / phrase. ParamRequiredNotes qyesThe query text. URL-encode spaces as + or %20. modenobm25 | boolean | phrase. Defaults to boolean when omitted. Use bm25 for this section. knoMax results. Default 10. BM25 only. fuzzynoEdit distance for typo tolerance. fuzzy=1 matches one-character typos. highlightnohighlight=true returns matched-term snippets per hit. facetsnoComma-separated field names to aggregate as facet counts. Switches the response to the wrapper-object shape. explainnoexplain=true returns a BM25 scoring-breakdown object instead of hits. highlight=true requires the doc text to have been stored first via POST /fts/:t/:f/doc. All of k, fuzzy, highlight, facets, and explain are silently ignored in boolean and phrase modes. 3. Boolean AND - every word must match. Return every document that contains all the query words, in any order, with no ranking. Fast token-presence check - use when you don't need relevance scoring. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description?q=carbon+marathon&mode=boolean" \ -H "Authorization: Bearer $OC_TOKEN" ["sku-9281", "sku-3140"] A bare array of doc_id strings (sorted lexicographically) - no score field and no wrapper object. If you need ordering by relevance, use BM25. 4. Phrase - exact word order. Match documents that contain the query words contiguously, in the exact order given. Use for branded phrases ("New York Times"), product model numbers, log message templates. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description?q=carbon+plate&mode=phrase" \ -H "Authorization: Bearer $OC_TOKEN" ["sku-9281"] Same shape as boolean - a bare array of doc_id strings. Phrase just narrows which docs qualify. 5. End-to-end - index, search, enrich. The following sequence writes three documents, searches them and requests highlighted matches. These are explicit engine endpoint examples; set the host, tenant and credential for that interface first. Check the instance capability before using ranked search, phrase search or the JSON query DSL. Step 1 — index three docs. # 1) Index three docs. Each POST returns 201 with an EMPTY body. curl -sS -o /dev/null -w "%{http_code}\n" \ -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '{ "doc_id": "p001", "text": "Wireless over-ear headphones with active noise cancellation" }' # → 201 curl -sS -o /dev/null -w "%{http_code}\n" \ -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '{ "doc_id": "p002", "text": "Wired earbuds, no noise cancellation" }' # → 201 curl -sS -o /dev/null -w "%{http_code}\n" \ -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '{ "doc_id": "p003", "text": "USB-C charging cable, 2 metres" }' # → 201 Step 2 — boolean query (default mode). # 2) Boolean query (the DEFAULT mode). Bare array of doc_id strings. curl -sS -G "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" \ --data-urlencode "q=wireless noise" # → ["p001"] (only p001 has BOTH "wireless" AND "noise") Step 3 — bm25 ranked query. # 3) BM25 ranked query. Bare array of { doc_id, score }, best first. curl -sS -G "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" \ --data-urlencode "q=noise cancellation" \ --data-urlencode "mode=bm25" \ --data-urlencode "k=10" # → [ { "doc_id": "p001", "score": 6.31 }, { "doc_id": "p002", "score": 2.04 } ] Step 4 — enrich with highlights. # 4) Enrich with highlights. First store the doc text (highlights read it), # THEN ask for highlight=true. Now the response is an OBJECT, not an array. curl -sS -o /dev/null -w "%{http_code}\n" \ -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description/doc" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '{ "doc_id": "p001", "text": "Wireless over-ear headphones with active noise cancellation" }' # → 201 curl -sS -G "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.products/description" \ -H "Authorization: Bearer $OC_TOKEN" \ --data-urlencode "q=noise cancellation" \ --data-urlencode "mode=bm25" \ --data-urlencode "highlight=true" # → { # "hits": [ # { "doc_id": "p001", "score": 6.31, # "highlights": { "description": ["…active noise cancellation"] } } # ] # } 6. Analyzer + languages. Stemming, lemmatization, diacritic folding, and stopword removal are implemented in the engine but not yet selectable through the HTTP API. There is no language or analyzer query parameter today. The analyzer the API actually uses is Unicode tokenize + lowercase, and nothing else. Concretely: q=runs will not match a document that says "running", and q=cafe will not match "café". Plan your indexing around exact tokens. The one transform that is live is synonyms (see below). What runs today Unicode tokenize. Text is split into words by the Unicode word-boundary rules (UAX #29), so it works across scripts. Lowercase. Every token is lowercased, so Wireless and wireless match. This is the only normalisation applied. Synonyms. If you install a per-(table, field) synonym map via POST /fts/:t/:f/synonyms, members of a class are treated as equivalent at both index time and BM25 query time. This is the one customer-controlled analyzer feature that is wired through. See FTS runtime calls. Built in the engine, not yet exposed (roadmap) The following analyzer stages exist in the engine but cannot be turned on from the API yet. They are listed so you know what is coming, not what you can call today. StepWhat it would doStatus fold diacritics"café" would match "cafe".not API-exposed stopwordsDrop common words ("the", "and", "of").not API-exposed stemmingSuffix-strip. "running" / "runs" → "run". Snowball-based.not API-exposed lemmatizationDictionary lookup. "ran" → "run". More precise than stemming.not API-exposed Languages the engine has stemmers for (not yet selectable). ArabicDanishDutchEnglishFinnishFrenchGermanHungarianItalianNorwegianPortugueseRomanianRussianSpanishSwedishTamilTurkishHindi There is no per-field analyzer knob you can set today. The runtime calls that are live - plain / JSON-aware index, doc store, synonyms, stopword override - are documented on this page and in FTS runtime calls. 7. Examples. Search — a single term. Search is a GET on the same path you indexed to, with the query in ?q=. mode=bm25 is what you want when you care about ranking. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.orders/notes?q=delivery&mode=bm25&k=10" \ -H "Authorization: Bearer $OC_TOKEN" Response — mode=bm25. [ { "doc_id": "01JTRX9KQ3YH8K2WMX0F5JZAB7", "score": 9.4213 }, { "doc_id": "01JTRX9KQ3YH8K2WMX0F5JZAB9", "score": 6.1077 } ] A bare array of { doc_id, score }, highest score first. k caps the list and defaults to 10. This endpoint returns four different shapes depending on the parameters. boolean and phrase give you a bare array of doc_id strings; bm25 gives an array of objects; adding highlight or facets wraps it all in an object with a hits key; and explain=true returns a scoring report instead. Inspect the response shape before reading its fields; the request options determine which one is returned. What the query syntax really is. This is worth being blunt about, because it is easy to assume otherwise: ?q= is not a query language. There is no parser. The string is tokenized into words — Unicode word segmentation, then lowercased — and every token becomes a term. All punctuation is discarded. The practical consequence is that operators you might type do not work, and fail silently rather than erroring. rush AND delivery searches for three terms — rush, and, delivery. Quotes around a phrase are dropped. You might tryWhat actually happens rush AND deliverySearches rush, and, delivery. Use mode=boolean, which already ANDs. rush OR deliverySearches three terms. Use mode=bm25, which already ORs. NOT cancelled / -cancelledNegation is not available here at all. Use must_not in the DSL. "signed by recipient"Quotes are discarded. Use mode=phrase. deliv*The * is discarded. Prefix and wildcard queries exist only in the DSL. delivary~1This one works. ~N is the single inline operator the query surface honours. See fuzzy. How multiple terms combine — it depends on the mode. This is the important distinction, and it is not configurable: modeMulti-term meaningReturns booleanAND — every term must be presentUnranked doc_id array, lexicographic. Unbounded — k is ignored. bm25OR — any term matches, more/rarer terms score higherRanked {doc_id, score}, capped at k. phraseAdjacent and in orderUnranked doc_id array. k is ignored. Boolean — every term required. # mode=boolean is the DEFAULT when ?mode= is omitted. # Every term must be present. Returns a bare array of doc_ids, unranked. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.orders/notes?q=rush+delivery" \ -H "Authorization: Bearer $OC_TOKEN" ["01JTRX9KQ3YH8K2WMX0F5JZAB7", "01JTRX9KQ3YH8K2WMX0F5JZAC1"] An unknown mode falls back to boolean, silently. ?mode=ranked, ?mode=BM25 or any typo is not an error — it takes the default branch and runs a boolean AND. If you get back an array of bare strings when you expected scores, check the spelling of mode first. The accepted values are lowercase boolean, bm25 and phrase. The dashboard's search box is different. The console workbench accepts a one-line table:field terms shorthand in Search mode. That colon syntax is parsed by the console, which then calls the endpoint documented here — it is not something the engine understands. Don't put shop.orders:notes into ?q=. See Run queries from the dashboard. Phrase queries. mode=phrase requires the terms to appear adjacent and in the order given. The quotes you would type in another search engine are not syntax here — the mode is the switch. # Terms must appear adjacent, in this order. Quotes are NOT syntax - # they would simply be discarded by the tokenizer. Use mode=phrase. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.orders/notes?q=signed+by+recipient&mode=phrase" \ -H "Authorization: Bearer $OC_TOKEN" Phrase results come back as an unranked array of doc_id strings — position matching selects the documents, but this mode does not score them. If you need ranking as well as adjacency, use the phrase clause inside the DSL, which selects on positions and then ranks with BM25. Fuzzy matching. Two ways in, both bm25-only: a whole-query budget via ?fuzzy=N, or a per-term ~N suffix. Putting a ~ anywhere in q switches the query onto the fuzzy path automatically. # Whole-query budget via ?fuzzy= (bm25 only, 0-3) curl "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.orders/notes?q=delivary&mode=bm25&fuzzy=1" \ -H "Authorization: Bearer $OC_TOKEN" # Or per-term inline with ~N. A bare ~ means distance 2. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.orders/notes?q=delivary~1+recipient&mode=bm25" \ -H "Authorization: Bearer $OC_TOKEN" Edit distance is capped at 3. Higher is a 400: fuzzy edit_distance 5 exceeds MAX_EDIT_DISTANCE 3. A bare term~ with no number means distance 2. term~0 is an exact match. Each term expands to at most 50 dictionary candidates. Distance 1 catches most real typos. Distance 2 and 3 expand aggressively and will pull in unrelated words — measure before shipping either. The HTTP endpoint accepts fuzzy syntax in the query. Check the installed client version before using a convenience parameter. Ranking, scoring and explain. mode=bm25 scores each document as the sum of its query terms' contributions. Each contribution combines three things: Inverse document frequency. A term in few documents is worth more than one in many. This is why a rare word dominates a query. Term frequency, with diminishing returns. The fifth occurrence adds much less than the second. k1 controls how fast that saturates. Length normalisation. A hit in a short document counts for more than the same hit buried in a long one. b controls how strongly. Defaults are k1 = 1.2 and b = 0.75 — the standard Lucene values. On the ?q= surface they are fixed; they can only be overridden through the DSL's params object. Scores are relative within one result set — never compare a score across two different queries. The explain parameter. Add explain=true to a bm25 query to get the full arithmetic instead of the hits. This is a query parameter on the search route — there is no separate explain endpoint. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.orders/notes?q=rush+delivery&mode=bm25&k=5&explain=true" \ -H "Authorization: Bearer $OC_TOKEN" { "query_terms": ["rush", "delivery"], "n_total": 1204, "avgdl": 11.6, "k1": 1.2, "b": 0.75, "hits": [ { "doc_id": "01JTRX9KQ3YH8K2WMX0F5JZAB7", "score": 9.4213, "terms": [ { "term": "rush", "df": 42, "idf": 3.361, "tf": 1.0, "doc_len": 5, "contribution": 5.9102 }, { "term": "delivery", "df": 310, "idf": 1.362, "tf": 1.0, "doc_len": 5, "contribution": 3.5111 } ] } ] } n_total is the corpus size and avgdl the average document length — the two corpus statistics the formula needs. Per hit, terms is sorted by contribution descending, so the first entry is the term that actually won the document its place. Length normalisation is folded into contribution; doc_len is the raw token count. Explain works only with mode=bm25, and overrides highlight and facets if you pass them together. It always reports the default k1 and b — you cannot explain a custom-tuned score, and the DSL endpoint has no explain of its own. Explain takes the exhaustive scoring path, so it is slower than the equivalent ranked query. It is a debugging tool, not a production one. Call the HTTP endpoint directly when your installed client does not expose explain. Highlights and facets. Both features need the document's text stored, which the plain index call does not do. Send it to the /doc variant instead, along with any facet values you want to aggregate on. # Store the doc text plus per-facet values. Required before highlight=true # or facets= will return anything. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.orders/notes/doc" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "doc_id": "01JTRX9KQ3YH8K2WMX0F5JZAB7", "text": "rush delivery, signed by recipient", "facets": { "status": ["paid"], "channel": ["web"] } }' Then ask for them at query time: curl "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.orders/notes?q=rush&mode=bm25&k=5&highlight=true&facets=status,channel" \ -H "Authorization: Bearer $OC_TOKEN" Response — note the object wrapper. { "hits": [ { "doc_id": "01JTRX9KQ3YH8K2WMX0F5JZAB7", "score": 9.4213, "highlights": { "notes": ["rush delivery, signed by recipient"] } } ], "facets": { "status": [ { "value": "paid", "count": 12 }, { "value": "refunded", "count": 3 } ], "channel": [ { "value": "web", "count": 11 }, { "value": "app", "count": 4 } ] } } res = db.fts.search( "shop.orders", "notes", "rush", mode="bm25", k=5, highlight=True, facets=["status", "channel"], ) for hit in res.hits: print(hit.doc_id, hit.score, hit.highlights) for value, bucket in res.facets.items(): print(value, [(b.value, b.count) for b in bucket]) Highlights come back as raw markup around matched terms. Escape or sanitise before rendering. Facets aggregate; they do not filter. facets=status tells you the distribution across the hit set — it does not narrow it. For real filtering use the DSL. At most 1000 distinct values are tracked per facet field. Use the HTTP request shown above when your installed client does not expose highlights, facets or the /doc write. Filters and multi-field — the JSON DSL. Everything the ?q= surface can't do — boolean composition, negation, filters, prefix and wildcard matching, multi-field search with weights, custom k1/b — lives in a JSON query DSL at POST /fts/:table/_search. Note the path takes a table only; fields are named inside the query. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.orders/_search" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "doc_values_field": "notes", "query": { "bool": { "must": [ { "match": { "field": "notes", "query": "rush delivery" } } ], "should": [ { "term": { "field": "notes", "value": "signed", "boost": 2.0 } } ], "must_not": [ { "term": { "field": "notes", "value": "cancelled" } } ], "filter": [ { "numeric_range": { "field": "amount_cents", "gte": 10000 } } ] } }, "top_k": 20, "params": { "k1": 1.2, "b": 0.75 } }' { "total": 431, "hits": [ { "doc_id": "01JTRX9KQ3YH8K2WMX0F5JZAB7", "score": 14.8802 }, { "doc_id": "01JTRX9KQ3YH8K2WMX0F5JZAC1", "score": 11.2044 } ] } total is the match count before top_k truncation, so you can render "showing 20 of 431" without a second query. top_k defaults to 10. Fields are a named key, not a dynamic one. If you know Elasticsearch, this is the one difference that will trip you up. Where ES writes {"term": {"notes": "rush"}}, this DSL writes {"term": {"field": "notes", "value": "rush"}}. The field is always an explicit field key. Clause types. match_all, match_none, term, terms, match, phrase, prefix, wildcard, regex, range, numeric_range, fuzzy, exists, multi_match, bool, constant_score and function_score. bool scores must plus any matching should. filter gates without contributing score; must_not excludes. match defaults to OR across its terms; pass "operator": "and" to require them all. Every clause takes a boost, and boosts multiply down the tree — a boost: 2.0 clause inside a boost: 3.0 bool contributes 6×. minimum_should_match accepts an integer, a negative integer ("all but N"), or a percentage string like "75%". regex supports literals, character classes, repetition, alternation and grouping — but not back-references, look-around or named groups. Multi-field search with weights. # Search several indexed fields at once, with per-field weights. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.orders/_search" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": { "multi_match": { "fields": [ { "field": "notes", "boost": 2.0 }, { "field": "customer", "boost": 1.0 } ], "query": "rush delivery", "type": "best_fields", "tie_breaker": 0.3 } }, "top_k": 20 }' best_fields (the default) takes the best-scoring field plus tie_breaker × each other match; most_fields sums them all. tie_breaker defaults to 0.0 — pure winner-takes-all — and must be within [0, 1]. Every field you name must be independently indexed, or the request 404s. Numeric filters need doc_values_field. numeric_range, field_value_factor and decay functions read per-document values that only exist if you wrote them as facets through the /doc endpoint. You must also name the source with a top-level doc_values_field. Omit it and the request is refused with a 400 rather than quietly matching nothing — a deliberate choice, since a silent empty result is indistinguishable from "no matches". No SQL integration. Full-text search is not reachable from POST /sql. There is no MATCH() function and no way to put a text predicate in a WHERE clause. To combine the two, search first and then query the returned doc_ids with SQL. Two sibling endpoints share the DSL: POST /fts/:table/_aggs for aggregations and POST /fts/:table/_suggest for prefix suggestions. Because of these routes, _search, _aggs and _suggest are reserved and cannot be used as field names. Use the HTTP reference for the exact request body, whether you send it directly or through a client. Limits and gotchas. LimitValue Max k / top_k10,000 Default k / top_k10 Max fuzzy edit distance3 Fuzzy expansions per term50 DSL query nesting depth32 DSL clauses per query1024 Synonyms per term32 Distinct values per facet field1000 Query string lengthKeep requests bounded and check the deployment’s request limits. Pagination / offsetnot supported There is no pagination. No offset, no from, no cursor. You get the top k and that is all. To show page two, raise k and slice client-side — and remember boolean and phrase mode ignore k entirely and return every match, which is why a broad boolean query on a large corpus can trip the result-size cap and return 413. Top_k bounds the response, not the work. A small k does not make a broad query cheap. The engine scores every matching document and ranks afterwards, so match_all or a very common single term over a large corpus is expensive however few results you ask for. A block-max optimisation skips provably-losing blocks for ranked queries, but it declines to engage in several cases — including whenever you request explain — and falls back to exhaustive scoring. An unindexed field is an empty result on ?q=, a 404 on the DSL. The two surfaces disagree here. _search refuses an unindexed field with a 404 explaining that an unindexed field is refused "rather than answered with an empty result you could not tell from 'nothing matched'". The ?q= route has no such check and returns an empty array, so a typo in the path looks exactly like a genuine miss. Measure memory use and query latency with your own document lengths, fields and query mix. An index that fits a small sample may not fit the full corpus. Load a representative sample, record resident memory and latency, then repeat at the expected production size. What needs the capability enabled. Some full-text operations require the Full-Text Pro engine capability. Check the instance capabilities and enabled configuration before using ranked search, phrase search or the JSON DSL. If the response names a missing capability, confirm availability for that deployment instead of retrying the same request. Caps refuse rather than truncate. When a query exceeds an expansion or clause limit the engine returns 400 with a message naming the limit and suggesting a fix — it never silently returns a partial result set. A truncated expansion would drop matching documents without telling you, so the refusal is deliberate. Use the older-index recreation plan for inventory, backup/restore proof, rehearsal and upgrade verification. Graph use cases Previous Page Configure a text index Index text explicitly, then keep it in sync with its source record. --- ## Lemmatization (engine, not yet exposed). | OriginChainDB docs Canonical source: https://originchaindb.com/docs/fts/lemmatization Full-text search Lemmatization (engine, not yet exposed). Lemmatization maps related word forms to a dictionary form, such as ran to run. It is implemented in the engine but is not selectable through the documented full-text HTTP API. This page explains the concept; it is not a setup procedure for a released analyzer option. How word matching works todayLemmatization is not exposed through the current HTTP API; it cannot be enabled by this guide. 01 Start with source textFor example, a sentence containing Wireless and running. 02 Use supported tokenizationThe current path splits Unicode words and lowercases them. 03 Search the normalized termsWireless becomes wireless; running does not automatically become run. 04 Test the expected wordingCheck real searches before depending on word-form matching. Stem vs lemma — worked example. InputExample stemDictionary form runningrunrun ranranrun runsrunrun betterbetgood geesegeesgoose micemicemouse A stemmer removes word endings. A lemmatizer looks up a dictionary form, which can handle irregular words. These examples illustrate the distinction; neither option is selectable through this HTTP interface. 9 languages (planned). The engine contains dictionaries for English, Spanish, French, German, Italian, Portuguese, Russian, Dutch and Swedish. Their presence in the engine does not make them query parameters or establish a release date. What you can rely on today. The documented text path splits words using Unicode rules and lowercases them. That lets Wireless match wireless; it does not make ran match running. Where supported, a synonym map can group chosen words for indexing and search. Use the documented full-text runtime calls rather than inventing a language or analyzer parameter. Where lemma will help (once exposed). It can help people search prose with different grammatical forms of the same word. It is less useful for exact identifiers such as product codes. Until the option is exposed, test the actual tokens and supported synonym behavior with your data. Continue with full-text search. Configure a text index Index text explicitly, then keep it in sync with its source record. Ask in natural language Next Page --- ## Graph queries | OriginChainDB docs Canonical source: https://originchaindb.com/docs/graph Graph Graph queries Graph queries follow relationships between records. A record is a node; a declared relationship is a link to another record. Start from a known record and follow the links needed for your question. Use the graph quickstart to create three connected records. The reference below covers one-hop reads, longer traversals, paths and algorithms. Each operation has its own result shape and limits. Follow a declared relationshipMatching IDs alone do not create a graph relationship; declare the relation first. 01 Declare the relationName how one table’s records connect to another. 02 Write the linked recordsUse the declared source and target keys. 03 Choose a starting recordFollow the requested relation with a bounded traversal. 04 Inspect IDs and pathsConfirm the connected records match your expected graph. Connect existing records Current dedicated workflows support edge-table mappings and ALTER TABLE shop.orders ADD RELATIONSHIP placed_by (user_id) REFERENCES shop.users. The SQL operation backfills existing rows and maintains the relation on later writes. Prepare both tables first; the target needs a single-column primary key, and dropping a relationship is not available. For a complete first example, use the graph quickstart. 1. Declare a relation. Add a [[relations]] block to the schema of the table that holds the foreign-key column. After registering this schema, every row write creates the edges automatically. # manifest.toml - declare the relation on the table holding the FK column. # The reverse edge is written atomically when bidirectional = true. namespace = "social" table = "follows" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "follower_id" ty = "str" required = true [[columns]] name = "followee_id" ty = "str" required = true [[relations]] name = "followee" # the verb you walk in queries from_col = "followee_id" # column on THIS table bidirectional = true [relations.target] namespace = "social" table = "users" pk = "id" Self-relations work - direction tags in the key prevent collisions. See Schemas → relations for the full reference. 2. One-hop neighbors. Return the primary keys of every row directly connected to a given row through a relation. The fastest graph query - just an adjacency list lookup. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/social.follows/neighbors?rel=followee&pk=f001" \ -H "Authorization: Bearer $OC_TOKEN" For inbound edges (who points at this row?), use the parallel /reverse endpoint with the same params. 3. BFS - multi-hop traversal. Walk every node reachable within max_depth hops, breadth-first. Each result carries the hop distance. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/social.follows/bfs?rel=followee&pk=u001&max_depth=3" \ -H "Authorization: Bearer $OC_TOKEN" Forgetting max_depth. On a connected graph, BFS without a depth cap can return millions of nodes. Set max_depth to the smallest value that gives you what you need. Using BFS when you just want reachability. If you only need to know whether two nodes are connected, use /path - it short-circuits on first match. 4. Shortest path (Dijkstra). Find the lowest-cost path from src to dst. Use the graph quickstart fixture for this example. Provide weights keyed by the node pair, such as u1|u2, not a field name. Edges missing from the map are skipped; an empty map does not assign unit weights. The engine returns the total cost (or null if unreachable). # weights_json maps "from_pk|to_pk" → cost. Supply every edge to consider; missing weights skip edges. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/graph_demo.people/dijkstra?rel=follows&src=u1&dst=u2&weights_json=%7B%22u1%7Cu2%22%3A1%7D" \ -H "Authorization: Bearer $OC_TOKEN" For top-K paths instead of the single shortest, use /k-shortest (Yen's algorithm). For reachability check, use /path. 5. All 22 endpoints. Every graph endpoint, its wire shape, and what it's good for. Centrality and community algorithms (betweenness, eigenvector, label-propagation, triangles, louvain) require same-schema relations - cross-schema is not yet supported. operationsignatureuse neighborsGET /graph/:schema/neighbors?rel=&pk=One-hop forward - downstream of a node. reverseGET /graph/:schema/reverse?rel=&pk=One-hop inbound - who points TO this node? bfsGET /graph/:schema/bfs?rel=&pk=&max_depth=Breadth-first frontier up to a depth. pathGET /graph/:schema/path?rel=&src=&dst=&max_depth=Reachability check - short-circuits on first match. all_simple_pathsGET /graph/:schema/all_simple_paths?rel=&src=&dst=&max_depth=&max_paths=Every acyclic (simple) route between two nodes. Default cap 256 paths. all_simple_paths_bidirGET /graph/:schema/all_simple_paths_bidir?rel=&src=&dst=&max_depth=&max_paths=Same, walking each hop in either direction. Needs bidirectional = true. dijkstraGET /graph/:schema/dijkstra?rel=&src=&dst=&weights_json=Weighted shortest path. k-shortestGET /graph/:schema/k-shortest?rel=&source=&target=&k=Top-K loop-free paths in increasing weight. pagerankGET /graph/:schema/pagerank?rel=&nodes=Influence ranking via power iteration. trianglesGET /graph/:schema/triangles?rel=Per-node triangle count. Clustering signal. componentsGET /graph/:schema/components?rel=Connected components via Union-Find. louvainGET /graph/:schema/louvain?rel=&tolerance=&max_levels=Modularity-greedy community detection. betweennessGET /graph/:schema/betweenness?rel=&max_nodes=Brandes' betweenness - bridge identification. eigenvector_centralityGET /graph/:schema/eigenvector_centrality?rel=&max_iter=&tol=Influence by who-you're-connected-to. label_propagationGET /graph/:schema/label_propagation?rel=&max_iter=&seed=Fast soft community detection. random-walkGET /graph/:schema/random-walk?rel=&start=&steps=&seed=&p=&q=Uniform or Node2Vec-biased walks. node2vecPOST /graph/:schema/node2vec { rel, dim, ..., persist }Train graph embeddings. node2vec/topkGET /graph/:schema/node2vec/:rel/topk?query=&k=&metric=Find similar nodes via Node2Vec embeddings. graphsagePOST /graph/:schema/graphsage { rel, dim, ..., feature_col, persist }Attribute-aware embeddings (Hamilton 2017). graphsage/topkGET /graph/:schema/graphsage/:rel/topk?query=&k=&metric=Find similar nodes via GraphSAGE. graphsage/healthGET /graph/:schema/graphsage/:rel/healthIs the persisted embedding set degenerate? Read-only. graphsage/rebuildPOST /graph/:schema/graphsage/:rel/rebuild { feature_col, force }Retrain a stuck index from the rows already stored. Examples. One hop. /neighbors returns the records directly linked to one starting record. Use the HTTP request or an available client listed in the SDK directory. # Who placed this order? curl "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/shop.orders/neighbors?rel=placed_by&pk=01JTRX9KQ3YH8K2WMX0F5JZAB7" \ -H "Authorization: Bearer $OC_TOKEN" ["01JTRX1H4Q9P0N2WMX0F5JZ001"] Note what comes back: primary keys, not rows. The graph endpoints return identity, not content. If you want the customer's name you either fetch the row afterwards, or use Cypher / a plan query, which return full rows. Going the other way The relation is declared on shop.orders, and it stays declared there no matter which direction you walk. /reverse is still addressed as graph/shop.orders/…, but the pk you pass is a customer. # Flip it: which orders did this customer place? curl "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/shop.orders/reverse?rel=placed_by&pk=01JTRX1H4Q9P0N2WMX0F5JZ001" \ -H "Authorization: Bearer $OC_TOKEN" Empty is not the same as wrong. /reverse returns [] - not an error - in three different situations: the node genuinely has no in-edges, the relation was declared bidirectional = false, or you typo'd the rel name. Reverse lookups do not validate that the relation exists. Check your spelling before concluding the graph is empty. Many hops. /bfs expands outward from a node and tags every result with its distance. This is the workhorse for "everything within N hops". # Everyone within 3 referral hops of this customer. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/shop.customers/bfs?rel=referrer&pk=01JTRX1H4Q9P0N2WMX0F5JZ001&max_depth=3" \ -H "Authorization: Bearer $OC_TOKEN" [ { "pk": "01JTRX1H4Q9P0N2WMX0F5JZ004", "depth": 1 }, { "pk": "01JTRX1H4Q9P0N2WMX0F5JZ011", "depth": 2 }, { "pk": "01JTRX1H4Q9P0N2WMX0F5JZ027", "depth": 3 } ] Reachability and routes /path answers one question - can I get there - and answers it cheaply. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/shop.customers/path?rel=referrer&src=01JTRX1H4Q9P0N2WMX0F5JZ001&dst=01JTRX1H4Q9P0N2WMX0F5JZ027&max_depth=3" \ -H "Authorization: Bearer $OC_TOKEN" /path does not return a path. The response is { "reachable": true } and nothing else. The route is not materialised. If you need the actual nodes, use /k-shortest with k=1, which does return a node list and a cost. # Want the actual route, with costs? Use k-shortest. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/shop.customers/k-shortest?rel=referrer&source=01JTRX1H4Q9P0N2WMX0F5JZ001&target=01JTRX1H4Q9P0N2WMX0F5JZ027&k=3" \ -H "Authorization: Bearer $OC_TOKEN" { "paths": [ { "nodes": ["...001", "...004", "...027"], "cost": 2.0 }, { "nodes": ["...001", "...011", "...019", "...027"], "cost": 3.0 } ] } Weighting differs between the two weighted endpoints, and it trips people up. /dijkstra takes a weights_json map keyed by "from_pk|to_pk" that you supply in the request - weights are not stored on edges. /k-shortest is usually what you want instead: pass weight_col and it reads the weight from a column on the destination row, defaulting to 1.0 per hop. Traversal that returns rows: RelationHop. Underneath the REST endpoints, a hop is a query-plan operator called RelationHop. It reads the forward edge index by prefix and then point-gets each destination row - so unlike /neighbors, it hands back complete rows. You can post a plan directly to /v1/tenants/:t/query. The plan is plain JSON, tagged by op: { "op": "relation_hop", "schema": "shop.orders", "rel": "placed_by", "from_pk": ["01JTRX9KQ3YH8K2WMX0F5JZAB7"], "target": "shop.customers" } curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/query" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "op": "relation_hop", "schema": "shop.orders", "rel": "placed_by", "from_pk": ["01JTRX9KQ3YH8K2WMX0F5JZAB7"], "target": "shop.customers" }' Filtering mid-traversal Chaining hops uses a sibling operator, RelationChain, and this is where plans earn their keep: each hop can carry its own predicate, applied to that hop's output before the next hop expands from it. That is push-down filtering, not post-filtering - a selective predicate early in the chain cuts the work everything after it does. { "op": "relation_chain", "from_schema": "shop.orders", "from_pk": ["01JTRX9KQ3YH8K2WMX0F5JZAB7"], "hops": [ { "rel": "placed_by", "target": "shop.customers" }, { "rel": "referrer", "target": "shop.customers", "where_predicate": { "op": "eq", "path": "country", "value": "NG" } } ] } Only the final hop's rows come back. And because these are ordinary plan nodes, the usual operators compose around them - filter, project, sort, limit, distinct, aggregate. Cycles fan out exponentially. RelationChain does not de-duplicate rows between hops and carries no built-in depth cap. On a graph with cycles, A → B → A → … expands combinatorially with every hop you add. Cap the depth yourself, keep chains short, and prefer /bfs - which does track visited nodes - when the shape is "everything within N hops". Most people should reach for Cypher rather than hand-writing plans - MATCH (o:orders {id: "..."})-[:placed_by]->(c) RETURN c.name compiles to exactly the plan above. Raw plans are there for generated queries and for shapes Cypher does not express. Graph algorithms. These are real, callable endpoints - not patterns you assemble yourself. Twenty-two of them, each a single HTTP call against a declared relation. Two worked examples first, then the full catalogue. PageRank Ranks influence within a set of nodes you nominate. The nodes parameter is required - PageRank scores a subgraph you define, it does not rank an entire table on its own, and an empty list is a 400. # PageRank needs an explicit node universe - it does not rank a whole # table for you. Pass the PKs you want scored. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/shop.customers/pagerank?rel=referrer&nodes=c001,c002,c003,c004,c005&damping=0.85" \ -H "Authorization: Bearer $OC_TOKEN" [ { "pk": "c001", "score": 0.3120 }, { "pk": "c004", "score": 0.2455 }, { "pk": "c002", "score": 0.1810 } ] Louvain communities Partitions the graph into clusters by modularity. Unlike PageRank it takes the whole relation, and community ids are dense integers starting at zero. curl "https://$OC_HOST/v1/tenants/$OC_TENANT/graph/shop.customers/louvain?rel=referrer" \ -H "Authorization: Bearer $OC_TOKEN" { "communities": [ { "pk": "c001", "community": 0 }, { "pk": "c002", "community": 0 }, { "pk": "c007", "community": 1 } ] } The full catalogue All twenty-two live under /v1/tenants/:t/graph/:schema/ and take rel=. Everything is GET except the two embedding trainers and the GraphSAGE rebuild. EndpointShapeWhat it's for neighborsGET ?rel=&pk=One hop forward. Returns a bare array of primary keys. reverseGET ?rel=&pk=One hop backward. Needs bidirectional = true. bfsGET ?rel=&pk=&max_depth=Breadth-first frontier with depths. Default depth 3. pathGET ?rel=&src=&dst=&max_depth=Reachability only - returns { reachable } and no route. dijkstraGET ?rel=&src=&dst=&weights_json=Cheapest weighted route. Weights come from the request, not storage. k-shortestGET ?rel=&source=&target=&k=&weight_col=Yen's k loop-free routes, with node lists. Max k = 50. all_simple_pathsGET ?rel=&src=&dst=&max_depth=&max_paths=Every acyclic route between two nodes. Default cap 256 paths. all_simple_paths_bidirGET ?rel=&src=&dst=&max_depth=&max_paths=Same, searching from both ends. Needs bidirectional = true. pagerankGET ?rel=&nodes=&damping=&max_iter=&tol=Influence ranking by power iteration. nodes= is required. trianglesGET ?rel=Triangle enumeration, each reported once in canonical order. componentsGET ?rel=Connected components by union-find. Undirected interpretation. betweennessGET ?rel=&max_nodes=Brandes' betweenness - finds bridges. Clamped at 100k nodes. eigenvector_centralityGET ?rel=&max_iter=&tol=Influence weighted by neighbours' influence. label_propagationGET ?rel=&max_iter=&seed=Fast community detection. Pass seed= or results are not reproducible. louvainGET ?rel=&tolerance=&max_levels=Modularity-based communities. Up to 500k nodes. random-walkGET ?rel=&start=&steps=&seed=&p=&q=Biased random walk sampling. Max 1,000 steps. node2vecPOST { rel, dim, walks_per_node, …, persist }Train structural embeddings. persist: true enables topk. node2vec/:rel/topkGET ?query=&k=&metric=Nearest nodes by persisted Node2Vec embedding. graphsagePOST { rel, dim, layers, feature_col, persist }Attribute-aware embeddings that read a feature column. graphsage/:rel/topkGET ?query=&k=&metric=Nearest nodes by persisted GraphSAGE embedding. graphsage/:rel/healthGETHealth of a persisted GraphSAGE index. Read-only, no row data. graphsage/:rel/rebuildPOST { feature_col, force, dry_run }Retrain a degenerate index in place. 404 if none, 409 if healthy. Named here so you don't go looking: Strongly connected components (Tarjan / Kosaraju) - components is undirected only Topological sort Minimum spanning tree Clustering coefficient - triangles gives you the raw counts to compute it yourself SDK coverage is uneven. TypeScript and Go wrap the five traversal endpoints - neighbors, reverse, bfs, path, dijkstra - and nothing else. Python additionally wraps k-shortest, shortest-path, random-walk, PageRank, Louvain, label propagation, betweenness, and the Node2Vec / GraphSAGE top-k calls. Everything else is a plain GET, as the tabs above show. Limits and gotchas. Check graph access on your instance. A /graph/* request can return 402 with {"addon":"graph"} when the capability is unavailable. Review the instance configuration and response details. Cypher uses a separate route and access check. Some caps clamp, some reject. k above 50 on k-shortest is a 400 - deliberately, so you budget rather than silently getting fewer paths. Betweenness above its node ceiling clamps instead. Know which one you are relying on. Ceilings worth writing down: variable-length depth 64, k-shortest k 50, random walk 1,000 steps, betweenness 100,000 nodes, Louvain 500,000 nodes, Node2Vec and GraphSAGE 100,000 nodes and 1,024 dimensions, and an 8 MiB HTTP body cap. Label propagation is non-deterministic unless you pass seed. Without one the server seeds from the clock, and the seed is not echoed back - so you cannot reproduce a run after the fact. Always pass your own. Connected components is undirected. It unions both endpoints of every edge, so it will not give you strongly connected components on a directed graph. Graph calls are admission-controlled. They are classed as heavy operations and can return 429 with a Retry-After under memory pressure, or 413 when a result exceeds the size budget. Both are protective - retry or narrow the query rather than looping hard. 6. Examples. 6.1 MATCH and RETURN. The simplest query pins one node and projects some properties off it. A label - :orders - is matched case-insensitively against registered table names, and default_schema is a full namespace.table id that applies only to patterns carrying no label. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/cypher" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "cypher": "MATCH (o:orders {id: \"01JTRX9KQ3YH8K2WMX0F5JZAB7\"}) RETURN o.status, o.amount_cents", "default_schema": "shop.orders" }' { "kind": "select", "rows": [ { "status": "paid", "amount_cents": 12950 } ] } RETURN n gives you an empty object. RETURN o parses, runs, returns 200, and hands back {} for every row. Whole-node return is not implemented - the projection looks for a column literally named o and finds none. Always name the properties you want. The exceptions are variables bound by WITH … AS n or UNWIND … AS n, which do carry values. Note the column names in that response. o.status came back as status - the variable prefix is dropped, and the rest of the dotted path becomes the key. Use AS when you want to control it. 6.2 Filtering. WHERE supports =, <> (and !=), <, <=, >, >=, AND, OR, NOT, and IS NULL / IS NOT NULL. Each comparison puts a property on one side and a literal on the other. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/cypher" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "cypher": "MATCH (o:orders) WHERE o.status = \"paid\" AND o.amount_cents > 5000 RETURN o.id, o.amount_cents", "default_schema": "shop.orders" }' Three limits to internalise now, because the error messages for them are generic. There is no IN, no STARTS WITH / CONTAINS / ENDS WITH, and no regex - those all surface as cypher parse: trailing tokens after query, which reads like a syntax slip rather than a missing feature. And you cannot compare two nodes to each other: WHERE o.customer = c.id is refused. 6.3 Walking one hop. -[:placed_by]-> names the relation declared on shop.orders. The engine reads the pre-built edge index rather than scanning the target table, so a hop costs a prefix lookup plus one point-get per neighbour. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/cypher" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "cypher": "MATCH (o:orders {id: \"01JTRX9KQ3YH8K2WMX0F5JZAB7\"})-[:placed_by]->(c) RETURN c.name, c.country", "default_schema": "shop.orders" }' { "kind": "select", "rows": [ { "name": "Ada Okafor", "country": "NG" } ] } Backwards, and both ways <-[:rel]- walks the edge in reverse, and -[:rel]- walks it in both. Reverse traversal only works when the relation declares bidirectional = true - which is the default, but a relation explicitly set to false silently returns nothing rather than erroring. # Which orders did this customer place? Walk the edge backwards. # Only legal because placed_by declares bidirectional = true. MATCH (c:customers {id: "01JTRX1H4Q9P0N2WMX0F5JZ001"})<-[:placed_by]-(o) RETURN o.id, o.amount_cents Every traversal needs an anchor. The first node of any pattern that contains a hop must pin its primary key in the property map. MATCH (o:orders)-[:placed_by]->(c) is a hard error, not a slow full-graph query - the message asks you to add {id: ...}. A bare MATCH (o:orders) with no hop is fine and scans. 6.4 Walking several hops. Chain arrows to cross more than one relation in a single pattern. Each hop names its own relation, and only the last hop's nodes come back as rows. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/cypher" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "cypher": "MATCH (o:orders {id: \"01JTRX9KQ3YH8K2WMX0F5JZAB7\"})-[:placed_by]->(c)-[:referrer]->(r) RETURN r.name, r.country", "default_schema": "shop.orders" }' Variable-length paths When you don't know the depth in advance, -[:rel*1..3]-> walks between one and three hops and returns everything it reaches. Bind the path with p = to use length(p), nodes(p) and relationships(p). This only works on a self-recursive relation - one whose target table declares a relation of the same name, like referrer on shop.customers. You cannot walk a variable number of hops across placed_by, because orders do not point at orders. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/cypher" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "cypher": "MATCH p = (c:customers {id: \"01JTRX1H4Q9P0N2WMX0F5JZ001\"})-[:referrer*1..3]->(up) RETURN up.name, length(p)", "default_schema": "shop.customers" }' { "kind": "select", "rows": [ { "name": "Ravi Menon", "length(p)": 1 }, { "name": "Sofia Duarte","length(p)": 2 } ] } A bare * means *1..64; 64 is the hard depth ceiling. Two shapes are refused inside a longer chain: a variable-length hop cannot be one link of a multi-hop pattern, and a chain may contain at most three undirected hops (each one doubles the work). shortestPath(…) is available over a variable-length pattern when you only want the shortest route between two pinned nodes. 6.5 Ordering and limiting. ORDER BY, SKIP and LIMIT attach to RETURN and nowhere else - a WITH … ORDER BY in the middle of a query does not parse. Sort keys must be a property access or a bare variable; ASC is the default. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/cypher" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "cypher": "MATCH (o:orders) WHERE o.status = \"paid\" RETURN o.id AS order_id, o.amount_cents AS cents ORDER BY o.amount_cents DESC SKIP 0 LIMIT 10", "default_schema": "shop.orders" }' SKIP and LIMIT take integer literals. A parameter there does not parse, so build the number into the query string when you paginate. 6.6 Parameters. $name placeholders are substituted from the request's params map before the query is planned. Values must be scalars - string, number, boolean or null; arrays and objects are rejected. Referencing a parameter you didn't supply is a 400, not a silent null. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/cypher" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "cypher": "MATCH (o:orders) WHERE o.status = $want RETURN o.id", "default_schema": "shop.orders", "params": { "want": "paid" } }' Parameters work in WHERE, RETURN and UNWIND. They do not work inside a pattern's property map, so the very place you most want one - (o {id: $id}) - is refused, and the anchor id has to be interpolated into the query text. Escape it yourself. 6.7 Writing through Cypher. All four write verbs are implemented and go through the same route. Each returns its own response shape rather than rows. # CREATE - insert one node. Returns {"kind":"insert","rows_inserted":1} CREATE (o:orders { id: "01JTRXNEW00000000000000001", customer: "01JTRX1H4Q9P0N2WMX0F5JZ001", amount_cents: 4200, status: "pending", notes: "gift wrap", placed_ms: 1714480000000 }) Send supported write operations through the authenticated HTTPS Cypher endpoint. The currently offered PostgreSQL login is read-only. An update request looks like this: curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/cypher" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "cypher": "MATCH (o:orders {id: \"01JTRXNEW00000000000000001\"}) SET o.status = \"paid\"", "default_schema": "shop.orders" }' SET and DELETE both require a preceding MATCH that pins a primary key. An unanchored mutation would be a whole-table rewrite, so it is refused outright. A trailing RETURN after a write parses but is ignored - the write's own counter is what you get back. A constraint violation returns 409 with {"error":"constraint_violation","detail":"…"}. Result shapes. Every response carries a kind discriminator; branch on it. There is no columns array and no data envelope - reads hand back plain JSON objects keyed by the projection's output names. kindBodyEmitted by selectrows: [ … ]Any query ending in RETURN insertrows_inserted: nCREATE, and FOREACH bodies mergerows_inserted: nMERGE - counts only rows that were absent updaterows_affected: nSET deleterows_deleted: nDELETE Every response also carries an X-OC-Query-Id header - log it, it is what support will ask for. Every clause that works. ClauseNotes MATCHNode patterns, relationship patterns, chained hops, and comma-separated patterns. OPTIONAL MATCHLeft-outer semantics. Cannot be the first clause of a query - put a MATCH before it. WHEREAfter MATCH, OPTIONAL MATCH or WITH. Property-vs-literal comparisons only. RETURN / RETURN DISTINCTProjections and aliases. See the RETURN n warning above. ORDER BY / SKIP / LIMITOnly inside RETURN. SKIP and LIMIT take non-negative integer literals, not parameters. WITHProjection between stages. WITH DISTINCT and aggregates inside WITH are both refused. UNWINDExpands a literal list, or a list column on a matched row, into rows. CREATEInserts a node. Can also set a relationship column when it follows a MATCH. MERGEInsert-if-absent on a node pattern. Existing rows are left untouched. SETvar.prop = literal, on a node anchored by primary key. DELETEOne variable, anchored by primary key. Removes derived index and edge state too. FOREACHWrite-only bodies: CREATE, SET, DELETE, or a nested FOREACH. CALL { … } YIELDSubquery form only, read-only, no nesting. shortestPath(…)Over a variable-length pattern between two primary-key-anchored nodes. Aggregates - count(*), count(x), sum, avg, min, max - work, but only on their own: there is no GROUP BY, so an aggregate cannot share a RETURN with a plain column. The scalar functions upper, lower, length, coalesce and abs are also available. Every clause that does not. This is the list people arrive expecting. Most of these fail with a generic parse error rather than a helpful one, so check here before assuming you have a syntax bug. Not supportedWhat to do instead UNIONRefused with a pointer to SQL UNION on /sql, or merge client-side. REMOVERefused. Use SQL UPDATE ... SET col = NULL instead. DETACH DELETEParses, then refused. Plain DELETE already clears derived edge state. INNo such operator. Write it as OR-ed equalities. STARTS WITH / CONTAINS / ENDS WITHNo string predicates at all. Use full-text search or SQL LIKE. =~ (regex)The ~ character does not even lex - you get a lex error, not a parse error. CASENo conditional expressions. Do it in SQL or in your application. EXISTS(…)Not a recognised function. collect()Not implemented. count / sum / avg / min / max are. count(DISTINCT x)DISTINCT inside an aggregate is rejected. RETURN DISTINCT works. RETURN *Not an expression. List the properties you want. Arithmetic in WHERE or RETURNo.amount_cents * 2 is refused; the error points you at /sql. Aggregates mixed with plain columnsThere is no GROUP BY in this dialect. Aggregate alone, or use SQL. Relationship variables -[r:TYPE]->The parser demands a colon straight after the bracket. Edges cannot be bound. Untyped edges: --> or -[]->Every hop must name a declared relation. Edge property maps / type alternation-[:R {since: 2020}]-> and -[:A|:B]-> both fail to parse. Multi-label nodes (n:A:B)One label per node pattern. Parameters inside pattern maps(o {id: $x}) is refused - a property map takes literals. $params work in WHERE, RETURN and UNWIND. allShortestPaths(…)Only the singular shortestPath() exists. CALL db.labels() and other proceduresOnly the CALL { subquery } form is implemented. Cross-variable comparison a.x = b.yWHERE compares a property against a literal, not against another node. Limits and gotchas. Composite primary keys cannot be used. Every anchored pattern resolves through a single primary-key column. A table with a two-column key is not reachable from Cypher. Labels resolve to table names, first match wins. If two namespaces both hold a table called orders, a bare :orders label is ambiguous, and default_schema does not disambiguate it - the resolver never consults it once a label is present. Two MATCH clauses need a WITH between them. Back-to-back MATCHes are refused; project through WITH to chain stages. Comma-separated patterns are a separate, stricter mode. MATCH (a)-[:r]->(b), (b)-[:r]->(c) RETURN a, b, c runs a dedicated pattern-matching join, and it accepts only that exact shape: no other clauses, no variable-length, no undirected hops, every node needs a variable, RETURN takes bare node variables only, and WHERE may contain nothing but AND-ed a <> b distinctness checks. A cyclic graph can fan out. Multi-hop chains do not de-duplicate visited rows, so a cycle expands combinatorially with each hop. Keep chains short and prefer a bounded variable-length range. Large results are refused, not truncated. Exceeding the result-row or result-byte budget returns 413 with the observed size and the cap. Add a LIMIT. Under load you may get 429. Cypher counts as a heavy operation and is admission-controlled. Honour Retry-After. The request body cap is 8 MiB, which matters if you generate long UNWIND literal lists. Cypher calls are authorised by what they actually do - a pure read is checked like any other SELECT, and each write verb requires the matching privilege on its target schema. A read-only token can run a read-only Cypher query. Vector search use cases Previous Page Your first graph traversal Next Page --- ## Graph embeddings | OriginChainDB docs Canonical source: https://originchaindb.com/docs/graph/embeddings Graph Graph embeddings Graph embeddings turn a node’s relationships into a list of numbers so you can find similar nodes. Prepare the graph first, train a model, then query the saved representations. Training changes stored data; it is not a read-only query. Turn graph connections into searchable vectorsTraining persists vectors; changing graph edges does not automatically retrain them. 01 Prepare the graphUse a supported same-schema relation and representative connected records. 02 Choose a training methodConfigure the supported Node2Vec or GraphSAGE operation. 03 Train and save vectorsInspect the result before using the generated representations. 04 Query a known nodeCompare nearby vectors with relationships in the source graph. Prepare a graph Complete the graph quickstart. Its graph_demo.people table has a follows relation targeting the same table. Graph embedding training requires this same-schema relation; a cross-table relation is not interchangeable. Use the same endpoint, tenant and bearer environment variables, with database identity headers when required. The three-node fixture demonstrates the API; meaningful embeddings require a representative graph. Train Node2Vec Node2Vec learns which nodes tend to appear near one another in walks through the graph. The example trains on the declared follows relation and saves one numeric representation per node. curl --fail-with-body -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/graph/graph_demo.people/node2vec" \ -H "Authorization: Bearer $OC_BEARER" -H "Content-Type: application/json" \ -d '{"rel":"follows","dim":16,"walks_per_node":5,"walk_length":10,"window_size":3,"epochs":1,"seed":42,"persist":true}' Check the status and returned training summary, including dimension and persistence. This request performs training; it is not a job proposal or a read-only operation. Keep training budgets small while evaluating a new graph. Query persisted embeddings curl --fail-with-body --get "$OC_BASE_URL/v1/tenants/$OC_TENANT/graph/graph_demo.people/node2vec/follows/topk" \ -H "Authorization: Bearer $OC_BEARER" \ --data-urlencode "query=u1" --data-urlencode "k=3" --data-urlencode "metric=cosine" This graph embedding query names a source node with query. It is different from the vector-table top-k request, which supplies a numeric query vector. Persisted graph embeddings do not require an IVF centroid-installation request. Use GraphSAGE for node features GraphSAGE combines the graph’s links with a numeric feature column on each node. Prepare consistent feature dimensions and choose the supported aggregator before training. Follow the complete GraphSAGE request; its parameters differ from Node2Vec. Refresh deliberately A later row or edge update does not imply that learned embeddings have been retrained. Track the graph and model version used for a run, refresh when needed and evaluate retrieval quality on representative queries. See Node2Vec options and response formats. Cypher queries Define the links that a graph query will follow. Graph use cases Next Page --- ## Graph models by industry | OriginChainDB docs Canonical source: https://originchaindb.com/docs/graph/industries Graph Graph models by industry Use a graph when the relationship between records matters to the question. These examples follow account links, purchase connections, part dependencies and reporting lines. They are illustrative models; adapt the relation and limits to your own data. Trace connections during an investigationConnected records provide evidence to review; a shared link alone does not prove fraud. 01 Start with a flagged accountIdentify the record being investigated. 02 Choose a declared relationshipFor example, accounts linked through a shared device. 03 Follow a bounded pathLimit the relations and number of hops. 04 Inspect the connected recordsReview the underlying activity before reaching a conclusion. Financial services: finding a fraud ring Individually ordinary accounts, connected in a way that is not. The signal is the shape, not any single row. The relation fin.transfers (id PK, from_account, to_account, amount_minor, at) relation: "to_account" -> fin.accounts Who is within three hops of a flagged account A ring shows up as a small set reachable in a few hops and reaching back. One traversal replaces a recursive query you would otherwise write by hand. GET /v1/tenants/:t/graph/fin.transfers/bfs ?rel=to_account&from=acct-flagged&depth=3 keep it explainable Keep the returned IDs and relationship information so an investigator can inspect the connection. Result shapes differ by graph operation; use a path-producing endpoint when you need the complete path. Retail: people who bought this also bought The classic two-hop recommendation, computed on live orders rather than a nightly export. The relation shop.lines (id PK, order_id, product_id, qty) relation: "product_id" -> shop.products Two hops from a product Product to the orders containing it, then out to the other products in those orders. Depth two, one call. GET /v1/tenants/:t/graph/shop.lines/bfs ?rel=product_id&from=sku-8842&depth=2 Then rank them by similarity Traversal supplies candidate IDs. Your application can compare them with results from a separately prepared vector index. Use matching IDs and inspect the ranking. See vector setup. POST /v1/tenants/:t/vector/shop.products/topk Manufacturing: a supply-chain dependency One supplier stops shipping. The question is what stops with it, several levels down. The relation mfg.bom (id PK, part_id, depends_on_part, qty) relation: "depends_on_part" -> mfg.parts Everything downstream of a part Blast radius is a traversal, and the depth is the answer to how far the problem travels. GET /v1/tenants/:t/graph/mfg.bom/bfs ?rel=depends_on_part&from=part-4471&depth=5 weights make it a route Give the edge a cost - lead time, price, distance - and Dijkstra answers the cheapest path rather than the shortest hop count. Enterprise: an org chart Reporting lines connect each employee to a manager. Following those links answers questions about direct and indirect reports. The relation hr.people (id PK, name, manager_id, dept) relation: "manager_id" -> hr.people Everyone under a manager A self-referencing relation traverses the same way as any other. GET /v1/tenants/:t/graph/hr.people/bfs ?rel=manager_id&from=p-17&depth=6 What these have in common The relation is the model. Declaring which column is an edge is the whole setup. Maintain the relation. Declared relationships can be maintained with row writes; existing data may need a supported backfill. Inspect the evidence. Read the returned IDs and links; choose the operation that provides the path details you need. Start from zero — Declare a relation and traverse it. All algorithms — The full set, with what each one costs. Graph embeddings Previous Page Full-text search overview Next Page --- ## Run your first graph traversal | OriginChainDB docs Canonical source: https://originchaindb.com/docs/graph/quickstart Graph Run your first graph traversal Create three people connected by a follows relationship. Then read one neighbor and follow two links. A hop means crossing one relationship from one record to the next. Check a small graph by handThe example includes a cycle; bounded traversal keeps the result small enough to verify. 01 Declare the follows relationUse the node IDs as source and target keys. 02 Load u1, u2 and u3Connect them in the cycle shown in the example. 03 Start at u1Traverse follows with a maximum depth of two. 04 Inspect each depthCheck u2 at one hop and u3 at two hops. 1. Connect Use a Bash-compatible terminal and an instance token with schema and row-write permission. The example uses a new graph_demo.people table. If your instance requires database-user identity, add the two identity headers to every request. export OC_BASE_URL="https://YOUR_INSTANCE_HOST" export OC_TENANT="YOUR_TENANT_ID" # Load OC_BEARER from your secret manager. : "${OC_BEARER:?Set OC_BEARER first}" 2. Declare the relation Each person has a follows_id naming another person in the same table. This small example has one outgoing link per row. For multiple links, define a supported relation shape. A separate edge table is not traversable without relation declarations; a single string column does not store a list. curl --fail-with-body -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/schemas" \ -H "Authorization: Bearer $OC_BEARER" -H "Content-Type: text/plain" \ --data-binary @- <<'TOML' namespace = "graph_demo" table = "people" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "follows_id" ty = "str" [[relations]] name = "follows" from_col = "follows_id" bidirectional = true [relations.target] namespace = "graph_demo" table = "people" pk = "id" TOML 3. Add the records The data forms a cycle: u1 → u2 → u3 → u1. The relation indexes are maintained as rows are written. for row in '{"id":"u1","follows_id":"u2"}' '{"id":"u2","follows_id":"u3"}' '{"id":"u3","follows_id":"u1"}'; do curl --fail-with-body -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/rows/graph_demo.people" \ -H "Authorization: Bearer $OC_BEARER" -H "Content-Type: application/json" \ -d "$row" || break done 4. Find one neighbor curl --fail-with-body --get "$OC_BASE_URL/v1/tenants/$OC_TENANT/graph/graph_demo.people/neighbors" \ -H "Authorization: Bearer $OC_BEARER" \ --data-urlencode "rel=follows" \ --data-urlencode "pk=u1" The result contains u2. Use pk for the starting primary key; from is not this endpoint’s parameter. 5. Walk more than one hop curl --fail-with-body --get "$OC_BASE_URL/v1/tenants/$OC_TENANT/graph/graph_demo.people/bfs" \ -H "Authorization: Bearer $OC_BEARER" \ --data-urlencode "rel=follows" \ --data-urlencode "pk=u1" \ --data-urlencode "max_depth=2" The traversal reaches u2 at depth 1 and u3 at depth 2. The depth limit is max_depth. A /path request uses src and dst to check reachability; use the algorithm reference when you need a path or cost. Add a relation to existing data The console can configure edge-table mappings. The SQL workflow ALTER TABLE … ADD RELATIONSHIP … REFERENCES … can backfill a relation and maintain it on later writes. It currently requires a single-column primary key on the target, and dropping a relationship is not available. See the graph reference and release notes. Next: algorithm examples, graph schemas or Cypher. Graph overview Previous Page Graph schemas Give records named links that graph queries can follow. --- ## HTTP API reference. | OriginChainDB docs Canonical source: https://originchaindb.com/docs/http-recipes HTTP API reference. Use these HTTP requests as references for individual engine operations. Choose the section for your task, prepare the named schema or index and inspect the status and response before continuing. These examples use explicit tenant-scoped routes and legacy host variables. For a new application, use the complete OC_URL and supported OC_TOKEN supplied by Connect; do not construct the URL from an instance name. Endpoint-specific fields still come from the API reference. Adapt a recipe to its interfaceThese reference recipes use explicit engine settings; do not shorten the complete address from Connect. 01 Find the operationChoose the recipe for the row, query or index task. 02 Check its connection contractUse the endpoint variables and credentials that interface requires. 03 Send the small requestPrepare the named table or index first. 04 Read status and responseVerify the result before chaining another operation. Check the engine you are connected to Read GET /v1/capabilities on your instance's HTTPS endpoint. It distinguishes supported features, scoped previews and roadmap entries, and includes deployment-dependent notes. A feature in source code is not proof it is enabled on your instance. Use Connect for listener status and the release notes for rollout history. Idempotency and uncertain writes Schema registration, supporting row-write and batch routes, and selected Elasticsearch mutations implement idempotency handling. This is not a global guarantee for every POST, SQL statement, vector request or transaction commit. Check the specific endpoint before building a retry loop. Keep the same key and body for one logical operation. A new application-level SDK call may generate a new key. Replay protection is bounded by the server's retention and scope; it is not a permanent exactly-once guarantee. If a commit response is lost, reconcile its outcome before repeating a non-idempotent mutation. Schemas TOML manifests describe a table - its primary key, columns, indexes, and relations. The engine indexes everything off the manifest, so registering one is the prerequisite to any row write. POST /v1/tenants/:tenant/schemas - Register a new TOML manifest; existing schema IDs return 409. Body is the raw TOML; Content-Type: text/plain. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/schemas" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: text/plain" \ --data-binary @orders.toml 200 OK { "id": "trading.orders", "version": 1 } GET /v1/tenants/:tenant/schemas - List every schema id registered for the tenant. curl "$OC_BASE_URL/v1/tenants/$OC_TENANT/schemas" \ -H "Authorization: Bearer $OC_TOKEN" 200 OK ["trading.orders", "trading.trades", "trading.users"] GET /v1/tenants/:tenant/schemas/:id - Fetch the raw TOML for a schema id. Response is text/plain, not JSON. curl "$OC_BASE_URL/v1/tenants/$OC_TENANT/schemas/trading.orders" \ -H "Authorization: Bearer $OC_TOKEN" # text/plain namespace = "trading" table = "orders" primary_key = ["order_id"] ... Rows (typed CRUD) Insert, batch, and read against a registered schema. Single-row writes are atomic; the batch endpoint accepts a JSON array (atomic in one commit) or NDJSON via `application/x-ndjson` (streamed in flushable chunks). POST /v1/tenants/:tenant/rows/:schema - Upsert a single row. `?expect=insert` requests insert-only behavior: a duplicate primary key conflicts instead of overwriting the row. Use the supported idempotency header consistently for the same row operation; reconcile an uncertain write before changing its key or body. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/rows/trading.orders" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "order_id": "o-0001", "symbol": "AAPL", "qty": 100 }' { "ok": true, "lsn": { "segment": 4, "offset": 8421007 } } POST /v1/tenants/:tenant/rows/:schema/_batch - Atomic batch (one durable commit). JSON body: a row array. NDJSON body (Content-Type: application/x-ndjson): streamed; flushes every `?chunk=N` rows (default 1000, max 10000). 8 MiB body cap is disabled on this route. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/rows/trading.orders/_batch" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: bulk-2026-05-01-batch-1" \ -d '[ { "order_id": "o-1", "symbol": "AAPL", "qty": 100 }, { "order_id": "o-2", "symbol": "MSFT", "qty": 250 } ]' 200 OK { "inserted": 2, "lsn": { "segment": 4, "offset": 8425112 } } GET /v1/tenants/:tenant/rows/:schema/:pk - Read a row by its single-column primary key. Composite PKs must use POST /query with a ColumnScan plan. curl "$OC_BASE_URL/v1/tenants/$OC_TENANT/rows/trading.orders/o-0001" \ -H "Authorization: Bearer $OC_TOKEN" { "order_id": "o-0001", "symbol": "AAPL", "qty": 100, "_oc_row_version": 1 } Query - Plan tree (JSON) The engine's native execution surface. POST a JSON Plan tree and get rows back. `?explain=true` returns the executed plan annotated with stats (EXPLAIN ANALYZE). Cancel an in-flight plan with the ULID handed back in `X-OC-Query-Id`. POST /v1/tenants/:tenant/query - Execute a Plan tree. Bare response is `Vec`; with `?explain=true` it's `{rows, explain}`. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/query" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "Limit": { "n": 10, "child": { "Filter": { "predicate": { "Eq": ["status", "pending"] }, "child": { "Scan": { "schema": "trading.orders" } } } } } }' [ { "order_id": "o-0001", "symbol": "AAPL", "status": "pending", ... }, ... ] POST /v1/tenants/:tenant/query?explain=true - EXPLAIN ANALYZE: executes the plan and returns it annotated with per-node row counts and µs timings. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/query?explain=true" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "Scan": { "schema": "trading.orders" } }' 200 OK { "rows": [ ... ], "explain": { "op": "Scan", "schema": "trading.orders", "rows_out": 412, "elapsed_us": 1340, "children": [] } } POST /v1/queries/:id/cancel - Flip the cancellation token for an in-flight plan. The id is the ULID returned in `X-OC-Query-Id` on the original request. curl -X POST "$OC_BASE_URL/v1/queries/01HW7G5...JZ/cancel" \ -H "Authorization: Bearer $OC_TOKEN" 200 OK (always; cancelled=false if already finished) { "cancelled": true } GET /v1/tenants/:tenant/watch - Server-Sent Events stream. The connection holds open; the server pushes one event per change burst against the subscribed schemas. Ctrl-C / client close ends the subscription. curl -N "$OC_BASE_URL/v1/tenants/$OC_TENANT/watch?schemas=trading.orders" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Accept: text/event-stream" 200 OK (text/event-stream) event: snapshot data: { "rows": [ ... ] } event: snapshot data: { "rows": [ ... ] } SQL SELECT, INSERT, UPDATE and DELETE execute on the SQL endpoint. Do not re-issue a successful SQL mutation against the row API. The response kind and fields depend on the statement; see the SQL reference and transaction guide for commit boundaries. POST /v1/tenants/:tenant/sql - Send a JSON object with a sql string and optional positional params array. SELECT returns rows; mutations return a statement-specific receipt. Writes execute: do not replay the returned rows. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sql": "SELECT order_id, symbol, qty FROM trading.orders WHERE status = '"'"'pending'"'"' LIMIT 10" }' // Illustrative response shapes. INSERT and DELETE execute. { "kind": "select", "rows": [{"order_id":"o-1","symbol":"AAPL","qty":100}] } // INSERT receipt: inspect the returned kind/rows; do not insert them again. { "kind": "insert", "schema": "trading.orders", "rows": [{"order_id":"o-1","symbol":"AAPL","qty":100}] } // DELETE receipt outside a transaction, for one matching row: { "kind": "delete", "schema": "trading.orders", "pk": "o-1", "rows_affected": 1 } Vector search Store an embedding, then compare a query embedding using the same dimensions and metric. HNSW search is approximate; high_recall searches more candidates than fast. Measure recall and latency on your own data. Metadata filters use values saved with the vector. The following pair uses a complete three-dimensional vector in a new embeddings collection. Replace it with embeddings from your chosen model for real similarity search; do not mix different dimensions or models in the collection. POST /v1/tenants/:tenant/vector/:table/put - Upsert one vector. Optional `metadata` object is indexed for filtered topk. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/vector/embeddings/put" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "doc-001", "embedding": [1.0, 0.0, 0.0], "dim": 3, "metric": "cosine", "metadata": { "lang": "en", "tier": "premium" } }' 201 Created // 201 Created (no body) POST /v1/tenants/:tenant/vector/:table/topk - k-nearest neighbour search. `mode=high_recall` (default) or `mode=fast`. These select a recall/latency profile; they are not index-family names. Non-empty `filter` triggers HNSW + post-filter on metadata equality. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/vector/embeddings/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": [0.9, 0.1, 0.0], "k": 10, "dim": 3, "metric": "cosine", "mode": "high_recall", "filter": { "lang": "en" } }' 200 OK [ { "id": "doc-001", "score": 0.9939 } ] With only the vector inserted above, the result contains that ID. The displayed cosine score is rounded. Full-text search Per-field, per-tenant inverted index. Tokenizer is UAX #29 (Latin / Cyrillic / CJK / Arabic / Hindi). Modes: `boolean` (AND), `bm25` (ranked, default Lucene k1=1.2 b=0.75), and `phrase` (exact contiguous tokens). POST /v1/tenants/:tenant/fts/:table/:field - Index a document under (table, field). Re-indexing the same `doc_id` cleans stale postings. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/fts/articles/body" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "doc_id": "art-001", "text": "OriginChainDB ships managed AI-native storage." }' 201 Created // 201 Created (no body) GET /v1/tenants/:tenant/fts/:table/:field?q=&mode=&k= - Search. `mode=boolean|bm25|phrase` (default boolean). `k` caps results in `mode=bm25` (default 10). curl "$OC_BASE_URL/v1/tenants/$OC_TENANT/fts/articles/body?q=substrate%20managed&mode=boolean" \ -H "Authorization: Bearer $OC_TOKEN" 200 OK // boolean / phrase ["art-001", "art-007"] // bm25 [ { "doc_id": "art-001", "score": 7.42 }, { "doc_id": "art-007", "score": 5.18 } ] Elasticsearch API Use a supported Elasticsearch 7.x client with the explicit compatibility endpoint. Test its requests against the documented subset, including per-item bulk results and version conditions. Other query models have separate interfaces. Start with Connect an Elasticsearch client. PUT/v1/tenants/:tenant/es/:index- Create an index and its mapping. Field types are the Elasticsearch types your client already sends. curl -X PUT "$OC_BASE_URL/v1/tenants/$OC_TENANT/es/shop.products" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ --data-binary @mapping.json 200 OK { "acknowledged": true, "shards_acknowledged": true, "index": "shop.products" } PUT/v1/tenants/:tenant/es/:index/_doc/:id- Index (create or replace) a document by _id. Searchable the instant the call returns - no refresh to wait on. curl -X PUT "$OC_BASE_URL/v1/tenants/$OC_TENANT/es/shop.products/_doc/sku-8842" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ --data-binary @doc.json 201 Created { "_index": "shop.products", "_id": "sku-8842", "result": "created", "_version": 1 } POST/v1/tenants/:tenant/es/_bulk- Bulk index / update / delete. NDJSON: an action line, then (for index/update) a source line. The fast path for ingest. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/es/_bulk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/x-ndjson" \ --data-binary @ops.ndjson 200 OK { "errors": false, "items": [ { "index": { "_id": "sku-1207", "status": 201 } }, { "update": { "_id": "sku-8842", "status": 200 } } ] } POST/v1/tenants/:tenant/es/:index/_update/:id- Partial update. The fields in doc are merged in; every other field on the document is preserved. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/es/shop.products/_update/sku-8842" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ --data-binary @patch.json 200 OK { "_index": "shop.products", "_id": "sku-8842", "result": "updated", "_version": 2 } POST/v1/tenants/:tenant/es/:index/_search- Search with the Query DSL, with aggregations in the same request. RLS and column masking apply to the query itself. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/es/shop.products/_search" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ --data-binary @query.json 200 OK { "took": 6, "hits": { "total": { "value": 1, "relation": "eq" }, "hits": [ { "_id": "sku-8842", "_score": 7.41, "_source": { "name": "Carbon Marathon", "brand": "Aero", "price": 149 } } ] }, "aggregations": { "by_brand": { "buckets": [ { "key": "Aero", "doc_count": 1 } ] } } } POST/v1/tenants/:tenant/es/:index/_count- Count the documents matching a query. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/es/shop.products/_count" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ --data-binary @query.json 200 OK { "count": 1 } GET/v1/tenants/:tenant/es/:index/_doc/:id- Read one document by id. HEAD on the same path answers existence only, and /_source/:id returns the document with no envelope. curl "$OC_BASE_URL/v1/tenants/$OC_TENANT/es/shop.products/_doc/sku-8842" \ -H "Authorization: Bearer $OC_API_KEY" # bare document, one field curl "$OC_BASE_URL/v1/tenants/$OC_TENANT/es/shop.products/_source/sku-8842?_source_includes=price" \ -H "Authorization: Bearer $OC_API_KEY" { "_index": "shop.products", "_id": "sku-8842", "_version": 2, "found": true, "_source": { "name": "Carbon Marathon", "brand": "Aero", "price": 139 } } GET/v1/tenants/:tenant/es/:index/_field_caps- What each field is, read from the stored mapping. This is the call dashboards make on connect. curl "$OC_BASE_URL/v1/tenants/$OC_TENANT/es/shop.products/_field_caps?fields=*" \ -H "Authorization: Bearer $OC_API_KEY" { "indices": ["shop.products"], "fields": { "name": { "text": { "type": "text", "searchable": true, "aggregatable": false } }, "brand": { "keyword": { "type": "keyword", "searchable": true, "aggregatable": true } }, "price": { "long": { "type": "long", "searchable": true, "aggregatable": true } } } } POST/v1/tenants/:tenant/es/:index/_delete_by_query- Delete matching documents. Honors max_docs; an unbounded whole-table delete is refused rather than run. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/es/shop.products/_delete_by_query" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ --data-binary @query.json 200 OK { "total": 3, "deleted": 3, "failures": [] } Graph traversal Reads relations declared on a manifest. PKs are passed as path-encoded strings (single-column, string-typed). GET /v1/tenants/:tenant/graph/:schema/neighbors?rel=&pk= - Forward one-hop. Returns the destination PKs along `rel` from `pk`. curl "$OC_BASE_URL/v1/tenants/$OC_TENANT/graph/social.users/neighbors?rel=follows&pk=alice" \ -H "Authorization: Bearer $OC_TOKEN" 200 OK ["bob", "carol", "dave"] GET /v1/tenants/:tenant/graph/:schema/reverse?rel=&pk= - Inbound one-hop: who points AT `pk` along `rel`. Use the registered relation and destination key; see the graph reference for relation direction and supported key shapes. curl "$OC_BASE_URL/v1/tenants/$OC_TENANT/graph/social.users/reverse?rel=follows&pk=bob" \ -H "Authorization: Bearer $OC_TOKEN" 200 OK ["alice", "frank"] GET /v1/tenants/:tenant/graph/:schema/bfs?rel=&pk=&max_depth= - Breadth-first search up to `max_depth` (default 3). Returns reachable nodes with depth. curl "$OC_BASE_URL/v1/tenants/$OC_TENANT/graph/social.users/bfs?rel=follows&pk=alice&max_depth=2" \ -H "Authorization: Bearer $OC_TOKEN" 200 OK [ { "pk": "bob", "depth": 1 }, { "pk": "carol", "depth": 1 }, { "pk": "ed", "depth": 2 } ] GET /v1/tenants/:tenant/graph/:schema/path?rel=&src=&dst=&max_depth= - Reachability check: is there an `rel`-path from `src` to `dst` within `max_depth` hops? curl "$OC_BASE_URL/v1/tenants/$OC_TENANT/graph/social.users/path?rel=follows&src=alice&dst=ed&max_depth=3" \ -H "Authorization: Bearer $OC_TOKEN" 200 OK { "reachable": true } GET /v1/tenants/:tenant/graph/:schema/dijkstra?rel=&src=&dst=&weights_json= - Weighted shortest-path. `weights_json` is a JSON object mapping `"|"` -> f64. A manifest weight-column variant is available - contact support. curl --get "$OC_BASE_URL/v1/tenants/$OC_TENANT/graph/road.cities/dijkstra" \ -H "Authorization: Bearer $OC_TOKEN" \ --data-urlencode "rel=connects" \ --data-urlencode "src=NYC" \ --data-urlencode "dst=SFO" \ --data-urlencode 'weights_json={"NYC|CHI":2.0,"CHI|DEN":1.5,"DEN|SFO":1.2}' 200 OK { "cost": 4.7 } Online schema migrations Submit a diff, watch backfill progress, then cut over atomically. Aborts are allowed pre-cutover only. Every state transition is durably journaled. POST /v1/tenants/:tenant/migrations - Submit a migration. Body: `{schema, diff}` where `diff` is a `Vec`. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/migrations" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "schema": "trading.orders", "diff": [ { "AddColumn": { "name": "venue", "type": "str", "default": "NYSE" } } ] }' 200 OK { "id": "0192ab...", "tenant": "01HW...ZZ", "schema": "trading.orders", "state": "Backfilling", "diff": [ ... ], "progress": { "rows_seen": 0, "rows_total": null } } GET /v1/tenants/:tenant/migrations - List every migration the tenant has submitted (active + terminal). curl "$OC_BASE_URL/v1/tenants/$OC_TENANT/migrations" \ -H "Authorization: Bearer $OC_TOKEN" 200 OK [ { "id": "...", "schema": "trading.orders", "state": "Backfilling", ... }, ... ] GET /v1/tenants/:tenant/migrations/:id - Read one migration. Poll for backfill progress. curl "$OC_BASE_URL/v1/tenants/$OC_TENANT/migrations/0192ab..." \ -H "Authorization: Bearer $OC_TOKEN" { "id": "...", "state": "ReadyToCutover", "progress": { "rows_seen": 1240000, ... } } POST /v1/tenants/:tenant/migrations/:id/cutover - Atomic cutover. Only legal in `ReadyToCutover` state. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/migrations/0192ab.../cutover" \ -H "Authorization: Bearer $OC_TOKEN" { "id": "...", "state": "Completed", ... } POST /v1/tenants/:tenant/migrations/:id/abort - Abort. Only legal pre-cutover. Once the migration is `Completed`, abort returns 409. curl -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/migrations/0192ab.../abort" \ -H "Authorization: Bearer $OC_TOKEN" { "id": "...", "state": "Aborted", ... } GET /v1/tenants/:tenant/migrations/_audit - Append-only audit log of every state transition (submit / cutover / abort / auto-cutover) with actor + UNIX timestamp. curl "$OC_BASE_URL/v1/tenants/$OC_TENANT/migrations/_audit" \ -H "Authorization: Bearer $OC_TOKEN" 200 OK [ { "id": "...", "schema": "trading.orders", "state": "Backfilling", "at_secs": 1714512000, "actor": "...", "event": "submit" }, { "id": "...", "schema": "trading.orders", "state": "Completed", "at_secs": 1714512042, "actor": "...", "event": "cutover" } ] Replication (admin) Lease-driven active-passive coordination. The lease holder is the sole writer; followers tail frames from the leader. These endpoints are operational, not application-facing - most tenants never call them. GET /v1/replication/lease - Read the current lease (or null if vacant). curl "$OC_BASE_URL/v1/replication/lease" \ -H "Authorization: Bearer $OC_TOKEN" 200 OK { "epoch": 4, "holder": "writer-a", "expires_at_secs": 1714512030, "etag": "..." } POST /v1/replication/lease - Try-acquire the lease. `ttl_secs` defaults to 30. Returns 409 if held by another writer. curl -X POST "$OC_BASE_URL/v1/replication/lease" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "holder": "writer-a", "ttl_secs": 30 }' { "epoch": 5, "holder": "writer-a", "expires_at_secs": 1714512060, "etag": "..." } GET /v1/replication/frames?since_segment=&epoch= - Export the log from `since_segment` onwards as hex-encoded entries. Management-plane convenience; production followers stream raw bytes via the dedicated transport. curl "$OC_BASE_URL/v1/replication/frames?since_segment=4&epoch=5" \ -H "Authorization: Bearer $OC_TOKEN" 200 OK ["7b226c736e223a..."] Health & observability All three are public (no auth) so load balancers and Prometheus scrapers can probe without a credential. GET /health - Liveness - process is up and the log is mounted. curl "$OC_BASE_URL/health" 200 OK { "status": "ok" } GET /ready - Readiness - the bare call reports storage health and answers 200 even when `status` is degraded. Use `?require=write` (or `?require=read`) for the strict probe; `pressure` carries the reason. Follower lag is not part of the check. curl "$OC_BASE_URL/ready" { "write_ready": true, "status": "ready" } GET /metrics - Prometheus exposition - request latencies, cache hits, log bytes, replication counts. curl "$OC_BASE_URL/metrics" 200 OK (text/plain) # HELP oc_query_latency_ms /v1/query end-to-end latency. # TYPE oc_query_latency_ms histogram oc_query_latency_ms_bucket{le="10"} 9218 oc_replication_frames_total 41702 oc_plan_cache_hits_total 41190 ... SQL - scope today SELECT, INSERT, UPDATE and DELETE execute on the SQL endpoint. Do not re-issue a successful SQL mutation against the row API. The response kind and fields depend on the statement; see the SQL reference and transaction guide for commit boundaries. Request and capacity limits Previous Page Release notes Next Page --- ## Write data and keep indexes in sync | OriginChainDB docs Canonical source: https://originchaindb.com/docs/insert Write data and keep indexes in sync Write a record first, then add the search indexes your application needs. This guide explains which changes happen together and which require separate requests. Keep records and search data connectedAttached indexes follow their declared maintenance rules; explicit vector and document writes remain separate operations. 01 Save the source recordChoose a stable ID and validate its field types. 02 Prepare the search representationGenerate vectors or prepare document text when your query needs them. 03 Write the required index dataReuse the source ID in each explicit write. 04 Verify search and sourceFind a known match, then open the record using its ID. Before you write Complete the quickstart to create quickstart.products. The request below uses the explicit-tenant API: OC_BASE_URL, OC_TENANT and OC_BEARER must come from the connection settings supplied for that API. Do not extract a tenant from the current Connect URL. For a complete OC_URL, use the URL exactly as supplied, as shown in the quickstart. Add the database identity headers when required. 1. Write a record curl --fail-with-body -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/rows/quickstart.products" \ -H "Authorization: Bearer $OC_BEARER" \ -H "Content-Type: application/json" \ -d '{"id":"product-002","name":"Travel flask","price_cents":2490}' The row endpoint is an upsert by primary key. Reusing an ID can replace an existing row; it is not an insert-only operation. Use the documented expect=insert precondition when an existing key must produce a conflict, or use SQL INSERT. See row CRUD for partial updates, concurrency checks and deletion. 2. Import multiple rows Use Migrate for a source database or supported file import. The batch HTTP endpoint accepts its own documented payload and limits. Check each response and any per-row failures before advancing an import checkpoint; a successful connection is not proof that all source rows arrived. 3. Add semantic search Use a saved embedder and embedding run to populate vectors from table columns, or generate embeddings in your application and call the vector-table API. Keep the dimension and model consistent. A vector write is separate from a row write and does not create the source record. 4. Add full-text search There are two workflows. A table full-text index is maintained as its source rows change. The explicit /fts/:table/:field document endpoint indexes the text your application sends; update those entries when the source changes. Use the row’s primary key as doc_id so a hit can be resolved to a record. See full-text search. Requests have body limits; this is not an unlimited document-upload API. Split large text into useful chunks, keep their IDs stable and retain a mapping to the source record. 5. Maintain relationships Declare a relation in the schema or use the supported ALTER TABLE … ADD RELATIONSHIP workflow. Writes to its source column maintain the relation’s graph indexes. Adding a foreign key enforces referential integrity; declaring a graph relation alone does not prove the target exists. See graph setup. 6. Know the transaction boundary Three independent HTTP calls do not form one transaction. A row write and its maintained graph indexes share the row operation. Explicit vector and full-text calls commit separately. If the vector call fails after a successful row call, the row remains saved. Use the same stable record ID across the relevant indexes. Check each operation before marking the record ready for retrieval. Record pending index work and retry only the failed operation under its supported idempotency contract. Reconcile missing or stale index entries periodically. A timeout can leave the outcome unknown; read back or reconcile before repeating a mutation. A helper that sends all three calls makes application code simpler but does not make them atomic. Use a documented transaction surface only for operations that surface actually supports. The multi-model examples explain how to coordinate these writes. Write from your application Use an SDK version that matches your connection, or call the HTTP endpoints from your application. The SDK directory separates published versions from upcoming clients. A client library does not change transaction boundaries: check each operation and handle partial failures just as you would with HTTP. Read and write records Choose a single-record request, a batch or SQL for the change you need. Import records in the console Next Page --- ## Connect an AI client with MCP | OriginChainDB docs Canonical source: https://originchaindb.com/docs/integrations/mcp Connect an AI client with MCP Model Context Protocol (MCP) lets an AI application call tools in other software. An OriginChainDB MCP server can act as the connection between that application and database requests. Availability: MCP is hidden in the new one-token console flow while a compatible published server is being verified. Earlier setup notes describe a separate early-access implementation. Do not use an old package command or credential template as a current installation guide. For example, a schema-list tool can return the names of available tables and fields. That helps the client prepare a query; it does not prove the generated query is correct. The MCP request path, when availableA compatible published server is still being verified; use the supported HTTP API in the meantime. 01 The client selects a toolIt chooses a database operation for the question. 02 The server applies credentialsIt uses its configured connection and database permissions. 03 The database handles the requestThe chosen query model needs its data and indexes prepared. 04 The client receives the resultReview returned records before relying on the generated answer. Before you connect Contact the team to confirm whether a compatible server is available for your client and deployment. Ask for the package source, supported client versions and the exact credential contract before connecting. Use a test dataset that you are allowed to share with the AI client and its model provider. Configure the connection There is no current public installation command in this guide. Use only the package and configuration supplied for a confirmed compatible release. The application API now uses the complete address supplied as OC_URL and its supported OC_TOKEN credential. Do not assume that a legacy MCP package accepts that contract or translate older host/tenant settings yourself. Never paste a token into an AI prompt. Available tools The earlier implementation described these tools. Their names explain the intended tasks; they are not a claim that a current package is published. ToolTask oc_list_schemasInspect tables and fields. oc_sqlRequest supported SQL operations. oc_askAsk a plain-language database question where enabled. oc_vector_topkFind similar stored vectors. oc_fts_searchFind words in indexed text. Each search method needs its own prepared data and index. Several tool calls remain separate requests. Check the setup with a small request After the team confirms a compatible package: Verify that its tools appear in your client. Request the available table names and compare them with the intended database. Try a small read from known sample data. Review the returned data and any tool error before trying another operation. If setup fails, share the client version, tool name and redacted error with support. Do not include credentials. Decide what the client can access Use only the access required for the task. An AI client is not automatically read-only, and a tool call does not bypass database permissions. Review how the client handles results and which model provider receives them. Read about database permissions or ask about MCP availability. Build search and RAG Previous Page Natural-language use cases Next Page --- ## PostgreSQL ingest connector. | OriginChainDB docs Canonical source: https://originchaindb.com/docs/integrations/postgres-ingest PostgreSQL ingest connector. This guide describes the legacy one-time PostgreSQL ingest endpoint. It copies selected source rows into OriginChainDB. For managed copy and live sync, start with Migrate and check the source options supported by your instance. Copy a PostgreSQL table onceThis legacy one-shot endpoint is separate from managed Migrate and its supported live-sync workflows. 01 Map source and targetCheck the source table, target schema and primary key. 02 Supply permitted source accessUse the documented connection contract for this endpoint. 03 Run the one-shot copyInspect the operation’s response and any failed rows. 04 Compare the copied recordsVerify IDs, values and counts before switching application reads. Quickstart. curl -X POST "https://acme.db.originchain.ai/v1/tenants/$T/ingest/postgres/sync" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "source": { "host": "pg.internal", "port": 5432, "database": "production", "user": "readonly", "password": "***", "sslmode": "require" }, "mappings": [ { "source_table": "public.orders", "target_schema": "orders", "primary_key": ["id"], "columns": ["id", "customer_id", "amount", "status", "created_at"] } ] }' Source config. host / port / database Source endpoint. Must be reachable from your OriginChainDB instance — public, peered, or via a private endpoint on Enterprise. user / password Read-only Postgres role recommended. Credentials are held in memory for the duration of the sync. sslmode "require" or "verify-full". Plaintext is rejected. Target schema mapping. Each mapping picks a source table, a target OriginChainDB schema, a primary key, and the columns to pull. The connector creates the OriginChainDB schema if it does not exist, with column types inferred from the Postgres type map. You can declare the schema up-front in the manifest if you want explicit control. Scheduling. v1 is one-shot: each POST runs a complete sync. Schedule from your side (cron, a queue, or a tiny scheduler script) until the engine ships a managed scheduler. The endpoint is idempotent on primary key — the same row pulled twice overwrites; no duplicates. import os, requests, schedule, time def sync_once(): requests.post( f"{os.environ['OC_ENDPOINT']}/v1/tenants/{os.environ['T']}/ingest/postgres/sync", headers={"Authorization": f"Bearer {os.environ['OC_TOKEN']}"}, json={ "source": {...}, "mappings": [...], }, timeout=900, ).raise_for_status() schedule.every(15).minutes.do(sync_once) while True: schedule.run_pending() time.sleep(1) What's next. For ongoing copy and supported live-sync sources, use Migrate. That managed workflow is separate from the one-time endpoint on this page. Confirm source support, access and job status in your deployment before planning a cutover. Move existing data Previous Page Connect a PostgreSQL client Next Page --- ## Move data with Migrate | OriginChainDB docs Canonical source: https://originchaindb.com/docs/migrate Move data with Migrate Migrate copies data from a source database into OriginChainDB. Review the table and field mappings, check the copied rows and resolve failures before switching your application. This workflow requires a dedicated configuration. Supported PostgreSQL and MySQL sources can use live sync; other sources use copy. Check the options offered by your deployment. Move data with a verified handoverLive sync is supported for specified PostgreSQL and MySQL sources; other source paths may be copy-only. 01 Review the mappingCheck schemas, field types, keys and source access. 02 Validate the migration planResolve reported issues before starting the copy. 03 Copy and monitor progressInspect errors and checkpoints; use live sync only where supported. 04 Verify before switchingCompare target data and confirm the cutover conditions. Choose a source Open your instance, then Platform → Migrations → Data migration. Supported sources include PostgreSQL and CockroachDB, MySQL and MariaDB, SQL Server, MongoDB, and S3-compatible object-storage files in CSV, TSV, JSONL or JSON-array format, including gzip-compressed data. For MongoDB, include the database name in the connection string; both mongodb:// and mongodb+srv:// forms are accepted. A one-time copy reads selected source data. Live migration also needs source replication access: PostgreSQL creates a replication slot and publication while sync runs. Neither workflow changes your source rows. Review the plan before approving Source: provide the source connection and destination namespace. Choose whether to allow masked samples for type detection. With samples off, analysis reads the structure only. Review: choose the objects to include, inspect destination names and field types, review primary keys, and resolve conversion or naming warnings. Enhance: review full-text fields and graph mappings. Full-text fields can be added to tables with composite primary keys. Edge-table mappings turn each source row into an edge. Foreign keys to unique non-primary columns can also become relationships for PostgreSQL, CockroachDB, MySQL and SQL Server, when the destination target has a single-column primary key. Check the proposed mapping before approving. Approve: confirm the reviewed plan. Previously approved plans keep their original definitions; start a new migration to use changes to planning behavior. Move: follow copied and set-aside counts, inspect problems and review the verification result. Optional source settings include treating MySQL zero dates as empty values and a SQL Server certificate-trust option. Review their effect before enabling them; these are choices for the source connection, not required defaults. Check data without copying it Use Check data to find values that do not fit the plan before a move. The check does not write to the destination. It is also available after a failed or cancelled move. When masked samples are disabled, reported reasons identify the column and problem without showing values. Understand a partial result The default “If a value can’t be moved” choice sets that row aside and continues. You can instead choose Stop the table. A table with set-aside rows is partial, not Verified. Review the recorded reasons and counts rather than treating a completed copy as proof that every row arrived. After fixing source values, manually retry set-aside rows for supported PostgreSQL, CockroachDB, MySQL and SQL Server tables with usable primary keys. Retry adds missing rows without overwriting existing records. It is not automatic and is unavailable for MongoDB and file sources. Optionally embed selected rows With a tested saved embedder, select the text columns in the order to combine them and the conditions for rows to embed. All selected source rows still move; only matching rows are embedded. Set the required maximum number of rows to embed and review the provider’s data handling. See saved embedders and embedding runs. Keep copying changes until switchover For a supported PostgreSQL or MySQL source, choose the live migration option offered by the console. Meet its replication prerequisites before starting; ordinary read access alone may be insufficient. Allow the initial copy to finish, then watch Estimated lag, Changes applied and Last applied. A busy MySQL source can accumulate lag. A disconnected or stalled stream needs attention even if the initial copy completed. Pause application writes to the source before choosing Switch over. Follow the confirmation shown by the console and keep writes paused while it finishes applying changes and recounting the tables. Review every recounted table result and any set-aside rows. Only then point your application at OriginChainDB and verify its reads and writes. Stop syncing ends synchronization and keeps copied destination rows. Starting sync again requires a new live migration. If source cleanup is pending, follow the displayed instructions until the replication slot is released; do not assume that cancelling the copy has cleaned up the source. Live sync is a migration workflow, not permanent bidirectional replication. Follow the workflow Watch the migration workflow overview. The video may predate newer source options; use this guide and the current console for availability. The migration FAQ explains common row and mapping questions. Console and API workflows Previous Page PostgreSQL ingest connector Next Page --- ## Multi-node configurations | OriginChainDB docs Canonical source: https://originchaindb.com/docs/multi-node Multi-node configurations A multi-node configuration distributes work across more than one engine process. Its behavior depends on the deployed topology and supported APIs. Start with measured workload requirements, not an assumed throughput multiplier. Evaluate a multi-node configurationQuery, transaction and recovery behavior depend on the deployed topology. 01 Measure the workloadIdentify the capacity or resilience problem to solve. 02 Check data placementConfirm how tables and requests are distributed. 03 Test representative operationsInclude the exact joins, writes and failure cases you need. 04 Compare correctness and recoveryValidate results and behavior before relying on the configuration. What multi-node gives you. More nodes can provide additional capacity, but they also introduce routing, replication and recovery work. Confirm which operations your configuration supports. This guide does not promise a fixed speed increase, multiplied request quota or atomic cross-node transaction. One endpoint, no client changes. Use the connection address returned by Connect for the selected configuration. Keep it unchanged, including path segments. A single address does not imply identical support for every query method. Test the exact SQL, search and graph operations your application will send. Current limits - refused honestly, never answered wrong. Check the instance capabilities and test representative requests. Cross-node SQL, access policies, Ask and transactions can have different restrictions from a single-node deployment. If an operation returns an unsupported-feature error, use a supported query or configuration. Repeating the request will not enable the feature. See transaction limits and error handling. How data is distributed. Confirm how tables and records are assigned to nodes in the proposed configuration. Table placement affects joins, cross-table transactions and recovery. Do not assume that adding nodes automatically spreads one busy table or makes a cross-node operation local. Choosing a node count. Measure query time, write volume and peak concurrency on representative data. Check indexes and batch small operations before adding resources. Test the proposed configuration with the same workload. Compare results, errors and recovery behavior as well as throughput. See request limits for controlling concurrency. Growing later. Ask the team which resizing and migration steps are supported for your deployment. Confirm whether a change needs a maintenance window, data movement or a client reconnect. Keep a recovery plan and verify the workload after the change. Managed deployments Previous Page Monitoring and recovery Next Page --- ## Natural-language querying by industry | OriginChainDB docs Canonical source: https://originchaindb.com/docs/nql/industries Natural-language querying by industry These examples show plain-language questions about operational, financial and support data. Start with known tables, ask one focused question and compare the returned rows with the intended query. Availability depends on the instance configuration. Turn a business question into checked rowsIndustry examples need their own tables; a displayed Ask plan accompanies an executed query. 01 Choose the relevant business dataSelect the tables and clarify field names and units. 02 Ask a focused questionState the time period, filters and result you want. 03 Review the executed planCheck selected tables, conditions and calculations. 04 Validate the business meaningCompare returned records with a known example. Operations: the question nobody wrote a dashboard for Dashboards answer the questions someone anticipated. Incidents produce the others. Ask it directly No ticket to the data team, no new panel, and the answer comes from live rows rather than yesterday's export. { "nl": "which services had more than 50 errors in the last hour?" } show the plan next to the answer An operator acting on a number needs to know which table it came from. Return the plan alongside the rows and the answer becomes checkable. Finance: self-service without a warehouse export The recurring monthly questions are known; the follow-ups are not. Scope it and ask Name the relevant schemas so Ask has fewer tables to interpret. Schema selection narrows the question; it does not grant or enforce access. { "nl": "settled volume by currency last month", "schemas": ["fin.payments"] } permissions still apply Use the intended database identity and verify permissions on the generated query. Check allowed and denied results. A natural-language prompt is not an access-control boundary. Support: triage in the agent's own words An agent asks about a customer mid-conversation and needs the answer now, not a query builder. One sentence, one answer Ordinary phrasing, over the same tables the product writes to. { "nl": "open tickets for acme corp older than three days" } Internal tools: an assistant with a real backend The assistant should read the database, not a copy of it, and should be honest when it cannot. Plan first, then run Check the contract of the endpoint you use. In the documented /ask request, show_plan returns the plan alongside executed results; it is not a dry run. Review permissions before sending a request and inspect its plan and rows afterward. { "nl": "...", "plan_only": true } // inspect { "nl": "..." } // then execute an agent can call this directly MCP is not offered in the new one-token console flow while a compatible published server is being verified. Check MCP availability before planning an agent integration. What these have in common Inspect the plan and rows. A successful request can still reflect a misunderstood question. Name the relevant tables. Give Ask enough context to identify the fields you mean. Your policies still hold. The generated query runs as the caller, under the same row and column rules. Start from zero — Ask, scope, inspect the plan. Ask reference — Request fields, plan inspection and limits. Connect an AI client with MCP Previous Page Ask the documentation Next Page --- ## Ask your first question | OriginChainDB docs Canonical source: https://originchaindb.com/docs/nql/quickstart Ask your first question Ask a plain-language question about a table you already know. This walkthrough uses the quickstart product record, then checks the generated query and returned rows. Ask requires the relevant instance configuration; it is not guaranteed on every deployment. Check your first Ask resultPrepare the quickstart product table first; Ask executes the generated query. 01 Load the sample productKeep the Trail mug row and its price in cents. 02 Ask about product pricesRequest the highest-priced products in the selected table. 03 Inspect the returned planCheck the price field, descending order and requested limit. 04 Compare the returned rowConfirm the Trail mug value matches the sample data. 1. Prepare known data Complete the HTTP quickstart. It creates quickstart.products and the Trail mug record. Keep the complete OC_URL and OC_TOKEN from that setup. Do not add tenant path segments yourself. Confirm that the instance exposes the Ask endpoint before continuing. Add database identity headers when required. 2. Ask a scoped question curl --fail-with-body -X POST "$OC_URL/ask" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '{"nl":"top 5 quickstart.products by price_cents desc","schemas":["quickstart.products"],"show_plan":true}' nl is the question; schemas narrows the catalog. show_plan returns the plan alongside the rows. It still executes the question; it is not a dry run. 3. Check the answer Confirm the plan names quickstart.products, sorts price_cents descending and limits the result to five. With only the quickstart fixture, the result includes Trail mug. Compare the answer with an explicit SQL query when correctness matters. A successful response is not proof that natural language preserved every condition. Check filters, grouping, units, ordering and null behavior. An empty result can be a valid answer or a misunderstood question. 4. Understand the compiler A deterministic grammar handles supported simple questions first. A configured language model can handle questions outside that grammar. If fallback is unavailable or compilation fails, show the returned error rather than inventing an answer. Review what question and schema context is sent to the configured provider. The prompt grammar covers scans, projections, filters, distinct values, sorting, limits, common aggregates and relation hops. It does not promise that arbitrary SQL, joins, CTEs or graph algorithms can be generated from any question. Use explicit SQL or graph endpoints for a query shape you need to control. 5. Treat caching as an optimization The cache field reports plan reuse, not a cached answer. Rows are queried again. Schema and authorization context affect reuse; do not depend on a particular cache outcome for application correctness. Do not re-register a schema solely to force a cache miss. Use the right client surface Use the HTTP request shown above for the documented Ask options. SDK publication and helper support differ by version; do not assume a private or unpublished client exposes this feature. Check the SDK directory and Ask reference. The console’s Ask AI assistance is a separate workflow. Do not infer its availability or execution controls from the engine’s /ask endpoint. Ask in natural language Previous Page Natural-language query plans Use clear table and column names, then review the generated query. --- ## Monitor and recover a database | OriginChainDB docs Canonical source: https://originchaindb.com/docs/ops Monitor and recover a database Keep a record of your instance configuration, recovery procedure and working connection details. This guide explains what to check during normal operation and when something fails. Investigate an instance before changing itA recovery option is only useful when you have verified its recovery procedure. 01 Identify the affected instanceRecord its state, timing and the reported symptom. 02 Narrow the causeSeparate access problems, workload pressure and storage issues. 03 Use the matching procedureFollow the supported configuration or recovery steps. 04 Verify service after the changeTest reads, permitted writes and the relevant recovery evidence. Health checks Use health checks to distinguish a running process from a database ready for the operation you need. A successful liveness check is not proof that writes, replication and backups are healthy. CheckWhat to inspect Process healthStatus and error body from the health endpoint. ReadinessThe requested read/write readiness and any pressure reason. StorageFree space, write errors and recovery state. ReplicationStandby state and lag where configured. Per-tenant usage signal Use the documented usage endpoint for counts and activity available on your deployment. Missing telemetry is unavailable, not zero. Console sample metrics are not production measurements. Write durability Durability describes whether an acknowledged write survives a failure. The guarantee can differ between source rows, explicit vector writes, full-text indexes and other derived structures. Confirm the behavior for the exact engine build and write interface you use. A successful primary write does not prove that an asynchronous standby has received it. Keep enough source data to rebuild derived indexes, and test recovery before making an application commitment. Treat a full storage volume or an unclean restart as an incident. Restore capacity, follow the supported recovery procedure and verify subsequent writes before returning the instance to normal use. Backups Confirm which snapshots and archives your configuration creates, where they are stored and how long they are retained. Check the latest completed recovery point, not just whether a backup option is selected. Practice restoring into a separate instance. Verify representative records and indexes, then measure how long the application takes to reconnect. Do not assume a fixed retention window or recovery time from an older plan name. Continuous backup streaming An archive can capture changes between base snapshots. Its actual recovery point depends on successfully uploaded and replayable data. A configured interval is not evidence that each interval completed. Check archive progress and the latest restorable timestamp. If the archive is delayed or stopped, plan recovery from the confirmed snapshot or recovery point and contact support. Failover Failover moves service to a replacement primary. Whether it is manual or automatic depends on the configured topology. With asynchronous replication, the replacement may be missing recent writes. Confirm the failure and prevent the old primary from continuing to accept writes. Inspect the standby’s health and replication position. Follow the supported promotion procedure. Check read/write readiness before moving traffic. Verify records and reconnect clients. Do not infer a time budget or zero data loss from the presence of a standby. Test the actual procedure with your configuration. Schema migrations A schema migration changes a table’s structure. Review its supported operations, backfill behavior and cutover boundary before starting. A backfill processes existing records; cutover makes the new structure active. Use a test database first. Check progress and errors during the live operation. An abort may be available before cutover, while a completed migration can require a new migration to reverse it. See the schema reference. Observability Watch errors, query time, resource pressure, storage and any configured replication or backup progress. Use query plans to investigate expensive work. EXPLAIN inspects a query plan; EXPLAIN ANALYZE executes the query. See query diagnostics. Use only monitoring endpoints and exporters available on your deployment. Incident response Record the instance, time, symptoms, affected operations and request IDs. Preserve logs without credentials or private records. Reduce additional load or writes when needed to protect recovery. Contact support and follow the agreed service procedure. This guide does not establish response-time or resolution-time commitments; those belong in your service agreement. Compliance posture ISO 27001 certification and SOC 2 Type II attestation are in progress. Neither is complete. See the security page for status updates. A company certification does not configure your application’s access controls or establish compliance for its workload. Review permissions, data handling, retention and contractual requirements for your use case. Recreate affected older FTS and geo indexes Older full-text and geospatial indexes may require recreation when crossing the compatibility boundary described in the 19 October release notes. Check the source and target engine versions before planning an upgrade. Identify affected indexes and keep a backup or recoverable source dataset. Recreate them using the supported procedure. Wait for completion and check errors. Compare known queries and record counts before switching application traffic. Recreation is operational work. Reading the release notes or changing a schema file does not rebuild an index. Multi-node configurations Previous Page Multi-region (in development) Next Page --- ## PostgreSQL compatibility | OriginChainDB docs Canonical source: https://originchaindb.com/docs/postgresql-compatibility SQL clients & compatibility PostgreSQL compatibility PostgreSQL compatibility lets supported clients send queries using the PostgreSQL protocol. It is not a complete PostgreSQL server. The currently offered per-member database login is read-only; use the HTTPS API for supported writes. Check a PostgreSQL client’s actual behaviorThe current database login is read-only; protocol compatibility is not full PostgreSQL compatibility. 01 List the client’s queriesInclude connection probes and queries generated by the ORM. 02 Check supported behaviorReview syntax, types and any deployment restrictions. 03 Connect with Database loginUse its supplied host, port, credentials and TLS settings. 04 Compare results carefullyTest nulls, precision and response shapes with known data. Connect a driver or ORM Start with SQL client connections. Copy the listener settings and separate database login from Connect. Test the exact driver version and queries your application needs. A connection test alone does not establish ORM, migration or administration support. Transaction behavior The current database login does not permit write transactions. Engine transaction behavior documented elsewhere can apply to a different authenticated interface. Do not transfer those guarantees to a client simply because it speaks PostgreSQL. Use the HTTP SQL transaction guide for supported write workflows and check the deployed capabilities. Multi-statement requests and schema changes Keep schema changes separate from application data writes. A supported schema operation can apply immediately and may not be undone by ROLLBACK. Multi-statement requests can also have different boundaries from a single statement. These are engine compatibility notes, not permission to run migrations through the current read-only database login. Keys, values and expressions Test NULL handling, defaults, generated keys, conflict behavior and returned column types with representative records. Use the SQL reference for the supported syntax and constraints for checks and references. Handle the reported error Test numeric precision and date/time values end to end: database result, driver decoding and application serialization. Keep exact values as their documented representation rather than converting them to an unsafe floating-point number. Use bound parameters for values. Known differences to test Read the returned SQLSTATE and message. A permission error needs an access review; an unsupported statement needs a different query or interface. A retry cannot turn either into a supported operation. See error handling. Connect a PostgreSQL client Previous Page Connect MySQL or SQL Server Next Page --- ## Query data | OriginChainDB docs Canonical source: https://originchaindb.com/docs/query SQL Query data Choose the query that matches your question. Each method has its own setup, request fields and response format. Prepare the data before calling its endpoint. SQL — Filter rows, combine tables and calculate totals. Vector search — Find records with similar meaning using stored numeric representations called embeddings. Full-text search — Find words and phrases, or rank matches. Check the API’s supported text analysis; engine-only language features are not automatically available through HTTP. Graph — Follow relationships, find reachable records or inspect a path. Ask — Ask a focused question in plain language, then check the generated plan and returned rows. From prepared data to the right resultEach endpoint returns its own result shape; your application connects results through record IDs. 01 Identify the prepared modelCheck which tables, vectors, text indexes or relations exist. 02 Use its query interfaceSupply the input expected by that endpoint. 03 Inspect the response shapeRead rows, ranked IDs, word matches or graph paths. 04 Resolve the source when neededUse matching IDs to retrieve the original record. Shared mechanics. Use the options documented for the endpoint you call. Explain output, timeouts and cancellation differ between APIs. The current guide explains shared timeout and query-ID headers; individual endpoint references describe their fields. A query plan describes the work the database performs: scanning a table, selecting rows, joining records or calculating totals. See SQL for supported query shapes and Ask for inspecting a generated plan. SQL syntax Choose fields, add useful indexes and read the returned values correctly. Transactions Next Page --- ## Run your first query | OriginChainDB docs Canonical source: https://originchaindb.com/docs/quickstart Run your first query In this guide, you will create a product table, save one row and find it with SQL. You need a running OriginChainDB instance and a terminal with cURL. The examples use Bash syntax. Save one product and read it backUse the complete address and credential from Connect for all requests in this example. 01 Connect to a ready instanceKeep the full connection address unchanged. 02 Create the product tableDeclare its ID, name and price fields. 03 Write the Trail mug rowStore its price as 1990 cents. 04 Query products under 2000 centsCheck that the returned record is the one you saved. Connect to your database Create an account, launch a database and wait until it is ready. Open Connect in the console and copy the complete HTTPS database address and the credential offered for that connection. export OC_URL="https://your-complete-database-address" # Load OC_TOKEN from your environment or secret manager. : "${OC_TOKEN:?Set OC_TOKEN before continuing}" Replace OC_URL with the exact address from Connect, including its path. Keep the credential private and choose access that allows schemas, row writes and SQL. Connection setup explains which credential is available for your instance. If your administrator supplied an explicit host-and-tenant connection instead, use the tenant-path API quickstart. Do not add or remove a tenant path from the address supplied by Connect. Create a table and add data This creates quickstart.products with a string ID, a name and an integer price in cents. Create the table through the HTTP SQL endpoint curl --fail-with-body -X POST "${OC_URL%/}/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"sql":"CREATE TABLE quickstart.products (id TEXT PRIMARY KEY, name TEXT, price_cents BIGINT)","params":[]}' Add one product curl --fail-with-body -X POST "${OC_URL%/}/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"sql":"INSERT INTO quickstart.products (id, name, price_cents) VALUES ($1, $2, $3)","params":["product-001","Trail mug",1990]}' Run creation and insertion once in a development database. If the table or product already exists, inspect it before rerunning a write. Wait for each request to succeed; a timeout does not prove that a write failed. See the error reference for a rejected request. Ask for the products you need Run a SQL query against the same table. This selects products priced below 2,000 cents. curl --fail-with-body -X POST "${OC_URL%/}/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"sql":"SELECT id, name, price_cents FROM quickstart.products WHERE price_cents < $1 LIMIT 10","params":[2000]}' Expected result from quickstart.products idnameprice_cents product-001Trail mug1990 You've created a schema, written a record and queried it. Change the price filter and run the query again to see how the result changes. Choose your next step. Once the query works, call the same HTTP API from your application or choose a compatible SDK. The SDK directory distinguishes published packages from the new release candidates. Connect your app — Choose your language and check its available SDK version. Search by meaning — Prepare embeddings and find related content. Find exact words — Match keywords and rank text with BM25. Follow relationships — Connect records and traverse their links. Create an instance Choose a configuration, review it and open your new database. Understand schemas Decide what each record contains before you save it. --- ## RAG / LLM apps | OriginChainDB docs Canonical source: https://originchaindb.com/docs/rag RAG / LLM apps Retrieval-augmented generation (RAG) gives a language model relevant source passages before it writes an answer. Store each passage, find useful matches and keep source IDs so a reader can check the answer. SQL rows, vector entries and explicit full-text documents use separate requests. Your application must keep them aligned and verify access for each query path. Build an answer from retrieved passagesYour application coordinates retrieval and generation; keep source IDs so readers can check the answer. 01 Store passages with source IDsKeep the original document and passage location. 02 Prepare the search dataCreate compatible embeddings or the required text index. 03 Retrieve relevant passagesApply the supported filters and inspect the selected context. 04 Generate and check the answerSend the selected context to your model and verify its citations. 1. Schema for chunks. A chunk is a short passage saved as one record. Give it a stable ID, its source document ID, location information and the text. The example below defines those fields. Register the schema before writing chunks. Choose chunk boundaries that preserve useful context, such as a paragraph or section. Test chunk size with your embedding model and real questions instead of relying on one universal token count. # manifest.toml - the row schema for your chunks. # Vector embeddings and the BM25 index live on separate runtime endpoints, # linked back to this row by primary key. namespace = "rag" table = "chunks" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "doc_id" ty = "str" required = true [[columns]] name = "source" ty = "str" [[columns]] name = "page" ty = "i64" [[columns]] name = "text" ty = "str" [[columns]] name = "created_ms" ty = "u64" # Index doc_id so "all chunks for this doc" is fast. [[indexes]] name = "by_doc" columns = ["doc_id"] 2. Ingest path. For each chunk, save the source row, generate its embedding, write the vector and index its text where needed. An embedding is a numeric representation of meaning. Use the same ID throughout. Check each response. If one operation fails, record what remains and retry only that work under its documented retry rules. Separate HTTP calls are not one transaction. Keep the source text until you have verified retrieval. # 1. Chunk the source text into ~512-token windows with 50-token overlap. # 2. Embed each chunk with whatever embedding model you use. # 3. Write the chunk row + the embedding + the FTS index entry. from originchain import OriginChain from openai import OpenAI import time, os db = OriginChain( base_url=f"https://{os.environ['OC_HOST']}", bearer=os.environ["OC_TOKEN"], tenant=os.environ["OC_TENANT"], ) ai = OpenAI() def ingest(doc_id, source, full_text): chunks = chunk_text(full_text, tokens=512, overlap=50) emb = ai.embeddings.create( model="text-embedding-3-small", input=[c.text for c in chunks], ) for i, c in enumerate(chunks): cid = f"{doc_id}:{i}" # 1. The row. db.rows.put("rag.chunks", { "id": cid, "doc_id": doc_id, "source": source, "page": c.page, "text": c.text, "created_ms": int(time.time() * 1000), }) # 2. The vector embedding. db.vector.put("rag.chunks", cid, emb.data[i].embedding, metadata={"source": source, "page": c.page}) # 3. The BM25 index. db.fts.index("rag.chunks", "text", doc_id=cid, text=c.text) // TS SDK doesn't wrap row writes yet - using fetch for the row write, // SDK for vector + FTS. Same logic as Python above. import { OriginChainClient } from "@originchain/sdk"; import OpenAI from "openai"; const db = new OriginChainClient({ baseUrl: `https://${process.env.OC_HOST}`, bearer: process.env.OC_TOKEN!, }); const ai = new OpenAI(); async function ingest(docId: string, source: string, fullText: string) { const chunks = chunkText(fullText, { tokens: 512, overlap: 50 }); const emb = await ai.embeddings.create({ model: "text-embedding-3-small", input: chunks.map(c => c.text), }); for (let i = 0; i < chunks.length; i++) { const cid = `${docId}:${i}`; // 1. Row write via fetch. await fetch(`https://${process.env.OC_HOST}/v1/tenants/${process.env.OC_TENANT}/rows/rag.chunks`, { method: "POST", headers: { "Authorization": `Bearer ${process.env.OC_TOKEN}`, "Content-Type": "application/json", }, body: JSON.stringify({ id: cid, doc_id: docId, source, page: chunks[i].page, text: chunks[i].text, created_ms: Date.now(), }), }); // 2. Vector embedding. await db.vectorPut("rag.chunks", { id: cid, embedding: emb.data[i].embedding, dim: 1536, metric: "cosine", metadata: { source, page: chunks[i].page }, }); // 3. BM25 index. await db.ftsIndex("rag.chunks", "text", { doc_id: cid, text: chunks[i].text }); } } 3. Retrieval + fusion. Run a vector query to find similar meaning and a full-text query to find matching words. Combine their ranked results in your application, fetch the selected source passages, then send only permitted content to the model. Ask the model to cite the supplied source IDs. Review whether the cited passages actually support the answer; a citation alone is not proof. # 1. Embed the question. # 2. Run vector topk + BM25 search in parallel. # 3. Fuse with Reciprocal Rank Fusion. # 4. Pull the chunk rows for the top-k IDs. # 5. Send them to the LLM as context. def answer(question, source_filter=None): # 1. q_vec = ai.embeddings.create( model="text-embedding-3-small", input=question, ).data[0].embedding # 2. Parallel retrieval (one round-trip each, can run concurrently). vec_hits = db.vector_topk( "rag.chunks", query=q_vec, k=20, dim=1536, metric="cosine", filter={"source": source_filter} if source_filter else None, ) fts_hits = db.fts.search("rag.chunks", "text", query=question, mode="bm25", k=20) # 3. Reciprocal Rank Fusion. Pick the top 5 fused IDs. fused_ids = rrf([h.id for h in vec_hits], [h.doc_id for h in fts_hits.hits])[:5] # 4. Pull full chunk text + metadata. rows = [] for cid in fused_ids: rows.append(db.rows.get("rag.chunks", cid)) # 5. Send to the LLM as bounded, cited context. context = "\n\n".join( f"[Source {i+1}] ({r['source']} p.{r['page']}) {r['text']}" for i, r in enumerate(rows) ) completion = ai.chat.completions.create( model="gpt-4o", temperature=0.0, messages=[ { "role": "system", "content": "Answer using ONLY the context below. Cite every claim with [Source N]. " "If the context is insufficient, say so." }, { "role": "user", "content": f"Context:\n{context}\n\nQuestion: {question}" }, ], ) return completion.choices[0].message.content async function answer(question: string, sourceFilter?: string) { // 1. Embed the question. const qVec = (await ai.embeddings.create({ model: "text-embedding-3-small", input: question, })).data[0].embedding; // 2. Parallel retrieval. const [vecHits, ftsHits] = await Promise.all([ db.vectorTopk("rag.chunks", { query: qVec, k: 20, dim: 1536, metric: "cosine", filter: sourceFilter ? { source: sourceFilter } : undefined, }), db.ftsSearch("rag.chunks", "text", { q: question, mode: "bm25", k: 20 }), ]); // 3. Reciprocal Rank Fusion. Pick top 5. const fusedIds = rrf( vecHits.map(h => h.id), (ftsHits as { doc_id: string }[]).map(h => h.doc_id), ).slice(0, 5); // 4. Fetch chunks via raw fetch (row helpers ship soon). const rows = await Promise.all(fusedIds.map(async (cid) => { const r = await fetch( `https://${process.env.OC_HOST}/v1/tenants/${process.env.OC_TENANT}/rows/rag.chunks/${cid}`, { headers: { "Authorization": `Bearer ${process.env.OC_TOKEN}` } }, ); return r.json(); })); // 5. Send to LLM. const context = rows.map((r, i) => `[Source ${i+1}] (${r.source} p.${r.page}) ${r.text}`, ).join("\n\n"); const completion = await ai.chat.completions.create({ model: "gpt-4o", temperature: 0.0, messages: [ { role: "system", content: "Answer using ONLY the context below. Cite every claim with [Source N]. " + "If the context is insufficient, say so." }, { role: "user", content: `Context:\n${context}\n\nQuestion: ${question}` }, ], }); return completion.choices[0].message.content; } 4. The RRF helper. Reciprocal rank fusion (RRF) combines ranked lists by rewarding records that appear near the top of either list. It uses rank positions rather than comparing unrelated vector and text scores. The helper below illustrates the calculation. Evaluate the resulting order with your own questions. # Reciprocal Rank Fusion - simple, language-agnostic. # Takes ranked lists of IDs, returns a fused ranked list. # k=60 is the standard constant from the original paper. def rrf(*ranked_lists, k=60): scores = {} for lst in ranked_lists: for rank, doc_id in enumerate(lst): scores[doc_id] = scores.get(doc_id, 0) + 1 / (k + rank + 1) return [doc_id for doc_id, _ in sorted(scores.items(), key=lambda x: -x[1])] 5. Tips + tradeoffs. Keep a small set of representative questions and expected supporting passages. Use it to compare retrieval changes. Apply database permissions on each retrieval path. A metadata filter is not a replacement for authorization. Keep source text, vectors and text indexes in sync when records change or are deleted. Tune search modes and optional reranking against measured quality and response time. No fixed accuracy or speed gain is guaranteed. If no useful evidence is returned, show that limitation instead of asking the model to fill the gap. Continue with vector search, full-text search and authentication. Natural-language query plans Use clear table and column names, then review the generated query. Connect an AI client with MCP Next Page --- ## Handle request and capacity limits | OriginChainDB docs Canonical source: https://originchaindb.com/docs/rate-limits Handle request and capacity limits When requests arrive faster than an instance can handle them, reduce the number running at once and read the retry guidance. This guide separates retryable reads from writes whose outcome needs checking. Handle a limit without multiplying requestsCheck uncertain write outcomes before retrying; not every failed response is safe to repeat. 01 Read the limit responseInspect the error and Retry-After when supplied. 02 Reduce request pressureLower concurrency or batch work within supported limits. 03 Wait within a deadlineUse bounded backoff for operations that are safe to retry. 04 Confirm the final outcomeStop at the retry limit and inspect any unresolved write. Different limits protect different resources Requests, bytes, concurrent queries, natural-language calls, memory and result size have separate limits. Scope and values depend on the API, configuration and deployed engine. Use the response and current console configuration rather than hard-coding an old pricing-tier name or quota. Read the actual response Throttling can return 429. Temporary capacity pressure can also return 503 with Retry-After. Honor that header when supplied and retain the request ID. Do not assume every successful response contains X-RateLimit-Limit, X-RateLimit-Remaining or reset headers. A 413 requires smaller work. A 501 requires a supported feature or topology. Neither is fixed by repeating the same request rapidly. Bound retries for reads Check your installed client's retry settings before adding an application retry loop. Set a total attempt limit so the two layers cannot multiply retries. This complete Python example retries only a schema-list read, with four attempts and a bounded wait. Set OC_BASE_URL, OC_TENANT and OC_BEARER, and add identity headers when required. import json import os import time from urllib.error import HTTPError from urllib.request import Request, urlopen # Read-only request. Do not reuse this loop for an uncertain write. url = f"{os.environ['OC_BASE_URL'].rstrip('/')}/v1/tenants/{os.environ['OC_TENANT']}/schemas" headers = {"Authorization": f"Bearer {os.environ['OC_BEARER']}"} for attempt in range(4): try: with urlopen(Request(url, headers=headers), timeout=15) as response: print(json.load(response)) break except HTTPError as error: if error.code != 429 or attempt == 3: raise value = error.headers.get("Retry-After") error.close() try: delay = float(value) if value else 2 ** attempt except ValueError: # This small example expects delay-seconds, not an HTTP date. # Hand the response to your scheduler instead of retrying early. raise RuntimeError("Handle the returned Retry-After date") if not 0 <= delay <= 30: raise RuntimeError("Retry belongs in a longer-lived scheduler") time.sleep(delay) In a worker fleet, add jitter to an exponential-backoff policy and enforce a total deadline. Treat the server’s retry delay as a minimum. Close response bodies before retrying. Keep cancellation and shutdown responsive. Handle writes separately A response timeout or gateway failure does not prove a write was rejected. Reconcile its outcome, or use a stable key on an endpoint that explicitly supports deduplication. An idempotency key prevents duplicate work only on endpoints that document that behavior; it does not make arbitrary SQL safe to replay. See idempotency and transaction failures. Reduce pressure at the source Use a bounded worker pool and a queue instead of launching one request per row at once. Use supported batch APIs and checkpoint completed chunks. Select only needed columns and bound result sets. Investigate repeated failures using status, request ID and instance usage before changing capacity. Errors and safe retries Previous Page HTTP recipes Next Page --- ## Feature releases by surface. | OriginChainDB docs Canonical source: https://originchaindb.com/docs/releases Feature releases by surface. Use this page to understand older feature announcements and capability categories. A release note records a change; it does not confirm that your database has that build. The capability tables below were captured on 6 September 2026 and are historical. Check your instance’s current capability response and the linked guide before choosing a feature. Newer source work, previews and released packages are separate states. Check what a release means for youHistorical release notes do not prove that a feature is enabled on your instance. 01 Find the dated changeIdentify the feature and release being described. 02 Check your deployed versionInspect the instance and its reported capabilities. 03 Read the current contractReview availability, restrictions and request changes. 04 Test the relevant operationUse a small example before changing your application. How to read this page. Two sources feed it, and they answer different questions. They are kept apart on every section below. Current state comes from the engine's own capability endpoint, which publishes a support list per capability family. Several of those lists are generated from the same check the engine runs when it accepts or refuses a configuration, and the engine's tests hold others to what the query surface actually does, failing in both directions: a variant that is advertised but refused fails the build, and so does a variant left on the roadmap that the engine in fact serves. The endpoint carries no dates. History comes from the changelog, which is the only dated record. Each item below links to its entry. Where the changelog has no dated entry for something, it is not listed rather than given an approximate date. The three columns in each table use the engine's own definitions: supported is implemented and generally available; preview is shipped but deliberately narrow and not yet generally available; roadmap is accepted by the schema but refused by the engine at configuration time, so it is not usable today. A dash means the arm is empty. how current this is Support lists were read from the engine's capability endpoint on 2026-09-06. The endpoint publishes 25 capability families; 21 of them describe a query surface and are listed below. The rest describe the deployment - the instruction set of the host CPU, the write topology, the replication mode, and row-level concurrency control - and are not properties of any one surface, so they are not shown here. Elasticsearch. A search API shaped like the Elasticsearch REST and Query DSL surface, answered by the same engine as everything else. Elasticsearch overview . no machine-checked matrix for this surface The engine's capability endpoint publishes no family for Elasticsearch, so there is no support list here that the engine's tests hold to account. Rather than write one by hand, this section carries only the dated history below and points you at the reference pages, which document the surface as it is built. What changed, and when. The changelog records no dated entry for Elasticsearch. Until one exists there is no date to quote, so none is given here. The elasticsearch overview documents what the surface does today. SQL. The /sql endpoint and the wire protocols that ride it. This is the surface the capability endpoint covers in most detail. SQL reference . Capability familySupported todayIn previewOn the roadmap Joins sql_joins—- inner_equi - outer - expression_projection - expression_aggregate_argument - computed_group_key - cross- natural · v1.x - cross_composed_shapes · v1.x - non_equi_on · v1.x - disjunctive_on · v1.x - having_over_grouped_join · v1.x - distinct_aggregate_over_join · v1.x - window_with_join · v1.x - order_by_qualified_over_grouped_join · v1.x Common table expressions sql_cte—- plain - recursive- chained_recursive · v1.x - recursive_union_distinct · v1.x - recursive_aggregate_projection · v1.x - cte_column_list · v1.x Window functions sql_window_functions—- ranking - offset - aggregates_over - frame_clauses - named_windows - distribution- range_value_offsets · v1.x - composed_shapes · v1.x Constraints sql_constraint_kinds- primary_key - unique - foreign_key - check—- foreign_key_cascade · v1.x - foreign_key_set_default · v1.x INSERT ... ON CONFLICT sql_insert_on_conflict—- values_pk_or_unique_target— Materialized view refresh sql_materialized_view_refresh_modes- on_demand- incremental_filter - incremental_aggregate- incremental_aggregate_default_on · v1.x Isolation levels sql_isolation_levels- read_committed (default)—- snapshot_isolation · preview - serializable · preview Triggers sql_trigger_kinds- before_after—- instead_of · v1.x Phase C Stored procedure languages sql_procedure_languages—- sql_only - plpgsql_lite- wasm · v1.x Phase C 4-6 months User-defined function languages sql_udf_languages—- sql- wasm · v1.x Phase C 4-6 months PostgreSQL wire compatibility postgres_wire—- wire_protocol - isolation - auth - tls - types - error_mapping- binary_bind_params · v1.x - copy_protocol · v1.x - jsonb_column_type · v1.x - multi_dimensional_arrays · v1.x MySQL wire compatibility mysql_wire_dialect—- ast_translator - protocol- prepared_statement_projection_typing · v1.x TDS wire compatibility mssql_tds_dialect—- tsql_ast_translator - isolation - tls- commercial_driver_interop_verification · v1.x What changed, and when. v1.2 2026-06-08 Materialized views with on-demand refresh. Foreign-key and CHECK constraints, with NoAction, Restrict and SetNull as the on-delete actions. The join cap moved from 5 tables to 32. v1.0 2026-05-02 GROUP BY with COUNT, SUM, AVG, MIN and MAX; INNER and LEFT, RIGHT and FULL OUTER joins; HAVING filters. Graph. Relationship traversal and graph embeddings. The capability endpoint publishes families for the embedding side only. Graph reference . Capability familySupported todayIn previewOn the roadmap Embedding algorithms graph_embedding_algos- node2vec - graphsage—— Embedding aggregators graph_embedding_aggregators- mean- max_pool - lstm- trained_aggregators · v1.x What changed, and when. v1.2 2026-06-08 GraphSAGE attribute-aware node embeddings, with Mean, MaxPool and LSTM aggregators. Cypher v3 closed CALL subqueries, nested FOREACH, list comprehensions, MERGE, DELETE, CREATE relation and multi-hop undirected matches. v1.0 2026-05-02 Forward and reverse one-hop neighbours, breadth-first search to a configurable maximum depth, path reachability, and weighted shortest path by Dijkstra with a caller-supplied weight function. Vector. Approximate nearest-neighbour search: which index kinds exist, how vectors are compressed, and where an index lives. Vector reference . Capability familySupported todayIn previewOn the roadmap Index kinds index_kinds- hnsw - ivf - ivf_pq—— Quantization quantization- none - scalar - binary - pq—— Index residency index_residency- ram - disk—- hybrid · Q4 2026 What changed, and when. v1.2 2026-06-08 IVF and IVF-PQ indexes landed end to end. Binary quantization and PQ quantization attach to HNSW or IVF as separate index kinds, so the recall and memory trade-off is chosen per collection. v1.0 2026-05-02 HNSW with cosine, dot and L2 metrics, filtered topk by metadata equality, and f32 SIMD distance kernels. Natural language. The /ask endpoint, which compiles a natural-language question into a query plan. Ask reference . no machine-checked matrix for this surface The engine's capability endpoint publishes no family for Natural language, so there is no support list here that the engine's tests hold to account. Rather than write one by hand, this section carries only the dated history below and points you at the reference pages, which document the surface as it is built. What changed, and when. v0.10 2026-04-22 Every /ask call compiles in the same region as the tenant's instance, with credentials scoped per instance and a scope locked to a single model identifier. Repeated calls over the same catalog pay the cached-read rate on the schema prompt. v0.7 2026-02-12 The plan cache spills to disk, so a cold start reloads hot plans instead of recompiling them. v0.5 2025-12-18 The natural-language to query-plan compiler shipped in the first release, alongside HTTP ingress and the row-keyed store. Full-text. Ranked text search. The capability endpoint publishes the per-field analysis knobs: tokenizer, lemmatizer and geospatial index kind. Full-text reference . Capability familySupported todayIn previewOn the roadmap Tokenizers fts_tokenizer_kinds- uax29 - icu—— Lemmatizers fts_lemmatizers- none - dictionary_english - dictionary_spanish - dictionary_french - dictionary_german - dictionary_italian - dictionary_portuguese - dictionary_russian - dictionary_dutch - dictionary_swedish—— Geospatial index kinds geo_index_kinds- none - r_tree—- s2 · Q1 2027 What changed, and when. v1.2 2026-06-08 Lemmatization for nine languages - English, Spanish, French, German, Italian, Portuguese, Russian, Dutch and Swedish - reducing inflected forms to a dictionary-backed lemma. ICU and geo tokenizers shipped alongside. v1.0 2026-05-02 BM25 ranking at the Lucene defaults, phrase queries by position-list intersection, the UAX #29 Unicode tokenizer, and Snowball stemming for 18 languages. What this page does not cover. The gaps are worth stating, because an absence here means an absence in the sources, not a judgement about the surface. Graph traversal and graph algorithms. The capability endpoint publishes families for graph embeddings only. Traversal, path finding and the algorithm set are documented on the graph reference, and the dated entries above cover what the changelog recorded for them. Query-side full-text features. The endpoint publishes the per-field analysis knobs - tokenizer, lemmatizer, geospatial index kind - not the query operators. Those are on the full-text reference. Per-family detail. Each family carries engineering notes and stated limitations that this page does not reproduce, because a paraphrase of them here is exactly the hand-maintained text this page exists to replace. Read the capability endpoint on your own instance for the full text. Anything undated. A capability can appear as supported above with no entry under "what changed" - that means the changelog has no dated record of it, not that it landed recently. PostgreSQL, MySQL, Elasticsearch and other product names are trademarks of their respective owners. Naming them here describes wire-protocol and API compatibility only, and implies no affiliation with or endorsement by those projects. HTTP recipes Previous Page API reference Find the request, fields and response examples for each OriginChainDB API operation. --- ## Multi-region active-active (in development). | OriginChainDB docs Canonical source: https://originchaindb.com/docs/replication/multi-region Multi-region active-active (in development). Active-active means accepting writes in more than one region. This mode is in development and is not available for customer provisioning. The sections below describe the goal, not a released service or a delivery date. Plan regional recovery with current optionsActive-active multi-region replication is in development and cannot be provisioned from this guide. 01 Write down recovery needsDefine acceptable downtime, data loss and required regions. 02 Review available configurationsConsider the currently supported primary and standby options. 03 Confirm recovery behaviorCheck replication lag, failover steps and deployment limits. 04 Test the supported setupValidate recovery before depending on it in production. What it is designed to do. The intended design lets clients write in different regions while the engines agree on committed data. That requires replication and recovery rules for every supported write operation, including indexes and schema changes. Those guarantees are not established by this guide. For a current deployment, plan around its actual primary/standby configuration and documented recovery procedure. When to choose it. Consider this requirement when users in several regions must write locally. First identify which operations need that behavior, how much delay is acceptable and what data loss the application can tolerate. If one write region is enough, evaluate a supported regional configuration instead of depending on an unreleased mode. Getting set up. There is no customer setup procedure or release date for this mode. Contact the team with your regions, write workload and recovery requirements. Do not make a production commitment until the offered configuration and its guarantees are confirmed. Monitoring and recovery Previous Page Troubleshooting Next Page --- ## Understand schemas | OriginChainDB docs Canonical source: https://originchaindb.com/docs/schemas Understand schemas Decide what each record contains before you save it. A schema names the fields in a table and the values each field accepts. A table is a collection of records.Example: shop.products idnameprice_cents p001Travel mug1990 p002Desk lamp3500 Column A field, such as name.Row One product.Primary key An ID that is unique. Choose how to create it Use the console Add fields and choose their types in the visual editor. Write a schema file Save the definition as a TOML text file and keep it with your code. Use SQL Create a table with a supported CREATE TABLE statement. Make three decisions before saving a tableThe schema defines what records may contain; it does not add the records themselves. 01 Name the tableChoose its namespace and a clear table name. 02 Choose the primary keyDecide which field uniquely identifies each record. 03 Define the fieldsChoose names, types and required values. 04 Save and inspect the definitionConfirm the table exists before loading data. Start with three decisions DecideExampleMeaning Where the table belongsshop.customersshop groups related tables; customers names this table. How to identify a recordidThe primary key is the field that uniquely identifies each customer. What to storeid, email, signup_msEach column has a name and a type, such as text or a whole number. See this table as a schema file Save the following as manifest.toml. TOML is a text format for configuration. namespace = "shop" table = "customers" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "email" ty = "str" [[columns]] name = "signup_ms" ty = "u64" str accepts text. u64 accepts non-negative whole numbers. required = true means the record must include that field. Each [[columns]] block adds one field to the table. Choose suitable field types Start with text, numbers and yes/no values. Use a more specific type when you need validation for dates, identifiers or other structured values. Names and email addresses: str. Whole numbers: i64 or u64, depending on whether negatives are allowed. Yes/no values: bool. Money: decimal, or integer minor units such as cents. Avoid floating-point rounding. The type reference lists the accepted formats and additional settings. Save the definition In the console, review and save the table definition. If you use a TOML file, submit it through the schema registration API. After the request succeeds, check that the table appears before adding records. A schema defines the table; it does not add customer data. Add rules when you need them NeedAdd Find rows by a frequently searched fieldAn index. Follow links between recordsA relation. Require a referenced record to existA foreign key. Reject values that break a ruleA check constraint. Keep search indexes in mind Saving a row does not automatically create its vector embedding or full-text index. Those use separate operations, linked to the record by its ID. See vector schemas or full-text indexing when you add those search methods. Next step Create your first schema, or look up a specific setting in the schema reference. Run your first query Previous Page Create a schema Build a table with fields, a searchable category and a supplier relationship. --- ## Prepare a graph for Cypher | OriginChainDB docs Canonical source: https://originchaindb.com/docs/schemas/cypher Graph Prepare a graph for Cypher Define the links that a graph query will follow. A Cypher query follows the links declared between records. Follow an order to its customerDeclare the relation and required indexes before running the supported Cypher-style query. 01 Prepare orders and customersUse stable IDs and the expected table indexes. 02 Declare the placed_by relationConnect the order’s customer key to the customer table. 03 Match from a known orderFollow the declared relation in the query. 04 Inspect the customer resultCompare the returned ID with the order’s customer key. Set up the two tables Register shop.customers first. This is the table the order points to. Add a customer column to shop.orders containing the customer's ID. Name that link placed_by in a [[relations]] block. Check that the starting table has a by_id index. The schema loader normally creates this for a single-column id primary key when no equivalent index exists. Schema settingWhat it does from_col = "customer"Reads the customer ID from the order. targetIdentifies the destination table and its key. name = "placed_by"Gives the relationship a name to use in a query. bidirectional = trueAlso records the reverse direction. Customer table example namespace = "shop" table = "customers" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "name" ty = "str" [[columns]] name = "country" ty = "str" [[columns]] name = "referred_by" ty = "str" # another customer's id - or absent # A customer points at the customer who referred them. Source and target # are the SAME table, which is what makes variable-length paths legal. [[relations]] name = "referrer" from_col = "referred_by" target = { namespace = "shop", table = "customers", pk = "id" } bidirectional = true # Explicit starting-point index; normally synthesized when no equivalent exists. [[indexes]] name = "by_id" columns = ["id"] Order table example namespace = "shop" table = "orders" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "customer" ty = "str" # a shop.customers id [[columns]] name = "amount_cents" ty = "i64" [[columns]] name = "status" ty = "str" [[columns]] name = "notes" ty = "str" [[columns]] name = "placed_ms" ty = "u64" # The edge: an order points at the customer who placed it. [[relations]] name = "placed_by" from_col = "customer" target = { namespace = "shop", table = "customers", pk = "id" } bidirectional = true [[indexes]] name = "by_id" columns = ["id"] Check the starting point A point match such as MATCH (o:orders {id: "…"}) uses an index named by_. For a single-column key, the schema loader adds that index when no equivalent index exists. If you already declared the same key index under another name, check the stored definition: the loader avoids adding a duplicate, while this query path expects the conventional name. The examples declare by_id explicitly. When you save an order, the relation is maintained from its customer value. You do not need a separate edge-write request. Run the query The engine route is POST /v1/tenants/:t/cypher. Send cypher and, when needed, default_schema and params in the request body. Check the supported query shapes before adapting syntax from another graph database. Graph modelling: understand relations and their limits. Graph examples: build and run a supported traversal. SQL: use filters, joins and grouped calculations. Graph schemas Give records named links that graph queries can follow. Graph embeddings Next Page --- ## Prepare text for search | OriginChainDB docs Canonical source: https://originchaindb.com/docs/schemas/fts Full-text search Prepare text for search Index text explicitly, then keep it in sync with its source record. Index a field once, then search its words and return matching record IDs. Connect indexed words to a rowThis example writes a separate document index; it is not an attached table-index workflow. 01 Save the order and notesKeep the order’s stable record ID. 02 Index its note textSend the words under the same ID to the document index. 03 Search for a known phraseInspect the matching document IDs. 04 Read the matching orderUse its ID to open the source row. Choose the text to index Pick a table and field name, such as shop.orders and notes. Use the source row's primary key as the search document's doc_id. Index the text through the full-text endpoint. Index it again when the source text changes. Writing a row through SQL or the rows API does not add it to the full-text index. The table and field strings must match exactly between indexing and searching. Optional source-row schema # Nothing in the schema marks a field as full-text indexed - there is no # such flag. An FTS index comes into existence the first time you POST a # document to a (table, field) pair. Registering the row schema is still # worth it: it is what lets you take a doc_id from a search hit and read # the whole row back with SQL. namespace = "shop" table = "orders" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "customer" ty = "str" [[columns]] name = "amount_cents" ty = "i64" [[columns]] name = "status" ty = "str" [[columns]] name = "notes" # the field we will full-text index ty = "str" [[columns]] name = "placed_ms" ty = "u64" Index the document The example indexes one delivery note. A successful write returns 201 with no response body. Reusing the same doc_id replaces its indexed text. Connection used in these examples These examples use the tenant-scoped engine API and its older SDK methods. Use the connection details supplied for that interface. For the current Connect setup, see authentication. Do not combine the two URL formats. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.orders/notes" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "doc_id": "01JTRX9KQ3YH8K2WMX0F5JZAB7", "text": "rush delivery, signed by recipient" }' # → 201 Created, empty body Index text from a nested JSON document Use the /json variant and list the dotted paths to include. Omit paths only when every string leaf should be indexed. # Walk a nested document and index its string leaves. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.orders/notes/json" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "doc_id": "01JTRX9KQ3YH8K2WMX0F5JZAB7", "json": { "note": "rush delivery", "shipping": { "instructions": "signed by recipient" }, "tags": ["priority", "insured"] }, "paths": ["note", "shipping.instructions", "tags"] }' # Omit "paths" to index every string leaf in the document. Adjust how words match SettingEffect Default analysisSplits text into Unicode words and lowercases them. SynonymsTreats configured terms as alternatives, such as delivery and shipment. StopwordsRemoves configured common words from indexing and queries. There is no selectable stemming setting: deliver does not automatically match delivery. Use an appropriate search mode, prefix or synonym instead. Configure synonyms and stopwords # Synonym classes - applied at BOTH index and query time. # Re-installing replaces the whole map. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.orders/notes/synonyms" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "synonyms": { "delivery": ["shipment", "dispatch"] } }' # Stopwords - dropped at BOTH index and query time. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/fts/shop.orders/notes/stopwords" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "stopwords": ["the", "a", "an", "and", "by", "of", "with"] }' Installing either setting replaces its whole map or list. Both affect indexing and searching, so re-index existing documents after a change. A term supports at most 32 synonyms. Verify the result Search the same table and field for a word in the note. If you also saved the source row, use the returned doc_id to open it. Indexing text alone does not create that row. Full-text query guide · Search examples · Vector search Full-text search overview Previous Page Lemmatization (planned) Next Page --- ## Connect records with relations | OriginChainDB docs Canonical source: https://originchaindb.com/docs/schemas/graph Graph Connect records with relations Give records named links that graph queries can follow. A relation is a named link between records; a foreign key can check that the destination exists. One product. One supplier.Example data · choose a record to see the rule. shop.productsidp001nameDesk lampsupplier_ids001 supplied_by shop.suppliersids001nameNorth SupplyNo supplier with ID s999 Accepted: supplier_id points to an existing supplier. The relation names the link; the foreign key checks that its destination exists. The illustration uses products and suppliers; the schema below uses the same idea for orders and customers. Declare how two tables connectA graph relation enables traversal; a foreign key separately checks whether a referenced record exists. 01 Define both tablesChoose the primary keys and the field holding the reference. 02 Declare the relationshipName its source field and target key. 03 Load matching recordsUse the declared IDs when writing the linked rows. 04 Traverse a known connectionCheck that the result points to the expected target. Define the connection Register the destination table first, such as shop.customers. Add a column on the source table that holds the destination ID. Add a [[relations]] block naming that connection. FieldMeaning nameThe relationship name used in graph queries, such as placed_by. from_colThe column on the source row that contains the destination ID. targetDestination namespace, table and primary-key column. bidirectionalWhen true, also creates the reverse connection. Destination table: customers namespace = "shop" table = "customers" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "name" ty = "str" [[columns]] name = "country" ty = "str" [[columns]] name = "referred_by" ty = "str" # another customer's id # A self-relation: customers point at customers. [[relations]] name = "referrer" from_col = "referred_by" target = { namespace = "shop", table = "customers", pk = "id" } bidirectional = true [[indexes]] name = "by_id" columns = ["id"] Source table: orders namespace = "shop" table = "orders" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "customer" # <- THIS column is the edge ty = "str" [[columns]] name = "amount_cents" ty = "i64" [[columns]] name = "status" ty = "str" [[columns]] name = "notes" ty = "str" [[columns]] name = "placed_ms" ty = "u64" # The declaration that turns a plain column into a traversable edge. [[relations]] name = "placed_by" # the name you pass as ?rel= from_col = "customer" # the column ON THIS TABLE target = { namespace = "shop", table = "customers", pk = "id" } bidirectional = true # default; enables reverse traversal [[indexes]] name = "by_id" columns = ["id"] A separate table containing src and dst columns does not become traversable by itself. The relation declaration is what gives a connection its graph meaning. Save the row to create its links Saving an order maintains the declared links from its customer value. Changing that value moves the link; deleting the row removes its derived links. Connection used in these examples These examples use the tenant-scoped engine API and its older SDK methods. Use the connection details supplied for that interface. For the current Connect setup, see authentication. Do not combine the two URL formats. Row-write examples # Write an ORDINARY row. There is no edge API and nothing else to call. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.orders" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "01JTRX9KQ3YH8K2WMX0F5JZAB7", "customer": "01JTRX1H4Q9P0N2WMX0F5JZ001", "amount_cents": 12950, "status": "paid", "notes": "rush delivery", "placed_ms": 1714478049000 }' # The edge order -> customer now exists. Both directions, because # placed_by declares bidirectional = true. If the relation's source value is a JSON array, it produces a link for each value. A missing or null value produces no link. A relation alone does not require the destination row to exist; add a foreign key for that rule. Check the limits REST graph keys: use single-column string IDs. Integer and composite keys are not addressed by these graph endpoints. Cross-namespace paths: declaring a relation is separate from traversing it. Check Cypher or a supported plan for paths outside the REST endpoint's schema scope. Reverse links: changing bidirectional does not backfill old rows. Rewrite affected rows when changing this setting. Cypher starting points: declare the required by_id index when using an ID-based point match. Try a traversal Graph query guide · Prepare for Cypher · Relation fields Your first graph traversal Previous Page Cypher queries Define the links that a graph query will follow. --- ## Save a query result as a view | OriginChainDB docs Canonical source: https://originchaindb.com/docs/schemas/materialized-views SQL Save a query result as a view Store a reusable result and refresh it when its source changes. A materialized view saves a query result so your application can read it again. Add a saved summary to your schemaAn on-demand materialized view stores a query result; refresh it after source-row changes. 01 Prepare the source tablesCheck the fields used by the summary query. 02 Define and install the viewSave a supported SELECT and its initial result. 03 Read the stored summaryUse the saved result for the intended report. 04 Refresh when freshness requires itRecompute the view after relevant source changes. Decide whether to use one Use a view when the same result is read repeatedly and you can control when it refreshes. Run a normal query when each request differs or every answer must reflect the latest write. Prepare and test the query Register the source table, add representative rows and run the SELECT successfully before installing the view. This example totals paid orders by customer. Example source table namespace = "shop" table = "orders" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "customer" ty = "str" [[columns]] name = "amount_cents" ty = "i64" # money in minor units - never f64 [[columns]] name = "status" ty = "str" [[columns]] name = "notes" ty = "str" [[columns]] name = "placed_ms" ty = "u64" # epoch milliseconds # Makes the WHERE status = 'paid' inside the view cheap to re-run. [[indexes]] name = "by_status" columns = ["status"] SELECT customer, COUNT(*) AS orders, SUM(amount_cents) AS total_cents FROM shop.orders WHERE status = 'paid' GROUP BY customer Install the view Choose a unique name and use refresh_mode: "on_demand". The install call computes the initial result. Keep the returned refresh_ts so your application can show when the result was last updated. Connection used in these examples These examples use the tenant-scoped engine API and its older SDK methods. Use the connection details supplied for that interface. For the current Connect setup, see authentication. Do not combine the two URL formats. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql/materialized-views" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "mv_paid_by_customer", "query": "SELECT customer, COUNT(*) AS orders, SUM(amount_cents) AS total_cents FROM shop.orders WHERE status = '\''paid'\'' GROUP BY customer", "refresh_mode": "on_demand" }' rows_materialized counts the saved result rows, not the source rows scanned. Read the saved result Read the view by name through its HTTP route. That response contains the complete stored result, without pagination. SQL also supports SELECT * FROM view_name, selected column names, column aliases and an optional LIMIT. Use the unqualified view name. This reads the saved snapshot; it does not refresh an on-demand view. A view is not a fully queryable table: WHERE, joins, grouped calculations, computed expressions, ORDER BY and OFFSET over the snapshot are refused. Put those operations in the view definition or query its source table. On multi-shard deployments, use the HTTP read route when the SQL connection is not on the view's home shard. Read examples curl "https://$OC_HOST/v1/tenants/$OC_TENANT/sql/materialized-views/mv_paid_by_customer" \ -H "Authorization: Bearer $OC_TOKEN" Refresh after source changes An on-demand view does not update itself. Call refresh after your import or update job, or schedule it in your application. Refresh runs the full query again. Refresh examples curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql/materialized-views/mv_paid_by_customer/refresh" \ -H "Authorization: Bearer $OC_TOKEN" Understand the two modes ModeBehaviour on_demandDefault. Changes only when you call refresh. incrementalPreview. Updates during supported writes when the required server capability is enabled. Incremental preview requirements Incremental support depends on both the query shape and server configuration. It supports eligible single-table filter/projection plans and eligible COUNT, SUM or AVG aggregates. Aggregate support has a separate gate that is off by default. Joins, MIN, MAX, DISTINCT, subqueries, set operations, HAVING, ORDER BY and LIMIT are excluded from this preview. Eligible filters can use an index or a table scan. Eligibility depends on the supported query shape, not simply on whether a scan appears in the plan. Floating-point SUM and AVG can differ slightly from a full recomputation; refresh when exact reconciliation is needed. 422 means the required preview is disabled. 400 means the shape or setting is unsupported. Use on_demand in either case. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql/materialized-views" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "mv_paid_live", "query": "SELECT customer, SUM(amount_cents) AS total_cents FROM shop.orders WHERE status = '\''paid'\'' GROUP BY customer", "refresh_mode": "incremental" }' Limits to plan for List views with GET /sql/materialized-views and remove one with DELETE /sql/materialized-views/:name, relative to the tenant-scoped API. There is no in-place definition edit; use a new name or deliberately drop and recreate the view. SQL supports CREATE MATERIALIZED VIEW, REFRESH MATERIALIZED VIEW and DROP MATERIALIZED VIEW. SQL creation chooses incremental maintenance only when the query and server gates allow it; otherwise it uses on-demand refresh. CREATE OR REPLACE is not supported. Keep the stored result small. The HTTP read returns it whole, and SQL snapshot reads have a separate 4 MiB internal response cap; a LIMIT does not bypass that read cap. A view cannot use another view as a source or span unsupported shards. Dropping a source table does not remove an on-demand snapshot; it may still serve the previous result. Use the explicit HTTP install call. Older SDK helpers may send obsolete refresh-mode names. StatusCheck 400Query support, refresh-mode spelling or snapshot size. 404Exact view name. 409The name is already installed; choose another. 422Incremental preview is disabled for this kind of view. 501Unsupported shard arrangement. Inspect a query plan · SQL guide · API reference Materialized views Previous Page SQL use cases Next Page --- ## Prepare data for Ask AI | OriginChainDB docs Canonical source: https://originchaindb.com/docs/schemas/nl Prepare data for Ask AI Use clear table and column names, then review the generated query. Ask AI uses table definitions to turn a question into a query you can review. Make a table easier to ask aboutAsk uses the selected schema to form and execute a query; inspect both its plan and rows. 01 Use clear field namesMake units such as cents or milliseconds explicit. 02 Select the relevant tablesKeep the question within the intended data scope. 03 Ask for a specific resultName the filters, totals or ordering you need. 04 Check the executed interpretationVerify field choices and returned values. Prepare your table Register the table and its columns. Use names that explain the value: amount_cents is clearer than amt. Choose the tables the question should use. Check that Ask AI is enabled for your instance and configured provider. Instead ofPreferWhy amtamount_centsIncludes the unit. tsplaced_msSays what happened and how the time is stored. stateorder_statusMakes the meaning less ambiguous. No special natural-language block is needed in the schema. Do not assume the service can infer undeclared fields or your business rules. Example table definition # NL has no schema knobs of its own. What it needs is that the tables you # want it to reason about are REGISTERED - the compiler is given the column # names and types of your schemas as its entire context, so a column that # is not declared is a column it cannot use. namespace = "shop" table = "orders" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "customer" ty = "str" [[columns]] name = "amount_cents" ty = "i64" [[columns]] name = "status" ty = "str" [[columns]] name = "notes" ty = "str" [[columns]] name = "placed_ms" ty = "u64" # Not required by NL, but the compiled plan will use it like any other # query would - so an indexed filter column makes the answer faster. [[indexes]] name = "by_status" columns = ["status"] Check the answer before using it Read the generated plan: does it use the intended table, fields and filters? Compare the returned rows with a small result you can verify yourself. Make the question more specific if the result is unclear. Use reviewed, parameterized SQL for a query your application will run repeatedly. Ask AI availability and limits depend on the instance configuration. A generated query is a proposal to inspect, not proof that the business question was understood. Continue Ask AI guide · Question examples · Schema reference Ask your first question Previous Page Build search and RAG Next Page --- ## Schema field reference | OriginChainDB docs Canonical source: https://originchaindb.com/docs/schemas/reference Schema field reference Look up the fields used to define tables, indexes, relationships and validation. Use this page to look up schema settings; start with the table name, ID and fields. New to schema files? Follow the walkthrough. Look up the schema part you needOnly add optional rules your table requires; the accepted manifest fields are listed below. 01 Check the table identityLook up namespace, table and primary_key. 02 Check a column definitionFind its supported type and field options. 03 Look up an optional ruleUse the index, relation or constraint section when needed. 04 Register and inspect errorsCorrect the named definition before adding records. Name the table FieldRequiredMeaning namespaceYesGroup name, such as shop. Use letter-prefixed snake_case. tableYesTable name, such as orders. Queries use shop.orders. primary_keyYesArray of column names that identify one record. versionNoDefaults to 1; increment as required by the schema-change workflow. SQL can address composite keys. The direct /rows/:schema/:pk read accepts only one key column. Define columns Repeat [[columns]] for each field. FieldMeaning nameColumn name and the JSON key used in row writes. tyData type, chosen from the tables below. requiredDefaults to false. Set true when the value must be supplied. Basic types TypeUse for strNames, IDs and other text. i64Whole numbers that may be negative. u64Non-negative whole numbers. f64Approximate numeric values. boolTrue/false values. bytesEncoded binary values. Extended column types TypeValue or setting timestampEpoch milliseconds; supported input forms also include timestamp text. dateEpoch days; supported input forms also include date text. intervalDuration in milliseconds, including negative values. uuidValid UUID string. decimalExact decimal text, such as "19.99"; optional precision and scale rules. enumString selected from declared variants. textText content. jsonJSON object or array. listArray; an optional element type checks each item. inetIPv4 or IPv6 string. pointLatitude/longitude object or a longitude/latitude pair. vectorVector metadata with [columns.params] and vector_dim. Write search values through the vector API. Picking the right type for common data Use str for ordinary identifiers and uuid when UUID validation is useful. Use decimal strings or integer minor units for money. Avoid passing exact amounts through floating-point values. Include units in field names, such as price_cents or duration_ms. Check SQL return formats before converting dates or large numbers in your application. Add an index An index gives the query planner another way to find matching rows. Start with fields used by important filters and check the actual plan with EXPLAIN. FieldMeaning nameIndex name used in plans and administration. columnsOrdered list of indexed columns. For [customer_id, placed_ms], a left-prefix match can use customer_id. Do not assume the same index helps a filter on placed_ms alone. Extra indexes also add write work. Index examples [[indexes]] name = "by_status" columns = ["status"] # single-column [[indexes]] name = "by_customer_and_time" columns = ["customer_id", "placed_ms"] # composite, in declared order Define a graph relation A relation names a connection between rows. Row writes maintain its derived graph links. FieldMeaning nameRelationship name used when following the link. from_colLocal column containing the destination ID. bidirectionalDefaults to true; also maintains a reverse link. target.namespace, target.table, target.pkDestination table and primary-key column. Relation examples [[relations]] name = "supplied_by" # the verb you'll walk in code from_col = "supplier_id" # the FK column on THIS table bidirectional = true # default; reverse edge written atomically [relations.target] namespace = "shop" # target table's namespace table = "suppliers" # target table's name pk = "id" # target table's primary-key column # Self-relations work - direction tags resolve the collision: [[relations]] name = "follows" from_col = "followee_id" bidirectional = true [relations.target] namespace = "social" table = "users" pk = "id" A relation does not require the destination row to exist. Add a foreign key when that rule is needed. See graph setup for key and traversal limits. Require a matching row A foreign key rejects a reference to a missing record. FieldMeaning nameOptional error-reporting name; defaults to the source column plus _fk. from_colLocal referencing column. target_schemaDestination namespace.table. target_colDestination primary-key or unique-indexed column. on_deleteno_action, restrict, set_null, cascade or set_default. on_updateno_action, restrict or set_null; update cascades and defaults are not supported. Foreign-key example [[foreign_keys]] name = "fk_customer" # optional - defaults to "_fk" from_col = "customer_id" # column on THIS table target_schema = "shop.customers" # "namespace.table" of the target target_col = "id" # PK or unique-indexed column on target on_delete = "no_action" # refuse deletion while referenced no_action and restrict refuse a delete while references remain. set_null requires a nullable source column. cascade deletes referencing rows recursively; a conflicting restriction or the cascade row budget rejects the whole delete. set_default substitutes the column default, or NULL when no default exists, and validates that replacement against the foreign key. These propagation actions apply to deletes. cascade and set_default remain unsupported for on_update. Check cross-shard restrictions before linking separately placed tables. Validate values with CHECK A check uses name and expression to reject values that violate a rule, such as a negative quantity. Expression grammar OperationExample Comparisonqty > 0 using =, !=, <, <=, > or >=. Combine conditionsprice > 0 AND price < 1000000; also OR and NOT. Test missing valuesdescription IS NOT NULL. Allow a setstatus IN ('pending', 'paid'). A NULL result fails the check. To allow a missing value, include it explicitly: qty IS NULL OR qty > 0. CHECK examples [[check_constraints]] name = "qty_positive" expression = "qty > 0" [[check_constraints]] name = "country_or_continent_set" expression = "country IS NOT NULL OR continent IS NOT NULL" [[check_constraints]] name = "status_in_set" expression = "status IN ('pending', 'paid', 'cancelled')" Extract a nested JSON value Use [[extractions]] to derive a queryable column from a nested path at write time. FieldMeaning nameName of the derived column. pathDotted source path, such as customer.address.country. tyType of the extracted value. Missing paths produce the type's zero value. Extractions do not create full-text or vector indexes. Extraction examples # Pull a derived column out of a nested JSON row at write time. # The dotted path walks into the JSON; missing fields emit zero values. [[extractions]] name = "customer_country" path = "customer.address.country" ty = "str" [[extractions]] name = "order_total_cents" path = "totals.grand_cents" ty = "i64" Set row expiry TTL means time to live. Choose one way to determine when a row expires. Two ways to declare it SettingBehaviour Column ttl = "30d"Gives the whole row a fixed lifetime from its write. Units: s, m, h, d, w. [ttl] with column = "expires_at"Uses the row's timestamp or date value as its expiry. TOML expiry examples # Row expiry (TTL) - two ways to declare it. Use ONE. # (A) Fixed lifetime: put `ttl` on any column and the WHOLE row expires # this long after it is written. Units: s / m / h / d / w. [[columns]] name = "id" ty = "str" required = true ttl = "30d" # every row lives 30 days from write # (B) Per-row expiry: instead of (A), add a [ttl] block pointing at a # timestamp or date column. Each row expires at its own stored value. # # [ttl] # column = "expires_at" # a `timestamp` or `date` column SQL expiry example CREATE TABLE app.sessions ( id TEXT NOT NULL PRIMARY KEY, user_id TEXT ) WITH (ttl = '30d'); TTL applies to the whole row, not a single field. Existing rows are not assigned a new expiry until rewritten. A missing per-row expiry does not expire the record. Coordinate lifetimes across related tables; do not assume TTL cascades to all related records. Check configured foreign-key delete actions. Describe a vector collection [vector] describes how embeddings in the collection should be shaped. It does not generate them or index ordinary row writes. FieldRequiredMeaning dimYesPositive number of values in each vector. distanceNocosine by default; also l2, dot, manhattan or l1. embedderNoModel identity. A different supplied identity is rejected; an omitted identity is not blocked. Vector metadata example # Optional. One [vector] table per manifest. [vector] dim = 768 # REQUIRED. No default. distance = "cosine" # the default. Five values accepted. embedder = "your-768d-model" # replace with the model used for these vectors # A `vector` COLUMN carries the same width in its own params block. # Declare both and the two dims must agree, or registration fails. [[columns]] name = "embedding" ty = "vector" [columns.params] vector_dim = 768 How distance resolves at runtime An omitted request measure uses the declared distance. A conflicting non-default declaration returns 400. A cosine declaration does not reject another request measure in this contract, so enforce consistent settings in your application. Use [vector], not [[vectors]]; use schema distance, not request metric. Unknown manifest fields can be ignored, so verify the stored definition after registration. IVF and quantization settings use separate endpoints. Complete reference example This example combines columns, indexes, relations, foreign keys and checks. Register its target tables before using it. Combined orders schema # A schema using every block at once. namespace = "shop" table = "orders" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "customer_id" ty = "str" required = true [[columns]] name = "product_id" ty = "str" required = true [[columns]] name = "qty" ty = "i64" [[columns]] name = "total_cents" ty = "i64" [[columns]] name = "placed_ms" ty = "u64" [[indexes]] name = "by_customer" columns = ["customer_id"] [[indexes]] name = "by_product_and_time" columns = ["product_id", "placed_ms"] [[relations]] name = "bought_product" from_col = "product_id" bidirectional = true [relations.target] namespace = "shop" table = "products" pk = "id" [[relations]] name = "by_customer" from_col = "customer_id" bidirectional = true [relations.target] namespace = "shop" table = "customers" pk = "id" [[foreign_keys]] name = "fk_customer" from_col = "customer_id" target_schema = "shop.customers" target_col = "id" on_delete = "restrict" [[check_constraints]] name = "qty_positive" expression = "qty > 0" [[check_constraints]] name = "total_positive" expression = "total_cents > 0" Create your first schema · Register and verify it Create tables in the console Name a table, choose its fields and check the saved definition. Read and write records Choose a single-record request, a batch or SQL for the change you need. --- ## Write and read records | OriginChainDB docs Canonical source: https://originchaindb.com/docs/schemas/row-crud Write and read records Choose a single-record request, a batch or SQL for the change you need. Choose a request by what you want to change, then read back the saved record. Change a record without losing trackAn upsert can replace the whole row; include the fields you intend to preserve. 01 Identify the recordUse its table and primary key. 02 Choose the write operationDistinguish insert, replacement, conditional write and delete. 03 Apply the required conditionUse the current revision when the endpoint supports conditional writes. 04 Read back the resultConfirm the saved fields or the intended deletion. Prepare your table Register the table and its columns first. A direct point read needs a single-column primary key; use SQL to read a composite key. Example orders table namespace = "shop" table = "orders" primary_key = ["id"] # single column - required for the /:pk shortcut [[columns]] name = "id" ty = "str" required = true [[columns]] name = "customer" ty = "str" [[columns]] name = "amount_cents" ty = "i64" # money in minor units - never f64 [[columns]] name = "status" ty = "str" [[columns]] name = "notes" ty = "str" [[columns]] name = "placed_ms" ty = "u64" # epoch milliseconds # Makes WHERE status = '...' sub-linear for SQL reads. [[indexes]] name = "by_status" columns = ["status"] # Enforced on EVERY write path, including the batch hot path. [[check_constraints]] name = "amount_positive" expression = "amount_cents > 0" Choose an operation TaskInterface Save or replace a recordPOST /rows/:schema with a flat row object. Read one recordGET /rows/:schema/:pk. Replace only the version you readPUT /rows/:schema/:pk with If-Match. Delete one known recordDELETE /rows/:schema/:pk. Write a batchPOST /rows/:schema/_batch. Change selected fields or deleteSQL with a specific filter. Read several recordsSQL with selected columns and a limit. These paths are relative to the tenant-scoped engine API. SDK method names vary by version; the examples below use the older contract. Save and read one record Send the fields directly in the JSON object, including the primary key. A successful save returns {"ok": true}. A successful read returns the row itself; a missing row returns 404. Save a record curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.orders" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: order-1001-v1" \ -d '{ "id": "ord-1001", "customer": "cus-77", "amount_cents": 4200, "status": "pending", "notes": "gift wrap", "placed_ms": 1714478049000 }' Example response { "ok": true } Read the saved record curl "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.orders/ord-1001" \ -H "Authorization: Bearer $OC_TOKEN" Example response { "id": "ord-1001", "customer": "cus-77", "amount_cents": 4200, "status": "pending", "notes": "gift wrap", "placed_ms": 1714478049000, "_oc_row_version": 1 } Example response { "error": "row \"ord-1001\" not found" } Understand replacement Saving an existing ID replaces the whole row. Omitted fields are removed. This is an upsert: it creates a new row or replaces the matching one. Use SQL INSERT when a duplicate key should fail. A duplicate returns a constraint error rather than replacing the existing row. Use an explicit SQL conflict clause when you want a controlled upsert. Use expect=insert to request insert-only behaviour on the row endpoint. A duplicate primary key returns 409 constraint_violation and preserves the existing record. Without that option, the row endpoint remains an upsert. Change one field Use SQL UPDATE with a WHERE clause. The row API has no partial-update operation. If you read and repost a row, remove the engine's _oc_row_version field and retain every field you intend to keep. Update examples # There is no PATCH. Re-POST the WHOLE row - every field you omit # is erased. Read first, mutate, write back. ROW=$(curl -s "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.orders/ord-1001" \ -H "Authorization: Bearer $OC_TOKEN") echo "$ROW" \ | jq 'del(._oc_row_version) | .status = "shipped"' \ | curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.orders" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" --data-binary @- # Or let the engine do the read-modify-write for you, with SQL: curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '{"sql":"UPDATE shop.orders SET status = $1 WHERE id = $2", "params":["shipped","ord-1001"]}' Example response { "kind": "update", "schema": "shop.orders", "rows_affected": 1 } For a read–change–save workflow, send the full replacement row with PUT /rows/:schema/:pk and If-Match set to the _oc_row_version you read. A changed version returns 409 write_conflict; a missing row returns 412 precondition_failed. If-Match: * checks only that the row exists. This check applies to the conditional request; an unconditional POST, batch or SQL write can still overwrite the row. A deployment that cannot enforce the condition returns 503 precondition_capability rather than ignoring it. See conditional row updates for headers and responses. Delete a record Use DELETE /rows/:schema/:pk for one known key, SQL for a filtered set, or the transaction endpoint for a buffered delete. Deleting an absent record can succeed without changing anything. The direct endpoint reports deleted: false; SQL RETURNING can show which rows were removed. Delete examples # Delete by a SQL filter; direct DELETE /rows/:schema/:pk is also supported: curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '{"sql":"DELETE FROM shop.orders WHERE id = $1","params":["ord-1001"]}' # { "kind": "delete", "schema": "shop.orders", # "pk": "ord-1001", "rows_affected": 1 } # ...or buffer the delete inside a transaction: curl -X DELETE \ "https://$OC_HOST/v1/tenants/$OC_TENANT/tx/$TX_ID/rows/shop.orders/ord-1001" \ -H "Authorization: Bearer $OC_TOKEN" Import a batch FormatBehaviour JSON arrayOne bounded batch. Validation failure rejects the whole batch. Send the array directly, not a rows wrapper. Newline-delimited JSONCommits in chunks. Earlier chunks may already be saved when a later chunk fails. JSON batch examples # The body is a RAW ARRAY. Not { "rows": [...] }. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.orders/_batch" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '[ { "id": "ord-2001", "customer": "cus-12", "amount_cents": 1500, "status": "paid", "notes": "", "placed_ms": 1714478100000 }, { "id": "ord-2002", "customer": "cus-12", "amount_cents": 8900, "status": "paid", "notes": "fragile", "placed_ms": 1714478160000 }, { "id": "ord-2003", "customer": "cus-31", "amount_cents": 400, "status": "pending", "notes": "", "placed_ms": 1714478220000 } ]' Example response { "inserted": 3 } Streaming import example # One JSON object per line. Nothing is held whole in memory, so this # is the path for files that do not fit in a request body. curl -X POST \ "https://$OC_HOST/v1/tenants/$OC_TENANT/rows/shop.orders/_batch?chunk=2000" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/x-ndjson" \ --data-binary @orders.ndjson Example response { "inserted": 480000 } Example response { "inserted": 312000, "error": "..." } A streaming 207 is a partial result. Read its inserted count and error, reconcile the saved records and resume carefully. Do not replay the whole file automatically; partial responses are not cached against the idempotency key. Read a set of records Choose only the columns you need and add a LIMIT. Large results can exceed the response cap. For several key columns, put all of them in the SQL filter. Query examples # There is no "list rows" route. Read sets of rows with SQL. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_TOKEN" -H "Content-Type: application/json" \ -d '{"sql":"SELECT id, customer, amount_cents FROM shop.orders WHERE status = $1 ORDER BY placed_ms DESC LIMIT 50", "params":["paid"]}' Check validation errors StatusLikely cause 400Missing required field, wrong type or unsupported point-read key. 404Missing row or table. 409Constraint failed, duplicate insert-only key, or stale If-Match version. 412Conditional update expected a row that does not exist. 413Request or result exceeds the byte limit. 429Write queue is full; inspect Retry-After. 501Unsupported cross-shard foreign key. 503The deployment cannot currently enforce the requested precondition. Undeclared fields are stored rather than rejected. Use clear names and mark essential columns as required; a misspelled optional field may otherwise go unnoticed. Keep requests bounded Engine requestLimit Single row8 MiB body. JSON batch64 MiB body. Streaming line1 MiB per line; 64 MiB in-flight buffer. Streaming chunk1,000 rows by default; at most 10,000. Gateway and instance limits can also apply. A successful primary write does not by itself prove a standby has received it. Where applicable, inspect X-OC-Replication for a degraded acknowledgement. If a write response is lost, check whether the write happened before repeating it. Use idempotency only within the documented endpoint contract; it does not make every write safe to retry. Schema reference Look up the fields used to define tables, indexes, relationships and validation. Write data and update indexes Next Page --- ## Prepare a table for SQL | OriginChainDB docs Canonical source: https://originchaindb.com/docs/schemas/sql SQL Prepare a table for SQL Choose fields, add useful indexes and read the returned values correctly. A SQL query can use the table and columns you have registered. Define and check a table with SQLUse the supported SQL interface; the PostgreSQL database login does not currently provide writes. 01 Write CREATE TABLEChoose the fields, types and primary key. 02 Run the definitionInspect the response before inserting data. 03 Add a small sampleUse values that satisfy the declared types and rules. 04 Read and inspect the tableVerify the stored fields before adding more queries or indexes. Prepare the table Define the table's primary key and columns. Register the schema before writing rows. Add indexes for the filters your application actually uses. Use EXPLAIN to check whether a query uses an index or scans the table. The example below uses its own shop.orders table; it is separate from the quickstart's quickstart.products table. Example orders schema namespace = "shop" table = "orders" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "customer" ty = "str" [[columns]] name = "amount_cents" ty = "i64" [[columns]] name = "status" ty = "str" [[columns]] name = "notes" ty = "str" [[columns]] name = "placed_ms" ty = "u64" # Turns WHERE status = '...' into a sub-linear lookup. [[indexes]] name = "by_status" columns = ["status"] Understand returned values ValueWhat your application should do Text, UUID or IP addressKeep the returned string. DecimalKeep the exact decimal text; use a decimal library for calculations. Large integerUse a client that preserves its precision. Do not coerce it to a JavaScript number. BooleanRead it as true or false. JSON or listRead the object or array, rather than treating it as prose. Date or timestampInspect the returned column type and format before converting it. Older clients that decode every JSON number as a floating-point value can round large integers. The newer SDK contract preserves numeric strings; check the SDK version you are using. Temporal columns can be returned as formatted text. Calculations over those columns may return a different representation, so test the exact expression your application uses. Choose the next task Write and read rows. Run SQL queries, including filters and grouped results. Use transactions when several changes must be handled together. Choose column types. Your first SQL query Previous Page Query plans Next Page --- ## Use the transaction HTTP API | OriginChainDB docs Canonical source: https://originchaindb.com/docs/schemas/transactions SQL Use the transaction HTTP API Read records, prepare changes and commit them together on supported instances. A transaction lets you prepare several row changes before committing them. This preview HTTP API uses a tx_id to keep those operations together. Use the transaction endpoint lifecycleThese scoped transaction APIs differ from SQL sessions; check their supported operations and isolation limits. 01 Begin and keep tx_idUse the returned transaction ID for its operations. 02 Read supported keysStay within the endpoint’s documented read behavior. 03 Buffer supported writesInspect errors before attempting to finish the transaction. 04 Commit or roll backVerify the final result; a buffered write is not yet committed. Choose the interface Use this page for /v1/tenants/:tenant/tx/*. For SQL statements using a shared session, use SQL transactions instead. They are separate interfaces with different limits. Before you begin Confirm the instance supports the requested mode in /v1/capabilities. Complete the quickstart, including the product-001 record in quickstart.products. Use the engine connection values expected by this example: OC_BASE_URL, OC_TENANT and OC_BEARER. Read, change, commit Python example: increase a sample price by 100 cents import json import os from urllib.request import Request, urlopen base = os.environ["OC_BASE_URL"].rstrip("/") tenant = os.environ["OC_TENANT"] headers = {"Authorization": f"Bearer {os.environ['OC_BEARER']}", "Content-Type": "application/json"} def call(method, path, body=None): request = Request(f"{base}/v1/tenants/{tenant}{path}", method=method, headers=headers, data=None if body is None else json.dumps(body).encode()) with urlopen(request, timeout=30) as response: return json.load(response) opened = call("POST", "/tx/begin?isolation=snapshot_isolation") tx_id = opened["tx_id"] print("Transaction:", tx_id, "isolation:", opened["isolation"]) try: if opened["isolation"] != "snapshot_isolation": raise RuntimeError("Unexpected isolation level") current = call("GET", f"/tx/{tx_id}/rows/quickstart.products/product-001")["row"] call("POST", f"/tx/{tx_id}/rows/quickstart.products", { "id": current["id"], "name": current["name"], "price_cents": current["price_cents"] + 100, }) except Exception: try: call("POST", f"/tx/{tx_id}/rollback") except Exception: pass raise # A lost commit response needs reconciliation, not an unconditional retry. print(call("POST", f"/tx/{tx_id}/commit")) Transaction reads return a row wrapper and see their own buffered writes. Other clients see changes after a successful commit. Know what each mode checks ModeWhat to expect snapshot_isolationChecks recorded point reads and conflicting writes at commit. A second read is not guaranteed to match the first. serializablePreview; requires a supported single-shard configuration. Read the begin receipt's scope. On supported single-writer instances, serializable validation can cover supported scan predicates. On RaftQuorum, serializable_scope: point_reads_only excludes scan and range reads. A lagging replica does not guarantee the most recent value acknowledged elsewhere. Read several rows POST /tx/:id/query takes a supported native scan plan, not SQL text. Unsupported plan leaves are refused. If you found keys outside the transaction, read those keys again inside it before deciding what to change. SQL sessions have their own buffering and isolation restrictions. Do not use their higher-isolation INSERT support as proof that this HTTP workflow is available on every instance. Handle failures OutcomeNext step Confirmed tx_conflict or serialization_failureStart a fresh transaction, re-read and recalculate. Bound the number of retries. Lost commit response or timeoutCheck whether the change happened before repeating it. Constraint or permission errorCorrect the request or permission; repeating it is not a fix. Buffer and open-transaction limits have their own error codes. serializable_sharded_unsupported and serializable_scan_raft_unsupported mean the requested access pattern is unavailable. HTTP 409 alone is not enough to decide whether to retry. Keep the transaction small Keep transactions short, handle expiry and check the final commit. Constraints can fail at commit even when individual buffered writes were accepted. Schema changes use a separate lifecycle. Trigger external side effects only after the transaction's outcome is confirmed. Transactions Previous Page Constraints Next Page --- ## Create a schema step by step | OriginChainDB docs Canonical source: https://originchaindb.com/docs/schemas/tutorial Create a schema step by step Build a table with fields, a searchable category and a supplier relationship. Create two linked tables: each product names a supplier that must already exist. One product. One supplier.Example data · choose a record to see the rule. shop.productsidp001nameDesk lampsupplier_ids001 supplied_by shop.suppliersids001nameNorth SupplyNo supplier with ID s999 Accepted: supplier_id points to an existing supplier. The relation names the link; the foreign key checks that its destination exists. Build a valid supplier-product connectionLoad the referenced supplier before a product that depends on it. 01 Define the supplier tableGive each supplier a unique ID. 02 Define the product tableAdd its supplier reference and required validation rules. 03 Insert a supplier firstMake the referenced ID available. 04 Add and verify the productUse that supplier ID, then check the saved row and relationship. Before you start Use a running database and copy its complete OC_URL and OC_TOKEN from Connect. See connection setup. Save the supplier definition as suppliers.toml namespace = "shop" table = "suppliers" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "name" ty = "str" Build the definition StepAddPurpose 1namespace, table, primary_keyName the table and identify each record. 2[[columns]]Store the product's name, category, price and supplier ID. 3[[indexes]]Make a category index available to the query planner. 4[[relations]]Give the supplier connection a name: supplied_by. 5[[foreign_keys]]Reject a product that points to a missing supplier. 6[[check_constraints]]Require a positive price and a known category. This example stores the price as integer cents. For exact decimal text, review the decimal type in the schema reference. Save the finished schema Save the following as manifest.toml. It includes all six steps, so you do not need to combine separate snippets. Complete product schema # manifest.toml - the finished schema. namespace = "shop" table = "products" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "name" ty = "str" [[columns]] name = "category" ty = "str" [[columns]] name = "price_cents" ty = "i64" [[columns]] name = "supplier_id" ty = "str" [[indexes]] name = "by_category" columns = ["category"] [[relations]] name = "supplied_by" from_col = "supplier_id" bidirectional = true [relations.target] namespace = "shop" table = "suppliers" pk = "id" [[foreign_keys]] name = "fk_supplier" from_col = "supplier_id" target_schema = "shop.suppliers" target_col = "id" on_delete = "restrict" [[check_constraints]] name = "price_positive" expression = "price_cents > 0" [[check_constraints]] name = "category_in_set" expression = "category IN ('electronics', 'books', 'shoes')" Register suppliers.toml first, then manifest.toml; a definition creates the table, not its records. Run the example: register, write and read back Run these commands from the folder containing both files. Set OC_URL and OC_TOKEN first; use a new database or unused table names for this example. 1. Register both tables. An existing table returns 409; inspect it before continuing. curl --fail-with-body "$OC_URL/schemas" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: text/plain; charset=utf-8" \ --data-binary @suppliers.toml curl --fail-with-body "$OC_URL/schemas" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: text/plain; charset=utf-8" \ --data-binary @manifest.toml 2. Save the supplier, then its product. Continue only after each request succeeds. curl --fail-with-body "$OC_URL/rows/shop.suppliers" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ --data '{"id":"s001","name":"North Supply"}' curl --fail-with-body "$OC_URL/rows/shop.products" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ --data '{"id":"p001","name":"Desk lamp","category":"electronics","price_cents":1990,"supplier_id":"s001"}' 3. Read the product. Look for id: p001, supplier_id: s001 and price_cents: 1990 in the returned record. curl --fail-with-body "$OC_URL/rows/shop.products/p001" \ -H "Authorization: Bearer $OC_TOKEN" These are sample commands, not results from your database. See record operations for replacement and update behaviour. Check the rules TryExpected behaviour A product with a valid supplier, positive price and allowed categoryThe row can be saved. A product with an unknown supplier IDThe foreign-key check rejects it. A negative or zero priceThe price check rejects it. Deleting a supplier still used by a producton_delete = "restrict" prevents the deletion. Try Missing supplier in the illustration above to see the foreign-key rule. The price and category rules are separate checks. Add search when you need it The schema does not automatically create embeddings or index text. Use the vector and full-text setup guides for those steps. Understand schemas Decide what each record contains before you save it. Create tables in the console Name a table, choose its fields and check the saved definition. --- ## Prepare data for vector search | OriginChainDB docs Canonical source: https://originchaindb.com/docs/schemas/vector Vector search Prepare data for vector search Keep embeddings consistent and connect matches back to their source records. Use the same embedding model for saved content and the question you search with. Connect a vector match to its contentThe stored and query vectors must use the same model, dimensions and compatible distance metric. 01 Keep the source recordGive the content a stable ID. 02 Generate and write its embeddingSave the complete vector under the matching ID. 03 Query with a compatible vectorGenerate the query representation with the same model. 04 Read the matching sourceUse returned IDs to retrieve the original content. Prepare the collection Choose the embedding model your application will use. Create embeddings with that model before sending them to the database. Give each embedding the same ID as its source record. Use the same model and vector length for indexing and searching. Saving a normal row does not create an embedding or add it to the vector index. Write vector values through the vector endpoints. Example schema with vector settings # The row schema. Vectors do NOT live in a column - they sit in their # own keyspace, addressed by the same id. Registering the table is what # lets you read the row back with SQL after a vector hit gives you an id. namespace = "shop" table = "orders" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "customer" ty = "str" [[columns]] name = "amount_cents" ty = "i64" [[columns]] name = "status" ty = "str" [[columns]] name = "notes" ty = "str" [[columns]] name = "placed_ms" ty = "u64" # Optional. Declares the dimensionality the collection expects so a # wrong-sized vector is refused with a readable message instead of a # generic mismatch. `distance` accepts cosine | l2 | dot | manhattan | l1, # defaults to cosine, and resolves the metric queries actually run under. [vector] dim = 768 distance = "cosine" The [vector] block describes the collection. dim is the number of values in each vector; distance selects how similarity is measured. A schema may also declare vector metadata through columns.params.vector_dim; that does not make ordinary row writes populate the search index. Choose the distance measure Use the distance measure recommended by your embedding model. SettingWhat it compares cosineDirection, rather than vector length. The default. dotInner product. Normalize vectors when the model requires it. l2Euclidean distance. Use this spelling, not euclidean. manhattan or l1Sum of the absolute differences. An unknown measure returns 400. If a non-default measure is declared, a conflicting request is also rejected. An omitted request measure uses the collection setting. A declared cosine does not reject another request measure in the current contract, so keep your application's settings consistent. Check vector length Every stored and query vector in a collection must have the same positive dimension. For example, a 512-value vector does not fit a collection configured for 768 values. Example dimension error vector has 512 dims but collection "shop.orders" expects 768. Use the same model, or re-index the collection. Plan a model change Changing models can change both dimension and meaning. Rebuild the collection with the new embeddings. Larger vectors use more memory and calculation work. Test quality and latency on representative data. Keep the source record so a returned ID can be opened and shown to the user. Continue Vector search guide · Vector examples · Schema settings Your first vector search Previous Page Create and manage embeddings Next Page --- ## SDKs | OriginChainDB docs Canonical source: https://originchaindb.com/docs/sdk SDKs Choose a language and understand which SDK version each example requires. Use an SDK to send database requests from your application. Start with your language, then check its version before copying an example. Choose an SDK and verify its versionSource releases and package-registry versions can expose different APIs; follow the selected version’s instructions. 01 Choose your languageOpen the SDK’s source and setup guide. 02 Check its release instructionsConfirm the version and installation method. 03 Configure a server-side connectionUse the complete address and token from Connect. 04 Run a small readInspect the returned result before building a larger workflow. Choose your language The SDKs are available on GitHub. Choose a language for installation instructions and working examples. These guides use the 1.0 source candidate; install it from the linked repository. LanguageGet startedPublic source TypeScript / JavaScriptRead the guideGitHub PythonRead the guideGitHub GoRead the guideGitHub JavaInstallation and examplesGitHub C# / .NETInstallation and examplesGitHub RubyInstallation and examplesGitHub PHPInstallation and examplesGitHub RustInstallation and examplesGitHub The 1.0 source is public, but the new packages are not on registries yet. npm and PyPI still serve earlier APIs; an unversioned install will not install the Client examples in these guides. To use HTTP directly, start with API authentication. What the candidate supports Creating a client connects your application; it does not create tables, generate embeddings or index your text. Prepare the data for the operation you want to call. TaskSDK namespaceWhat it does Run SQLsqlSend parameterized statements and inspect complete results. Define dataschemasList schemas, read a schema or register TOML. Read and write recordsrowsGet a record, put a record or send a batch. Search by meaningvectorStore vectors, search nearby vectors or delete one. Search textftsIndex text; run ranked, boolean or phrase searches. Follow relationshipsgraphRun Cypher, find neighbors or walk a graph. Usage and query metrics are also available. Method names follow each language's conventions. Your database must support the operation, and your credential must have permission to use it. Advanced helpers can differ between languages. Connect to a database Set two server-side environment variables: VariableValue OC_URLThe complete HTTPS database address from Connect. Keep its path unchanged. OC_TOKENThe credential shown for that connection. The candidate appends operation paths to OC_URL; you do not build a tenant URL yourself. PostgreSQL tools use a separate database login, not these SDK settings. See API authentication for connection availability and credential types. Read the complete result Read a query result in two parts: the returned data and the outcome of the operation. You need to knowRead Which records matched?Rows with their column metadata. Did a write finish?Confirmed write counts, when provided; buffered counts alone do not confirm a commit. Did every statement finish?Nested statement results and any partial batch error. Why did search return this item?Its record ID and the score for the chosen search method. sql.run returns rows, column metadata, confirmed write counts, nested statement results and the original response. A missing write count means unknown, not zero. A batch can partially succeed; inspect its partial results before repeating any statement. Full-text results contain hits and optional facets in every search mode. Numeric and date/time strings are preserved rather than silently converted. Timeouts and retries The candidate uses a 60-second default timeout and does not retry requests automatically. Ruby applies that timeout to connection, read and write inactivity. Redirects are not followed. A timeout, cancellation or 503 can happen after a write commits. Check the outcome before retrying. An idempotency key does not make arbitrary SQL safe to replay. Python and TypeScript retain explicit retry options for existing integrations. Diagnose a failed request Record the SDK version, operation, HTTP status and request ID when available. Keep tokens and private query results out of logs. A protocol error is different from a valid empty result. Source versions Use the candidate README at a verified source commit for setup. Registry releases remain separate; a source update does not publish a package. LanguageCandidate source PythonSource and setup TypeScript / JavaScriptSource and setup GoSource and setup RustSource and setup JavaSource and setup C#Source and setup PHPSource and setup RubySource and setup Read the API reference · Create your first table · Use the CLI TypeScript Connect from a Node.js application, bind SQL parameters and inspect SDK results. --- ## Go SDK | OriginChainDB docs Canonical source: https://originchaindb.com/docs/sdk/go Go SDK Create a reusable Go client, pass request contexts and handle database results. Use a reusable client for SQL and search requests from Go. This guide describes the 1.0.0-rc.1 source candidate and requires Go 1.23 or newer. Make a first request with GoUse the linked 1.0 candidate source instructions; older package interfaces are different. 01 Prepare the supported Go setupFollow the pinned source version’s installation instructions. 02 Load connection values on the serverUse the complete OC_URL and its OC_TOKEN. 03 Run parameterized SQLPass values separately and use a bounded request context. 04 Inspect the typed resultCheck errors and close the client when finished. Get the SDK The SDK is available on GitHub. Follow the source-install steps in that README, then return here to run your first query. The 1.0 candidate package has not been released on registries; the examples below use its source API. The candidate uses FromEnv, SQL.Run and operation namespaces. Older generated clients use service builders; changing only the import path will not migrate them. Connect and run SQL Set OC_URL to the complete HTTPS database address from Connect and OC_TOKEN to its credential. Do not construct or remove a tenant path. With the candidate installed in your module, save this as main.go: package main import ( "context" "log" "time" oc "github.com/originchaindb/originchaindb-go" ) func main() { db, err := oc.FromEnv() if err != nil { log.Fatal(err) } defer db.Close() ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() result, err := db.SQL.Run(ctx, "SELECT $1 AS value", 7) if err != nil { log.Fatal(err) } log.Println(result.Rows) } Run go run .. Expect one row with value equal to 7. This read-only query needs no table and creates no data. SQL values are variadic arguments after the statement; $1 binds 7. Parameters replace values, not table or column names. The client supports concurrent calls, and Close releases idle connections. Credentials and permissions Use the connection offered by Connect for your database configuration. See authentication for access-token availability and instance-credential fallback. PostgreSQL tools use their own database login. Query other models Every network operation takes a context.Context. Prepare the named schema, field or vector table before calling its method. Full-text search Within a function using the db and ctx above: result, err := db.FTS.Search(ctx, "documents", "body", "account setup", oc.FTSSearchOptions{ Mode: "bm25", K: 10, }) if err != nil { return err } for _, hit := range result.Hits { log.Println(hit.DocID, hit.Score) } This fragment belongs in a function returning error. Index the text field first. DocID identifies a source document; Score ranks matches for that search, not a confidence percentage. An empty Hits slice is a valid no-match result. Ranked, boolean and phrase searches use a consistent hits-and-facets result. Vector search Use db.Vector.Put, Search and Delete for embeddings. Your query must use the same dimension and embedding model as the stored vectors. Follow the vector guide for data preparation. Graph queries Use db.Graph.Query for Cypher with named parameters, or Neighbors and BFS for traversal. The graph quickstart covers the required tables and relationships. Read results and errors The common namespaces are SQL, Schemas, Rows, Vector, FTS and Graph. Usage and query metrics are also available. SQL.Run retains rows, columns, column types, confirmed counts, buffered counts, nested results and the original envelope. Missing write counts remain unknown. Batches may partially succeed. Use errors.As to inspect an *oc.Error. Its Kind, Status and RequestID help distinguish HTTP, network, timeout and protocol failures. Partial contains SQL outcomes when a batch fails. Response bodies are optional diagnostics; avoid logging private data. Deadlines and retries The client defaults to a 60-second HTTP timeout. Use a request context for a shorter deadline, as in the example, or oc.WithTimeout when constructing the client. The example's context expires after ten seconds; create an appropriate context for later independent work rather than reusing an expired one. Requests are not retried automatically and redirects are not followed. A canceled or timed-out write may already have committed. Inspect its outcome before retrying; an idempotency key alone is not a replay guarantee. Continue SDK availability · SQL guide · HTTP API Python Use synchronous or asynchronous Python clients and read complete query results. CLI overview Set up an engine profile, run a parameterized query and choose your next CLI task. --- ## Python SDK | OriginChainDB docs Canonical source: https://originchaindb.com/docs/sdk/python Python SDK Use synchronous or asynchronous Python clients and read complete query results. Run database queries from a Python service or script. This guide describes the 1.0.0rc1 source candidate, which requires Python 3.10 or newer. Make a first request with PythonFollow the linked 1.0 candidate source instructions; the older PyPI package uses a different interface. 01 Prepare the Python environmentInstall the version using its documented source instructions. 02 Create a server-side clientChoose the synchronous or asynchronous client and load connection values. 03 Bind SQL valuesKeep parameter values separate from the SQL statement. 04 Read and close cleanlyCheck the response and release the client when finished. Get the SDK The SDK is available on GitHub. Follow the source-install steps in that README, then return here to run your first query. The 1.0 candidate package has not been released on registries; the examples below use its source API. Already using the PyPI package? PyPI's latest stable release is originchain 0.9.0. It does not install the 1.0 Client API shown on this page. Existing integrations can stay pinned while you plan migration: python -m pip install originchain==0.9.0 Use that version's documentation for an existing integration. These candidate examples are not a drop-in upgrade. Connect and run SQL Set OC_URL and OC_TOKEN in the process environment using the values from Connect. OC_URL is the complete HTTPS database address; preserve its path. With the candidate installed, save this as query.py and run python query.py: from originchain import Client with Client.from_env() as db: result = db.sql.run("SELECT $1 AS value", [7]) print(result.rows) Expect one row with value equal to 7. This confirms the request reached the database and returned a value; it does not create any data. No table is needed for this first query. $1 binds the first item in the list. Pass values separately rather than formatting them into SQL. Parameters replace values, not table or column names. The context manager closes the client when the block ends. Use an async application Use AsyncClient when your application already runs an event loop: import asyncio from originchain import AsyncClient async def main(): async with AsyncClient.from_env() as db: result = await db.sql.run("SELECT $1 AS value", [7]) print(result.rows) asyncio.run(main()) Reuse the client for the service's lifetime. Await its network operations; do not create a new event loop inside an already running async handler. Choose an operation NamespaceUse db.sqlRun statements or batches and inspect their complete results. db.schemasList, read or register a schema. db.rowsRead a record, write one or send a batch. db.vectorStore embeddings, search them or delete a vector. db.ftsIndex text and search words or phrases. db.graphQuery or traverse relationships. The server's capabilities and your permissions determine which requests succeed. Usage and query metrics are available separately; advanced helpers vary by language. Use the connection from Connect Keep OC_TOKEN in your environment or secret manager. Use the credential offered for your database configuration, as explained in authentication. PostgreSQL logins and organization-management credentials are separate; they are not substitutes for this HTTP connection. Search other data models These examples assume an open synchronous db and existing data. Use the matching async methods with await in an asynchronous application. Full-text search After indexing a text field, run a ranked search: result = db.fts.search("documents", "body", "account setup", mode="bm25", k=10) for hit in result.hits: print(hit.doc_id, hit.score) Each doc_id identifies an indexed source document. A score ranks matches for this search; it is not a percentage of correctness. An empty hit list means this request found no matches. All search modes return hits and optional facets; unranked hits use a zero score. Vector search Use db.vector with embeddings from the same model and dimension as the stored data. Creating a client does not generate embeddings or populate an index. Follow the vector guide to prepare them. Graph queries Use db.graph after defining the relevant tables and relationships. The graph quickstart explains the data setup; Cypher parameters bind by name. Read results and handle errors sql.run keeps the full SQL outcome: rows, column metadata, confirmed write counts, buffered counts, nested results and the raw response. A missing count stays unknown. HTTP failures expose status and a request ID when the server supplies one. A batch can fail after earlier statements succeeded. Inspect the partial result before repeating it. A protocol error is not an empty result. Handle it as a failed response. Keep tokens and private rows out of diagnostic logs. Numeric and date/time strings remain unchanged. Avoid converting values until your application knows the expected type and precision. Timeouts and retries The candidate's default timeout is 60 seconds and requests are not retried automatically. Explicit retry settings remain for existing integrations, but a timeout or 503 may follow a committed write. Cancellation stops waiting; it does not prove rollback. Do not infer success from a result kind alone or treat a buffered count as a commit confirmation. See retry behavior. Continue The package and import name are both originchain. The separately generated originchaindb package is a different API. SDK availability · SQL guide · HTTP API TypeScript Connect from a Node.js application, bind SQL parameters and inspect SDK results. Go Create a reusable Go client, pass request contexts and handle database results. --- ## TypeScript and JavaScript SDK | OriginChainDB docs Canonical source: https://originchaindb.com/docs/sdk/typescript TypeScript and JavaScript SDK Connect from a Node.js application, bind SQL parameters and inspect SDK results. Use the client from a Node.js service to run SQL and search your database. This guide describes the 1.0.0-rc.1 source candidate. It requires Node.js 18 or newer at runtime and Node.js 24 or newer to build the source checkout. Make a first request with TypeScriptFollow the linked source version’s setup; keep database tokens out of browser bundles. 01 Install the documented source versionCheck the Node runtime and source-build requirements. 02 Create the client on your serverLoad the complete connection URL and token. 03 Run SQL with parametersPass user values separately from the statement. 04 Inspect the responseHandle errors and confirm the returned rows. Get the SDK The SDK is available on GitHub. Follow the source-install steps in that README, then return here to run your first query. The 1.0 candidate package has not been released on registries; the examples below use its source API. Already using the npm package? The latest npm release is @originchain/sdk 0.5.1. It does not provide the 1.0 Client API shown on this page. Existing integrations can stay pinned while you plan migration: npm install @originchain/sdk@0.5.1 Use the documentation bundled with that version. The examples on this page are for the new candidate, not 0.5.1. Connect and run SQL Set OC_URL to the complete database address from Connect and OC_TOKEN to its credential. Keep both in your server environment. Do not trim the URL path or derive a tenant ID from it. With the candidate installed, save this as query.mjs and run node query.mjs: import { Client } from "@originchain/sdk"; const db = Client.fromEnv(); const result = await db.sql.run("SELECT $1 AS value", [7]); console.log(result.rows); Expect one row with value equal to 7. It checks the connection without creating or changing data. This query needs no table. $1 binds the first value in the array. Parameters substitute values, not table or column names. Reuse db for later requests instead of creating a client for every call. Keep database credentials out of browser bundles. Choose the right credentials Use the connection offered by Connect. Access-token support depends on the database configuration; other configurations retain their instance credentials. See authentication before changing a working integration. A PostgreSQL username and password are separate from the HTTP SDK credential. Search other data models The following calls reuse db and require the named data to exist. Full-text search After indexing a text field, search it and read the hits: const result = await db.fts.search("documents", "body", "account setup", { mode: "bm25", k: 10, }); console.log(result.hits); Inspect each hit's document ID to connect it to your source data. Scores rank results within the selected method; they are not confidence percentages. An empty hit list is a valid no-match result. Ranked, boolean and phrase searches expose the same hits-and-facets result structure; BM25 is the default mode. Vector search Use an embedding from the same model and dimension as the stored vectors. This three-number query is only a request-shape example. const hits = await db.vector.search("embeddings", [0.1, 0.2, 0.3], { k: 5, metric: "cosine", }); console.log(hits); Graph queries Use db.graph for Cypher, neighbors and breadth-first traversal. Prepare the tables and relationships with the graph quickstart before querying them. Cypher parameters are named; SQL parameters are positional. Database and management APIs The candidate's common database namespaces are sql, schemas, rows, vector, fts and graph. Usage and query metrics are also available. Organization management uses a separate API and credential contract; a database connection does not grant organization permissions. Handle results and errors Read result.rows for records and result.columns for column order. Preserve column_types, rows_affected, rows_buffered and nested results when your application needs them. The original envelope is in raw. A failed statement inside a batch raises BatchError; its result retains partial outcomes. A batch is not assumed atomic. HTTP errors expose status and request ID when supplied. Log those identifiers rather than a token or private response body. Unsafe JSON numeric values remain strings to avoid JavaScript precision loss. Do not convert them to Number unless the value fits your application's range. Timeouts and cancellation The default timeout is 60 seconds, with no automatic retries. Explicit retry options exist for compatibility; leave them off until the operation is proven safe to repeat. An aborted request can still have committed a write. Missing write counts remain unknown. Inspect uncertain results before resubmitting SQL. See retry behavior. Continue SDK availability · SQL guide · HTTP API SDKs Choose a language and understand which SDK version each example requires. Python Use synchronous or asynchronous Python clients and read complete query results. --- ## SQL reference | OriginChainDB docs Canonical source: https://originchaindb.com/docs/sql SQL SQL reference SQL lets you select records, combine tables and update data with explicit statements. Start with a small SELECT, then use the sections below for parameters, grouping, joins and writes. For application access, use the complete OC_URL from Connect with its supported OC_TOKEN credential. The tenant-scoped HTTP examples below are engine reference examples; do not derive or shorten a new connection URL to match them. PostgreSQL database logins currently provide read-only access. Find and test the SQL clause you needUse HTTPS for supported writes; PostgreSQL login access is currently read-only. 01 Choose the query taskFilter, join, group, sort or change records. 02 Check the supported syntaxReview the clause and any deployment restrictions. 03 Bind values and run a small queryUse parameters and a bounded result where appropriate. 04 Inspect status and result kindConfirm rows or write outcomes before continuing. Start with the supported surface OriginChainDB supports SQL selection, filtering, ordering, aggregates, joins, CTEs, set operations, window queries and data writes. Compatibility is scoped: PostgreSQL protocol support is not complete PostgreSQL parity, and a preview feature is not necessarily enabled on every deployment. Read your instance's capabilities and the PostgreSQL compatibility guide before porting an application. Send a SQL request Complete the quickstart to create quickstart.products. Set OC_BASE_URL to your full HTTPS endpoint, OC_TENANT to the tenant ID and OC_BEARER to an instance token. curl --fail-with-body "$OC_BASE_URL/v1/tenants/$OC_TENANT/sql" \ -H "Authorization: Bearer $OC_BEARER" \ -H "Content-Type: application/json" \ --data '{"sql":"SELECT id, name, price_cents FROM quickstart.products WHERE price_cents < $1 LIMIT 10","params":[2000]}' For the original quickstart data, the result includes product-001, Trail mug and 1990. A SELECT response has kind: select and a rows array. Check the status before decoding a response as a successful query. Bind values instead of building SQL strings Use $1, $2 and a JSON params array in the same order. Bound values stay separate from SQL text, so do not build a query by concatenating user input. For a client wrapper, follow the Python guide or check the publication status in the SDK directory. Use parameters for values, not SQL identifiers or whole clauses. Check that the supplied parameter count matches the placeholders. A transaction-control statement does not take a parameter array. Do not substitute a language's ? or :name notation into this HTTP contract. Select and filter rows Use fully qualified table names to make the intended namespace explicit. Give calculated expressions an alias and use a deterministic ORDER BY when paging. The following SQL can be run in Workbench, an enabled SQL client, or the HTTP request's sql field. SELECT id, name, price_cents FROM quickstart.products WHERE price_cents BETWEEN 1000 AND 2000 ORDER BY price_cents DESC, id ASC LIMIT 10; SELECT id, name FROM quickstart.products WHERE name LIKE '%mug%' AND price_cents IS NOT NULL LIMIT 10; Use IS NULL and IS NOT NULL for missing values. column = NULL does not mean “is missing.” Begin with a bounded LIMIT when exploring a large table. Aggregate and group SELECT COUNT(*) AS product_count, MIN(price_cents) AS lowest_price, MAX(price_cents) AS highest_price FROM quickstart.products; SELECT name, COUNT(*) AS products FROM quickstart.products GROUP BY name HAVING COUNT(*) > 0 ORDER BY name LIMIT 10; COUNT, SUM, AVG, MIN and MAX cover common summaries. Support for additional aggregates, expression combinations and numeric behavior varies by feature and build; test the exact query rather than inferring the entire PostgreSQL function catalog. Use HAVING to filter a group and WHERE to filter its input rows. Join related tables INNER and outer joins combine records using a supported ON expression. Qualify columns and use explicit output aliases, especially when tables share names such as id. Set up both source tables first. Follow the inner join and left join examples; check returned columns and null behavior when migrating a query. Use CTEs, set operations and windows WITH affordable AS ( SELECT id, name, price_cents FROM quickstart.products WHERE price_cents < 2000 ) SELECT id, name FROM affordable ORDER BY id LIMIT 10; CTEs and supported derived-table queries are available; older blanket statements that all derived tables are refused are obsolete. Recursive CTEs, window frames and combinations of joins, aggregates and windows still have specific limits. Use the recursive CTE example, window examples and the capability response for the shape you need. Execute data writes -- Use a new sample ID so this does not replace the quickstart row. INSERT INTO quickstart.products (id, name, price_cents) VALUES ('product-sql-demo', 'Travel flask', 2490) RETURNING id, name; UPDATE quickstart.products SET price_cents = 2290 WHERE id = 'product-sql-demo' RETURNING id, price_cents; DELETE FROM quickstart.products WHERE id = 'product-sql-demo' RETURNING id; INSERT, UPDATE and DELETE execute. A successful SQL response is not a translation to replay against the row API. These three statements create, change and remove only product-sql-demo; running the INSERT twice before deleting it produces a duplicate-key conflict. SQL INSERT rejects a duplicate primary key unless you explicitly choose a supported ON CONFLICT action. The ordinary HTTP row-write endpoint is an upsert; use ?expect=insert there for insert-only behavior. Keep a WHERE clause on UPDATE and DELETE and inspect affected rows. Do not assume a missing predicate is always rejected. For bulk ingestion use the row batch API. Its NDJSON mode commits chunks, so the entire stream is not one all-or-nothing transaction and a later failure can leave earlier chunks committed. Create and evolve a schema CREATE TABLE examples.orders ( id TEXT PRIMARY KEY, customer_id TEXT, total_cents BIGINT NOT NULL, status TEXT DEFAULT 'pending' ); CREATE INDEX orders_by_customer ON examples.orders (customer_id); ALTER TABLE examples.orders ADD COLUMN note TEXT; This creates a separate examples.orders table; run it once in a development database. It is not part of the quickstart product fixture. Schema changes and access-control statements can form commit boundaries. Do not rely on ROLLBACK to undo DDL. Use the schema reference for types and indexes and constraints for their supported shapes. Use integer minor units when following these price examples. For DECIMAL/NUMERIC columns, declare precision and scale and test calculations and serialization against your application's requirements; do not substitute binary floats and assume identical decimal behavior. Inspect a plan EXPLAIN SELECT id FROM quickstart.products WHERE price_cents < 2000; -- ANALYZE executes the query and reports measured execution information. EXPLAIN ANALYZE SELECT id FROM quickstart.products WHERE price_cents < 2000; EXPLAIN inspects the plan. EXPLAIN ANALYZE executes the query and reports measurements; it is not a dry run. Use the plan to check whether an index or a scan serves your predicate. A small LIMIT does not guarantee that a sort, join or aggregate avoids reading a large input. Group data writes For multiple calls over HTTP, use one X-OC-Session-Id for BEGIN, statements and COMMIT/ROLLBACK. Current supported deployments let statements see their own transaction's buffered writes. Read the SQL transaction guide for failures, DDL boundaries and topology limits. The preview transaction API has a different isolation contract. Availability and permissions A 403 normally requires checking the caller's permissions. A 402 can indicate a configuration or entitlement requirement. Read the returned code and message; do not rename SQL identifiers or buy an add-on based on an old internal plan name. The console and dedicated pricing page show current configuration options. Limits and troubleshooting Request size, result size, memory, concurrency, recursion and cross-shard gathering have separate limits. A large result can fail even when the SQL text is small. Multi-statement requests are supported in documented scopes. DDL and explicit transaction boundaries can change their atomicity. See the compatibility guide; do not treat every semicolon-separated script as one transaction. Use X-OC-Statement-Timeout-Ms and a valid unique X-OC-Query-Id where supported. Handle timeout, cancellation and temporary throttling distinctly. Capture the engine request ID, statement shape and deployed capability response when reporting a mismatch. Exclude credentials and private values. Choose a query model Previous Page Your first SQL query Next Page --- ## FK + CHECK constraints. | OriginChainDB docs Canonical source: https://originchaindb.com/docs/sql/constraints SQL FK + CHECK constraints. A constraint checks whether a write is valid. A foreign key checks a reference to another record; a CHECK constraint tests a condition such as a nonnegative amount. Define the rules with the schema, then test both an accepted and a rejected write. Check data rules before accepting a writeA reference needs an existing parent; CHECK rules and null handling must match your intended data contract. 01 Define the ruleChoose a primary key, foreign key or CHECK constraint. 02 Prepare referenced recordsInsert parent rows before dependent rows. 03 Try valid and invalid valuesUse a small sample to exercise the rule. 04 Inspect acceptance and rejectionCorrect invalid data instead of blindly repeating the write. Foreign keys. The example links a child record to a parent key. Insert the parent before writing a child that references it. The effect of deleting a parent depends on its declared action and the deployed engine’s supported actions. Restricting a deletion, setting a reference to NULL and cascading a deletion are different choices. Check the schema reference and test the selected action before using it on live data. # manifest.toml namespace = "shop" table = "orders" primary_key = ["id"] # ... [[columns]] declarations ... [[foreign_keys]] name = "fk_client" from_col = "client_id" target_schema = "shop.clients" target_col = "id" on_delete = "restrict" # no_action | restrict | set_null CHECK expressions. Use a CHECK expression for a condition on the stored values. The supported expression subset includes comparisons, boolean combinations, NULL checks and membership tests. Unsupported expressions need a different rule or application validation. [[check_constraints]] name = "amount_positive" expression = "amount >= 0 AND status IN ('pending', 'paid', 'shipped')" [[check_constraints]] name = "refund_window" expression = "refunded_at IS NULL OR refunded_at >= shipped_at" 3-valued logic. SQL conditions can evaluate to true, false or unknown. A CHECK rejects false; an unknown result caused by NULL can pass. If a value must exist, use the required-field rule or an explicit IS NOT NULL condition. Do not assume every expression containing NULL becomes unknown: boolean combinations such as OR can still determine a true result. Errors. Read the returned status and constraint detail. Fix the invalid value or missing parent before trying again. For a batch, inspect its documented transaction boundary; a constraint failure does not imply that every earlier operation in a larger import was rolled back. See write behavior and error handling. Transaction API Read records, prepare changes and commit them together on supported instances. Materialized views Next Page --- ## SQL models by industry | OriginChainDB docs Canonical source: https://originchaindb.com/docs/sql/industries SQL SQL models by industry These examples use SQL for orders, account entries, inventory and events. Each shows a table design and a useful question to ask it. Create the example tables before running the queries; they are separate from the quickstart product table. Build a report from related business recordsThe industry tables are separate fixtures; create and validate them before running these queries. 01 Model the business recordsFor example, orders, order lines and products. 02 Connect their keysMake the relationships needed by the report explicit. 03 Select the reporting periodUse the intended time boundaries and business conditions. 04 Join and calculate totalsCompare the grouped result with a small known sample. Retail: an order book Orders, their lines, and the products they point at. The reporting questions are all aggregates over a join. The tables shop.products (id PK, name, brand, price) shop.orders (id PK, customer_id, status, placed_at) shop.lines (id PK, order_id -> orders.id, product_id -> products.id, qty) Revenue by brand, last month One statement, joined and grouped in the engine, rather than three round trips and a loop in your service. SELECT p.brand, SUM(l.qty * p.price) AS revenue, COUNT(DISTINCT o.id) AS orders FROM shop.lines l JOIN shop.orders o ON l.order_id = o.id JOIN shop.products p ON l.product_id = p.id WHERE o.status = 'paid' GROUP BY p.brand ORDER BY revenue DESC The same catalog, searched Add the relevant search index before searching this catalog. Attached table indexes and explicit document/vector writes have different update paths. A SQL INSERT does not automatically generate an embedding. See writing and indexing. SELECT id, name FROM shop.products WHERE brand = 'Aero' ORDER BY price ASC Financial services: a ledger Append-only entries, balances derived rather than stored, and money kept in minor units so totals never drift. The tables fin.accounts (id PK, holder, currency, opened_at) fin.entries (id PK, account_id -> accounts.id, amount_minor, kind, booked_at) Balance per account Derived from the entries, so it cannot disagree with them. SELECT a.id, a.holder, a.currency, SUM(e.amount_minor) AS balance_minor FROM fin.accounts a JOIN fin.entries e ON e.account_id = a.id GROUP BY a.id, a.holder, a.currency who sees which rows Run the query with the intended database identity and verify its table grants, row policies and column masks. A WHERE clause is not a substitute for database authorization. Test both permitted and denied records. Logistics: inventory with reservations Stock on hand, minus what is promised. The trap is reading availability and acting on it after someone else already did. The tables wh.stock (sku PK, on_hand) wh.reservations (id PK, sku -> stock.sku, qty, state, made_at) What is actually available Subtract live reservations from stock in one statement. SELECT s.sku, s.on_hand, COALESCE(SUM(r.qty), 0) AS reserved, s.on_hand - COALESCE(SUM(r.qty), 0) AS available FROM wh.stock s LEFT JOIN wh.reservations r ON r.sku = s.sku AND r.state = 'held' GROUP BY s.sku, s.on_hand make the decision atomic Reading availability and then reserving is two steps, and another writer fits between them. Do the read and the write in one transaction — see transactions — so the reservation either wins or fails cleanly. Product analytics: an event stream High write volume, and questions that are almost always time-bucketed. The tables app.events (id PK, user_id, name, props_json, at) Daily active users Grouped in the engine over the whole table, not sampled in a job. SELECT DATE_TRUNC('day', at) AS day, COUNT(DISTINCT user_id) AS dau FROM app.events WHERE at >= '2026-09-01T00:00:00Z' GROUP BY day ORDER BY day when a query becomes a dashboard If a dashboard repeatedly runs an expensive summary, consider saving it as a materialized view. That saved result needs an explicit refresh. See materialized views. What these have in common The tables are the design. Every cheap question later comes from a key or a foreign key you declared now. Prepare each query method. Reuse source IDs across rows and search indexes, and keep each required representation current. Policy is enforced below your query. Row-level security and masking apply to the statement itself, including inside aggregates. Start from zero — Schema, insert, select, join, aggregate. More examples — Single-purpose recipes with their responses. Configure a materialized view Store a reusable result and refresh it when its source changes. Vector search overview Next Page --- ## Materialized views. | OriginChainDB docs Canonical source: https://originchaindb.com/docs/sql/materialized-views SQL Materialized views. A materialized view saves the result of a query so you can read it later. Refresh it when the underlying data changes and you need a newer result. Refresh is explicit; a stored view does not update itself on every row write. Keep a saved query result currentReading the view returns its last successful materialization, not newly changed source rows. 01 Install the view queryDefine the SELECT and compute its initial saved result. 02 Read that saved resultUse it until newer source data is needed. 03 Request a refreshRe-run the full definition and replace the stored result. 04 Verify the refreshed valuesCompare a changed source row with the new summary. Three endpoints. POST :name/install Define the view + compute the initial materialization in one call. POST :name/refresh Re-run the definition and atomically overwrite the materialization. GET :name Read the saved query result. It reflects the last successful refresh, not later changes to the source rows. Install. Prepare a line_items table with customer_id, qty and price, then add a few rows. The reference request below uses an explicit engine hostname, tenant variable T and bearer token; substitute the values for that interface. It creates a saved result named customer_revenue. curl -X POST "https://acme.db.originchain.ai/v1/tenants/$T/sql/materialized_views/customer_revenue/install" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sql": "SELECT customer_id, SUM(qty * price) AS revenue FROM line_items GROUP BY customer_id" }' Refresh. The refresh atomically overwrites the existing materialization. Readers see either the previous version or the new one — never a half-written state. curl -X POST "https://acme.db.originchain.ai/v1/tenants/$T/sql/materialized_views/customer_revenue/refresh" \ -H "Authorization: Bearer $OC_TOKEN" Read. Read the saved customer totals. To check freshness, change one source row, read the view, refresh it and read again: only the refreshed result should include the change. curl "https://acme.db.originchain.ai/v1/tenants/$T/sql/materialized_views/customer_revenue" \ -H "Authorization: Bearer $OC_TOKEN" Cost considerations. Refresh re-runs the full definition. Cost scales with the underlying query; pick refresh cadence to match how stale your readers can tolerate. For hot rollups (BI dashboards, leaderboards) refresh on a fixed cron — for cold rollups, refresh on demand. Incremental refresh (delta-only) is on the roadmap; until then, a full refresh is the only path. Next: SQL queries and transaction boundaries. Constraints Previous Page Configure a materialized view Store a reusable result and refresh it when its source changes. --- ## Run your first SQL query | OriginChainDB docs Canonical source: https://originchaindb.com/docs/sql/quickstart SQL Run your first SQL query Define a product table, write a row and read it back through the HTTP API. Then try a grouped query and a SQL write. The examples are small enough to check the returned values by hand. Check SQL with one known productThe examples use HTTPS; write support is separate from the read-only PostgreSQL login. 01 Register the product tableDeclare its key and fields. 02 Insert a known rowUse the sample ID, name and price. 03 Select and group the dataInspect the returned rows and calculated result. 04 Try a supported SQL writeRead back the second product to confirm the change. Before you start Open Connect on a running instance. Copy its complete HTTPS database address and credential. Keep any path in the address unchanged. These examples use Bash and cURL. export OC_URL='' # Load OC_TOKEN from your environment or secret manager. : "${OC_TOKEN:?Set OC_TOKEN before continuing}" The five steps 1. Register a schema A schema declares a table and its columns. Register it once; every surface reads the same declaration. Full reference in the schema reference. curl -X POST "${OC_URL%/}/schemas" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: text/plain" \ --data-binary @- <<'TOML' namespace = "shop" table = "products" primary_key = ["id"] [[columns]] name = "id" ty = "str" required = true [[columns]] name = "name" ty = "str" [[columns]] name = "price" ty = "i64" TOML 2. Insert a row Save one product with a stable ID. Writing the same ID again can replace the row. Use SQL INSERT in step five when you need an insert operation. curl -X POST "${OC_URL%/}/rows/shop.products" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"id":"sku-8842","name":"Carbon Marathon","price":149}' 3. Select it back One endpoint, one JSON field. The response carries a kind so your code can switch on the statement type. curl -X POST "${OC_URL%/}/sql" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"sql":"SELECT id, name, price FROM shop.products WHERE price < 200"}' 4. Group and aggregate Aggregates, GROUP BY and HAVING run in the engine, not in your application. SELECT name, COUNT(*) AS n, AVG(price) AS avg_price FROM shop.products GROUP BY name HAVING COUNT(*) >= 1 ORDER BY avg_price DESC 5. Write with SQL Send this statement through the SQL endpoint from step three. It inserts a second product into the same table; confirm it with SELECT. For a two-table example, see explicit SQL joins. INSERT INTO shop.products (id, name, price) VALUES ('sku-8843', 'Trail Runner', 129); From a PostgreSQL client Use the PostgreSQL connection details shown in Database login to read data with a supported client. The currently offered login is read-only: run the write examples above through HTTPS. Test the queries your client or ORM sends; PostgreSQL protocol support is not a promise of full PostgreSQL behavior. See connect a SQL client. What to read next SQL reference — Every clause that works today, and the ones that do not, with the response shape per statement kind. Constraints — Primary keys, foreign keys and what the engine enforces on write. Materialized views — Precompute a query and keep it current. By industry — Worked models: orders, ledgers, inventory, events. SQL overview Previous Page SQL syntax Choose fields, add useful indexes and read the returned values correctly. --- ## SQL transactions | OriginChainDB docs Canonical source: https://originchaindb.com/docs/transactions SQL SQL transactions A transaction groups supported writes so you can commit or cancel them together. This guide uses the HTTP SQL interface. The currently offered PostgreSQL database login is read-only; do not use these write examples as a promise of PostgreSQL write support. Commit related SQL writes togetherKeep schema changes outside this workflow; DDL may apply immediately and cannot be undone by rollback. 01 Use one SQL sessionGive this logical transaction its own session ID. 02 Begin and run supported operationsKeep the transaction short and inspect statement errors. 03 Commit or roll backA successful buffered statement is not a confirmed commit. 04 Verify the final stateRead the record after the transaction finishes. Before you start Complete the quickstart, then reuse its complete OC_URL and OC_TOKEN from the same instance. The example changes the sample product's price to 1,890 cents. Use a token authorized for that table. Add database identity headers to the request headers when required. The default SQL transaction path is read committed. Read GET /v1/capabilities on your instance for its sql_isolation_levels notes and topology restrictions. HTTP callers supply X-OC-Session-Id. PostgreSQL connections have a separate session and support contract. Do not share a session between concurrent logical transactions. Run one transaction import json import os import uuid from urllib.request import Request, urlopen base = os.environ["OC_URL"].rstrip("/") session_id = str(uuid.uuid4()) headers = { "Authorization": f"Bearer {os.environ['OC_TOKEN']}", "Content-Type": "application/json", "X-OC-Session-Id": session_id, } def sql(statement, params=None): body = {"sql": statement} if params is not None: body["params"] = params request = Request(f"{base}/sql", data=json.dumps(body).encode(), headers=headers) with urlopen(request, timeout=30) as response: return json.load(response) sql("BEGIN") try: sql("UPDATE quickstart.products SET price_cents = $1 WHERE id = $2", [1890, "product-001"]) except Exception: try: sql("ROLLBACK") except Exception: pass # Preserve the original error; report failed cleanup separately. raise # Do not put an automatic retry around this commit. # If its response is lost, reconcile the outcome before repeating a mutation. receipt = sql("COMMIT") print(receipt) print(sql("SELECT id, price_cents FROM quickstart.products WHERE id = $1", ["product-001"])) After a confirmed commit, the final query should return product-001 with price_cents: 1890. Change COMMIT to ROLLBACK to discard the buffered update instead. A successful statement before COMMIT does not prove its write is durable. Understand the boundary Ordinary data writes are buffered until commit. On supported current deployments, reads inside the SQL transaction see its earlier buffered writes. Read committed is not a repeatable snapshot or a general serializable guarantee. Current single-box active/passive commit paths can reject conflicting writes; the same conflict check is not promised for every replication or cross-shard path. DDL is different. Schema changes can apply immediately. PostgreSQL can commit earlier buffered writes at that point; HTTP SQL can keep them pending while applying the schema change. ROLLBACK cannot undo the DDL and can report an applied_at_once refusal even when it discards pending data writes. Keep schema changes outside application transactions. Cross-node behavior depends on the deployed transaction path. Check the instance's capabilities and test the exact topology before depending on a multi-table transaction across shards. Choose an isolation level deliberately Higher isolation remains a scoped preview. On the HTTP SQL interface, BEGIN ISOLATION LEVEL REPEATABLE READ and BEGIN ISOLATION LEVEL SERIALIZABLE use an INSERT VALUES-only bridge: in-transaction SELECT, UPDATE, DELETE, upserts and RETURNING are refused. Serializable also requires one shard; this SQL bridge refuses a RaftQuorum commit. It is unsuitable for a read-modify-write workflow. Use the transaction HTTP endpoints for their supported point-read/write workflow. Database protocol listeners have their own support contracts. PostgreSQL is the currently offered database-login path and remains read-only; MySQL and TDS instructions are historical references. Do not infer wire behavior from the HTTP endpoint or silently fall back to a weaker level. Handle failures by their meaning FailureRecovery Invalid SQL, permissions or a constraint violationRoll back, fix the cause, then begin a new transaction. Retrying unchanged input is not a repair. Confirmed transaction conflict or lost transactionRoll back as appropriate and retry the whole logical transaction with a fresh session ID, fresh reads and bounded backoff. Network failure while COMMIT is in flightThe outcome may be unknown. Inspect application state or a unique operation record before replaying writes. A timeout does not prove rollback. Unsupported topology or isolationUse a supported surface or configuration. Do not retry the same unsupported request. Keep transactions short Open transaction state can expire or be lost during restart or failover. Do not keep a transaction open while waiting for a person, an LLM or another service. Bound its size and handle reported limits. A transaction handle is temporary; it is not an application job ID. For PostgreSQL client behavior, savepoints and multi-statement requests, read PostgreSQL compatibility. For explicit transaction handles and optimistic validation, continue to the transaction API. Query plans Previous Page Transaction API Read records, prepare changes and commit them together on supported instances. --- ## Troubleshooting | OriginChainDB docs Canonical source: https://originchaindb.com/docs/troubleshooting Troubleshooting Use the error and the request you sent to narrow the problem. Check the items below before retrying a write, because a lost response does not prove that the write failed. Keep the status code and X-OC-Trace-Id response header when available. Send these, a redacted request and the time of the failure to support@originchaindb.com. Never send passwords or tokens. Narrow a problem before retryingKeep a redacted request and trace ID; never include passwords or tokens in a support message. 01 Identify the symptomKeep the exact error, timestamp and response status. 02 Find the matching checkSeparate connection, credentials, schema, indexing and capacity issues. 03 Correct the specific causeChange the reported field or setting, not unrelated configuration. 04 Verify with a small operationReconcile an uncertain write before trying it again. 401 unauthorized on every call Check that the request sends Authorization: Bearer and that the token belongs to the selected instance. Use the complete address from Connect. If a token was shown only when created, create a replacement rather than expecting to reveal it again. Never include the token in a support message. Cannot connect to host Copy the complete OC_URL from Connect. Keep any path in that address; do not construct it from an instance name or tenant ID. Check DNS, network access and TLS separately. For a PostgreSQL client, use its separate host, port, username and password. Schema registration returns 400 'unknown column type' Read the field named in the error and compare its ty with the schema types. For example, use str instead of string, and i64 instead of int. A supported vector column type does not automatically populate the vector search index. Schema registration returns 400 'invalid type: string, expected struct' A relation target is an object, not a dotted string. Supply its namespace, table and primary-key field using the structure in schema relations. Validate the manifest before loading rows. [[extractions.fts]] and [[extractions.vector]] blocks ignored These extraction blocks are not part of the schema grammar. Use the separate full-text indexing and vector write endpoints. Reuse the source row ID so your application can open the matching record. Row insert returns 400 type_mismatch Compare the named field with the schema. A JSON number differs from a quoted number, and true differs from "true". Correct the value or intentionally change the schema; do not silently convert source values during a retry. Row insert returns 400 fk_violation The referenced row must exist. Load parent records before dependent records and check that their IDs match. Keep the constraint unless you have deliberately changed the data model. Bulk insert is much slower than expected Use the batch row endpoint instead of one request per row. Choose a bounded batch size, inspect each receipt and respect the request limits of your deployment. A streamed import can still fail or complete only partly. Duplicate rows after a network retry A timeout does not tell you whether a write committed. Look up the intended primary key before retrying. Use an idempotency key only where the endpoint explicitly supports it; it does not make every SQL statement or SDK call safe to replay. See retry handling. HAVING or a window function over a JOIN returns 400 Some clauses work on one table but not in the same query as a join. Check the named limitation in the SQL reference. A useful alternative is to aggregate one side first and then join, if that rewrite keeps the result you need. Vector topk returns 400 dim_mismatch The query embedding must have the same number of dimensions as the stored vectors. If you change embedding models, prepare a new compatible index and re-embed the source content before switching reads. Vector topk returns 400 metric_mismatch Use the distance metric configured for that vector table. Choose the metric recommended by your embedding model, then use it consistently for writes and queries. Do not change it only on the search request. Vector search returns fewer than k hits The index may contain fewer than k matching records. A selective metadata filter can also reduce the candidate set. Check the stored vectors, filter and search settings before increasing k. FTS search returns no hits for words that should match First confirm that the text was indexed under the table and field you are querying. Then test a word you know appears in it. Indexing and query token handling must agree; do not assume a selectable language stemmer or lemmatizer exists on the HTTP endpoint. See full-text support. FTS hits link to rows that don't exist A full-text document ID is not proof that a source row still exists. Your application must keep the separate index and rows consistent. Remove stale index entries and check that new entries use the intended row IDs. Graph neighbors returns empty Check the relation name, direction and source column. Existing rows may need a supported backfill after a relation is added. Follow the relation guide and verify a known linked pair before running a larger traversal. BFS takes a long time / times out Limit both traversal depth and result size. Start with one hop, inspect how many links it returns, and expand only as needed. A graph with many links can grow quickly at each additional hop. 429 rate_limited on legitimate traffic Honor Retry-After when supplied and reduce concurrent requests. Add bounded backoff for operations that are safe to retry. For a large import, use batches and inspect progress rather than sending a burst of individual writes. See rate limits. Replication lag visible in the dashboard Check which endpoint served the read and whether it is a replica. Replication can be asynchronous, so a recent write may not yet appear there. Use the supported primary-read path when your workflow requires the latest committed record; confirm the deployment’s consistency behavior. PITR restore is taking longer than expected Check the restore job status, the selected recovery point and the resources assigned to the destination. Available history and restore time depend on your deployment and backup configuration. A submitted restore is not a completed restore. See recovery checks. Multi-region (in development) Previous Page Errors and safe retries Next Page --- ## Vector search | OriginChainDB docs Canonical source: https://originchaindb.com/docs/vector Vector search Vector search Vector search finds records whose numeric representations are close to a query vector. An embedding model creates those numbers from text or other content. Store and query vectors from the same model, with the same number of values and distance rule. Start with the three-number quickstart, then choose the metric, index and filters your application needs. The vector-table and vector-record APIs are separate interfaces. Recall means the share of relevant matches a search finds. Approximate indexes trade some recall for less search work. The language examples below use earlier client interfaces; check the SDK directory for your installed version. Arrays marked with ... or comments are shortened for display and must be replaced with complete numeric vectors. The three-number quickstart is ready to adapt. From content to similar recordsVector-table and vector-record APIs are separate interfaces; use the contract for your chosen path. 01 Represent the contentGenerate complete embeddings with one chosen model. 02 Store vectors with IDsUse consistent dimensions and the chosen distance metric. 03 Compare a query vectorUse the same model and inspect the ranked matches. 04 Open matching source recordsResolve the returned IDs to content stored separately. 1. Top-k search. Given a query embedding, return the top k rows whose stored embeddings are closest to it. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": [0.011, -0.082, 0.046, /* ... 768 floats ... */], "k": 10, "dim": 768, "metric": "cosine" }' FieldTypeRequiredWhat it is queryfloat[]yesThe query embedding. Length must match the column's dim. kintyesHow many results to return. Typical values: 10, 50, 100. dimintyesThe vector's length. Must match the table's configured dimension. metricstringnoHow "closeness" is measured. Must match what was used at insert time. See distance metric. filterobjectnoMetadata filter. See filter by metadata. modestringno"high_recall" (default) or "fast". See speed vs recall. The HTTP result is an array of { id, score } objects in ranked order. id is the vector ID supplied when writing. If you saved a source row under the same ID, use it to read that row separately; writing a vector does not create the row. [ { "id": "sku-9281", "score": 0.92 }, { "id": "sku-4017", "score": 0.88 }, { "id": "sku-3320", "score": 0.85 }, ... ] Results are ordered by score, highest first. Cosine and dot return similarity scores. L2 and Manhattan return negative distances, so a score closer to zero is a closer match. You do not need to reverse the result order for L2. Wrong dim. If your query vector is 1536 floats but the table was set up for 768, you get a 400 reading vector has 1536 dims but collection "shop.orders" expects 768. There is no dim_mismatch code - the body carries the message, not a token. Wrong metric. Query with a different metric than the table was written under and you get a 409 vector_metric_mismatch, naming both metrics and a rebuild URL. If the collection declares a non-default [vector].distance, contradicting it is refused earlier, with a 400. Empty results. Confirm that the vector write succeeded, the query uses the same collection and index, and its metadata filter matches. The default HNSW write updates the vector and its graph together. A short result list can also reflect filtering, access rules or approximate search; it is not a count of every eligible record. 2. Filter by metadata. Restrict the search to vectors whose metadata matches a filter. Useful for things like "find similar products but only in the shoes category". curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": [/* 768 floats */], "k": 10, "dim": 768, "metric": "cosine", "filter": { "category": "running-shoes" } }' Filters compare the metadata saved with each vector. The search strategy depends on the index; a selective filter may require more candidate checks or a wider search. Measure latency and result quality with the filters your application will use. Filtering on a field you didn't store. The filter looks at the metadata object you passed at insert time - not at the row's other columns. If you want to filter on a column, include it in metadata. Range and typed conditions. The simple filter map supports equality. The separate filter_expr field supports typed conditions on eligible deployments. Do not combine it with a non-empty filter; check the endpoint contract. Filtering a short result list in your application does not find candidates the search omitted. Fewer than k hits. The request can return fewer matches because of the available data, filter, access rules or search limits. Check the collection and metadata before treating the returned count as exhaustive. 3. Distance metric. Picks the math used to compare two vectors. You send the metric on each request - on the write and on the search - and the two have to use the same one. A collection can pin it once with [vector].distance on the schema, which then fills in an omitted metric and refuses one that contradicts it. MetricUse it when cosineDefault for text. Use this with OpenAI, Cohere, Voyage, BGE, E5, and most other text embedding models. Looks at the angle between two vectors - magnitude doesn't matter. dotUse when your vectors are already unit-normalised (length 1). Slightly cheaper than cosine for the same result. Some image-embedding pipelines emit normalised vectors. l2Use when the absolute distance between vectors matters - some image-feature pipelines, certain audio embeddings, and a few specialty research models. manhattanSame as L2 but uses absolute differences instead of squared ones. More forgiving of one or two big-difference dimensions. Niche. Use the metric recommended by your embedding model. The query and stored vectors must use a compatible metric and dimension. 4. Speed vs recall. Approximate nearest-neighbor search examines candidates rather than comparing every vector. The mode field controls how widely HNSW searches. Wider searches may find more relevant results but take longer. # Add "mode" to the topk body. "high_recall" (default) or "fast". curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.products/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": [/* 768 floats */], "k": 10, "dim": 768, "metric": "cosine", "mode": "fast" }' ModeWhat you getUse when high_recall (default)Searches a wider set of candidates.Start here, then measure missed matches and latency. fastSearches fewer candidates and may miss more relevant matches.Use after checking that the quality and latency suit your workload. "Recall" measures how many of the true nearest neighbors the search found. Both modes sort the returned candidates by score; neither guarantees that it found every true top-k neighbor. Compare them against known relevant matches or an exact baseline for your data. 5. Index choice. OriginChainDB supports several different index types for vector data. Most users should stick with the default (HNSW). The other types are for very large or memory-constrained corpora. IndexPick when HNSW (default)Start with graph-based nearest-neighbor search; measure memory, recall and latency on your data. IVFGroups vectors into cells and searches selected cells. Requires trained centroids. See IVF reference. IVF-PQUses cells and compressed vector codes. Evaluate memory savings and missed matches together. See IVF-PQ reference. Binary quantizationStores compact sign bits for cosine search. Measure total index memory and retrieval quality. See Quantization reference. Sparse vectorsFor models like SPLADE / uniCOIL that emit sparse vectors instead of dense ones. The index is picked per request, not on the schema - index is a field on both the write and the query body, and the manifest has no index key. See Index kinds for the accepted values. 6. Examples. Every operation below is shown in cURL, Python, TypeScript and Go. Where an SDK does not wrap an endpoint the tab says so and shows the raw call instead. Insert vectors. id, embedding and dim are required. metadata is a free-form JSON object stored alongside the vector — it is what filtering reads later, so put anything you may want to narrow on in there at write time. A successful write to the default HNSW index saves the embedding and graph update together; it does not require a separate index-build step. This does not combine a row write or full-text write into the same transaction. For replica and recovery behavior, read durability and recovery. Single insert. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.orders/put" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "01JTRX9KQ3YH8K2WMX0F5JZAB7", "embedding": [0.0124, -0.0883, 0.0451], "dim": 3, "metric": "cosine", "metadata": { "status": "paid", "customer": "01JTRX1H4Q9P0N2WMX0F5JZ001" } }' # → 201 Created, empty body Bulk insert. Bulk is the right shape for ingest: it builds the graph in one pass and writes one log frame for the whole batch. dim, metric, quantization and index live on the envelope; each item carries only id, embedding and metadata. The body-size limit is lifted on this route only. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.orders/put_bulk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "dim": 768, "metric": "cosine", "vectors": [ { "id": "01JTRX9KQ3YH8K2WMX0F5JZAB7", "embedding": [/* 768 floats */], "metadata": { "status": "paid" } }, { "id": "01JTRX9KQ3YH8K2WMX0F5JZAB8", "embedding": [/* 768 floats */], "metadata": { "status": "refunded" } } ] }' { "inserted": 2, "elapsed_ms": 14 } At most 100,000 vectors per call — over that the engine answers 413, not 400. An empty vectors array is a 200 with inserted: 0 and no write. Duplicate ids inside one batch are last-writer-wins. The whole batch is one atomic write. Single insert returns 201 Created with an empty body — don't try to parse it. Sparse vectors. Learned-sparse embeddings go to POST /vector/:table/put_sparse with { id, indices, values, dim, metadata? }, and are queried with POST /vector/:table/topk_sparse. indices and values must be the same length, every index must be inside dim, and non-finite values are refused. No SDK wraps the sparse endpoints today. Query — top-k. query, k and dim are required; everything else has a default. The field is k — there is no top_k alias. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.orders/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": [0.0124, -0.0883, 0.0451], "k": 5, "dim": 3, "metric": "cosine" }' [ { "id": "01JTRX9KQ3YH8K2WMX0F5JZAB7", "score": 0.9421 }, { "id": "01JTRX9KQ3YH8K2WMX0F5JZAB8", "score": 0.9187 }, { "id": "01JTRX9KQ3YH8K2WMX0F5JZAB9", "score": 0.8804 } ] A bare JSON array, not an envelope — no hits wrapper and no total count. Sorted by score descending, and larger always means closer: for l2 and manhattan the distance is returned negated so the ordering convention holds across every metric. k: 0 returns [] without touching storage. The ceiling on k is 4096 by default; above it you get a 400. Query modes — fast vs high_recall. mode is the one recall/latency knob exposed on the API. It sets the search beam width and nothing else — the build-time graph parameters are unaffected. modeBeam widthTradeoff "high_recall"1200Searches more candidates; evaluate recall and latency on your data. "fast"300Searches fewer candidates; relevant matches may be missed. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.orders/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": [/* 768 floats */], "k": 10, "dim": 768, "metric": "cosine", "mode": "fast" }' Omitting mode gives you high_recall. That is the safe default and the right one for first-pass retrieval. The value is case-sensitive. An unknown value is a hard 400: unknown `mode` "FAST": expected one of "fast", "high_recall". mode applies to the default graph index only. On ivf and ivf_pq queries it is accepted and then ignored — those paths have no beam width. Use nprobe there instead. Measure recall and latency on your own corpus. A preset does not promise a particular retrieval percentage or response time. Seeing what a query actually did. POST /vector/:table/topk_explain returns { hits, config }. The configuration identifies the metric, dimension and selected index. HNSW includes beam settings; IVF and IVF-PQ include cell-probing settings. This endpoint runs a search, so it is not a free configuration lookup. The current endpoint follows the selected index and filter settings, and can report completeness for eligible filtered requests. See the explain endpoint for fields and deployment restrictions. Metadata filtering. filter is a flat equality map against metadata saved with the vector. Every supplied key must match; this field does not accept query operators. For typed conditions, use the separate filter_expr contract where supported. Do not send both a non-empty filter and filter_expr. For eligible filtered requests, require_complete: true returns 422 filtered_search_incomplete instead of an underfilled answer. This is not a guarantee of exact nearest-neighbor ranking. Typed filters and completeness options have caller and topology restrictions; review the top-k API. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.orders/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": [/* 768 floats */], "k": 10, "dim": 768, "metric": "cosine", "filter": { "status": "paid" } }' Values are compared with strict JSON equality, so 1 does not match "1" and true does not match "true". A record that is missing a key named in the filter is rejected, not treated as null. A filtered query can return fewer than k hits. On the default graph index, filtering is a post-filter: the engine searches for k × 4 candidates and then drops the ones that don't match. If your filter is highly selective, most of the over-fetched set is discarded and you get back fewer than k results — even when more matching vectors exist. Ask for a larger k than you need when you filter narrowly. Filter is silently ignored on ivf_pq. A filter sent with "index": "ivf_pq" is not applied, and the request still returns 200 with unfiltered results. This is the sharpest edge on this page: filter and IVF-PQ do not compose today. Filter on the default index, or apply the predicate yourself after the hits come back. On "index": "ivf" the filter is honoured, and applied inside each cell scan before scoring. Index kinds. index appears on both the write and the query body, and the two must agree — a vector written under one index kind is not visible to a query using another. Omitting it everywhere is the common and correct choice. indexWhat it is "hnsw"The default. A navigable small-world graph, built incrementally on every insert. Build parameters are fixed: 16 neighbours per node (32 at the base layer) and a construction beam of 200. No setup, no training, no minimum corpus. This is what you want unless you have measured a reason otherwise. "ivf"Inverted file: vectors are assigned to the nearest of K centroids, and a query scans only nprobe of those cells. Requires centroids to be installed or trained first. Filters are applied inside the cell scan. "ivf_pq"Inverted file plus product quantization — each vector is stored as a short code instead of full floats. This is the memory-footprint option for large corpora, and the one the presets build. Approximate, not exact. HNSW, IVF and IVF-PQ use approximate nearest-neighbor search. They can miss a true nearest neighbor. Increasing the search width or reranking returned candidates can improve results, but reranking cannot recover a candidate the search never returned. If your application requires exact results, verify that its chosen API and deployment explicitly support that requirement. Building an IVF-PQ index from a preset. IVF-PQ has a lot of knobs — partition count, subspace count, code width. Rather than expose them, the engine ships exactly two named presets and derives every parameter from your corpus. preset is the only required field. curl -X POST \ "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.orders/create-ivf-pq-index" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "preset": "compressed" }' Response — the config it chose. { "trained": true, "installed": true, "preset": "compressed", "partitions": 1024, "pq_m": 48, "pq_bits": 8, "keep_raw": false, "dim": 768, "training_corpus_size": 50000 } The optional seed field (default 0) controls training reproducibility. The endpoint also accepts drop_raw_vectors, which defaults to false. Setting it to true with the compressed preset irreversibly discards the original vectors; retain a recoverable source before considering it. The preset selects partitions, subspace count and code width. Build then query — no re-insert needed. On supported configurations, this endpoint trains and populates IVF-PQ cells from stored vectors. Inspect the successful build receipt before querying with index: "ivf_pq"; an interrupted build is not a completed index. Raw vectors are retained by default, including with the compressed preset. Lower-level IVF installation has its own population and topology rules, described below. How each preset resolves. Both presets pick the same partition count and 8-bit code width. They differ in how finely the vector is subdivided and whether queries use retained raw vectors for refinement. Raw-vector retention is a separate setting. Parameterhigh_recallcompressed Target sub-vector width816 pq_m (subspaces)Divisor of dim, capped at 64, targeting width 8.Divisor of dim, capped at 64, targeting width 16. pq_bits88 keep_rawtruefalse partitions4 × √N, rounded to a power of two and clamped to [64, 65536].Same formula. Because pq_m must divide dim and is capped at 64, the two presets converge at high dimensionality. Worked from the real formula: dimhigh_recall pq_mcompressed pq_mCode bytes / vector 12816816 B vs 8 B 768644864 B vs 48 B 1536646464 B vs 64 B At 1536 dimensions both presets reach the 64-subspace cap. That does not imply identical query behavior: high_recall permits refinement against retained raw vectors, while compressed uses the compressed representation. Raw vectors and refinement. keep_raw describes whether the query path can refine candidate scores using raw vectors. raw_vectors_retained describes whether those vectors remain stored. A compressed index retains them by default; only the explicit drop_raw_vectors: true option discards them. Read both fields in the build response. Which to pick. Start with the default index and measure its memory, latency and missed matches. Evaluate compressed when smaller query representations suit the workload. Do not count raw-vector storage as removed unless you explicitly discard it. Evaluate high_recall when refinement improves the returned candidates enough to justify its extra work. Refinement cannot recover candidates that the initial search missed. Querying the built index. Pass "index": "ivf_pq" and, optionally, nprobe — the number of cells to visit. curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.orders/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": [/* 768 floats */], "k": 20, "dim": 768, "metric": "cosine", "index": "ivf_pq", "nprobe": 16 }' The default nprobe grows with the square root of the partition count, subject to minimum and maximum bounds. Inspect explain to see the resolved value. A larger value visits more cells and does more work. Valid range is 1 to 256. 0 is a 400 (nprobe must be >= 1); above 256 is a 400 naming the cap. nprobe is ignored on the default graph index — it only means something for ivf and ivf_pq. Check your installed SDK version for nprobe and refinement options. Use the HTTP endpoint directly when the client does not expose the field. The minimum-corpus rule. Training refuses to run on a corpus too small to populate its partitions: you need at least four vectors per partition. Because the partition count is floored at 64, that means a practical floor of 256 vectors — and far more once 4 × √N pushes the partition count up. { "error": "not enough vectors to build a Compressed index: 1024 partitions\n need >=4*K = 4096 vectors, found 900" } Building on an empty table is a separate 400: no vectors stored for this table; put vectors before building an index. Note that the preset name is echoed in the error in its internal capitalised form (Compressed, HighRecall) rather than the wire form you sent. The lower-level centroid endpoints. Plain IVF uses separate training, installation and inspection endpoints. The worked training example explains the minimum corpus size and response fields. TaskEndpoint suffix Train and install from stored vectorsPOST /train-and-install-centroids Install centroids trained elsewherePOST /install-centroids Inspect a bounded centroid previewGET /centroids Inspect cell imbalanceGET /ivf-rebalance-status Append the suffix to the collection's /vector/:table route. Training needs at least four stored vectors per requested partition. Installation replaces the existing centroid matrix. On supported single-writer paths it can populate stored-vector postings; replicated paths can report populate_skipped. Inspect populated and any skip reason before assuming that every stored vector is searchable through IVF. Hybrid dense + sparse. POST /vector/:table/topk_hybrid runs a dense and a sparse query together and fuses the two rankings server-side with Reciprocal Rank Fusion. Fields: dense_query, dense_dim, sparse_query_indices, sparse_query_values, sparse_dim, k, plus optional dense_metric, dense_mode, rrf_k (default 60), candidates and filter. The returned score is a fused rank score, not a distance — it is not comparable to the scores from a single-mode query. Check your SDK version for a hybrid helper, or call the HTTP endpoint directly. Delete. # Single - idempotent, 200 with {"deleted": false} when the id is absent curl -X DELETE \ "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.orders/01JTRX9KQ3YH8K2WMX0F5JZAB7" \ -H "Authorization: Bearer $OC_TOKEN" # Bulk - at most 10,000 ids per call curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/vector/shop.orders/delete-bulk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "ids": ["01JTRX...AB7", "01JTRX...AB8"] }' Single delete is idempotent: deleting an id that isn't there is a 200 with { "deleted": false }, never a 404. Bulk delete caps at 10,000 ids and returns { deleted_count, missing_count }. Both accept an optional index selector (hnsw by default) — it must match the index the vector was written under. Vector ids are capped at 1024 characters and may not be empty. Limits and gotchas. LimitValue Max k per query4096 Max vectors per bulk insert100,000 Max ids per bulk delete10,000 Max nprobe256 Max IVF partitions65,536 Max PQ subspaces (pq_m)64 Vectors sampled for index training1,000,000 Max vector id length1024 chars Dimensionality> 0, no upper bound Metric and index are per-request - and only metric is checked. index is per-request and recorded nowhere. metric is per-request too, but it is checked: every HNSW graph is stamped with the metric it was built under, so writing with cosine and querying with l2 is refused with a 409 vector_metric_mismatch. An index built before that stamp shipped carries none and still serves the mismatch behind a 200, until the next write stamps it. Same for index: writing under the default graph index and then querying index: "ivf_pq" finds nothing at all, unless the preset build populated those cells. Pick one metric and one index kind per collection and hold them constant in your own code. Training and populate sample at most one million vectors. A preset build reads up to 1,000,000 vectors, both for training and for populating cells. On a collection larger than that, rows beyond the first million are not written into the IVF-PQ index by the build and will not be found by an ivf_pq query until they are written again under that index. Back-pressure and quota. A 429 response means the request was limited; follow Retry-After when supplied. A 402 can indicate an exhausted vector quota or a missing instance capability. Check your configuration and the response details. After a failed or interrupted bulk write, confirm which records were saved before retrying. Quantization on the write path. Separately from IVF-PQ, a write can carry quantization: "none" (default), "scalar", "binary" or "pq". Quantization reduces the vector payload at some cost in precision. Binary quantization supports cosine only; dot, L2 and Manhattan combinations are rejected with 422 quantization_metric_unsound. Measure complete index memory and retrieval quality before changing representation. Where this lives in the dashboard. The current console guide includes a Vector input in Workbench and vector views in Data Explorer. Enter an embedding with the same dimension and metric as the stored vectors, then inspect the matching records. See Run queries in Workbench. The console screenshots use local sample data. Live search and index-management controls depend on the instance and its reported capabilities; a visible preview control does not establish that the operation is enabled on your deployment. SQL use cases Previous Page Your first vector search Next Page --- ## Vector models by industry | OriginChainDB docs Canonical source: https://originchaindb.com/docs/vector/industries Vector search Vector models by industry Vector search can find similar descriptions, support tickets, passages or media. These examples pair that search with the source record and any relevant filters. Generate compatible embeddings first; the examples do not create them automatically. Suggest related answers from support historyA similar ticket is a candidate to review, not proof that the same solution applies. 01 Prepare resolved ticketsKeep the original text, resolution and record ID. 02 Embed the history and new issueUse the same model for stored and query text. 03 Search the relevant historyApply supported restrictions such as product or resolved status. 04 Review the suggested answerOpen the source ticket and confirm it fits the current issue. Retail: search that understands the ask A shopper types something no keyword index will match, and the catalog still has the right answer. Nearest products, within the shopper's constraints Include the supported price or category filter in the request. A filtered approximate search can return fewer than the requested number of results; inspect the actual matches. POST /v1/tenants/:t/vector/shop.products/topk { "query": [...], "k": 10, "dim": 768, "metric": "cosine" } Pair it with keywords Vectors are strong on meaning and weak on exact terms - a model number, a brand. Run both and merge; the full-text side is the search API. { "query": { "match": { "name": "carbon marathon" } } } Support: deflect the ticket before it is filed The customer describes a problem in their words. The answer already exists, written in someone else's. Nearest resolved tickets Embed the draft as it is typed and search resolved history; a good match becomes a suggestion instead of a ticket. POST /v1/tenants/:t/vector/support.tickets/topk the two surfaces answer together Nearest-neighbour finds the ones that mean the same thing; the suggester fixes a misspelled product name before either search runs. Legal and research: retrieval for grounded answers The retrieval half of RAG. The quality ceiling of the answer is set here, not in the model. The passages worth sending Chunk the documents, embed the chunks, and retrieve the few that actually bear on the question. POST /v1/tenants/:t/vector/kb.chunks/topk keep the citation Store the source id and offset on the chunk row. Retrieval then returns something a reader can verify, which is the difference between an answer and a claim. RAG guide. Media: finding the near-duplicates Not identical files, which hashing finds, but the same thing re-encoded, cropped or re-uploaded. Neighbours above a similarity threshold Search each new asset against the library and treat anything very close as a candidate duplicate for review. POST /v1/tenants/:t/vector/media.assets/topk What these have in common Keep source records and vectors aligned. Explicit vector writes are separate from row writes. Regenerate embeddings when their source changes. Check filtered results. Use supported filters and expect fewer than k matches when the index or filter cannot supply k candidates. Meaning and words are different questions. The strongest results usually come from running both and merging. Start from zero — Declare a column, write a vector, search it. Make it fit — Quantization and index choice as the corpus grows. Vector compression Previous Page Graph overview Next Page --- ## IVF vector index. | OriginChainDB docs Canonical source: https://originchaindb.com/docs/vector/ivf Vector search IVF vector index. An inverted file (IVF) index groups vectors around representative points called centroids. A query searches a selection of those groups instead of comparing every vector. This can reduce work, but it can also miss relevant neighbors. Search a selection of vector groupsSearching fewer groups can reduce work but miss relevant neighbors. 01 Train representative groupsUse enough stored vectors to learn the requested centroids. 02 Populate the indexCheck that vectors were assigned to the installed groups. 03 Probe selected groupsSet the supported nprobe value for the query. 04 Compare with exact searchMeasure missed matches and query time on your test set. The IVF pipeline. Train: use a representative sample to choose the centroids. Assign: associate each stored vector with its nearest centroid. Search: compare the query with a chosen number of groups. Measure build time, memory and search quality on your data. This guide does not establish a fixed dataset capacity or build time. IVF is not declared in the manifest. The vector-table API configures IVF through its runtime administration calls. Do not add invented index or quantization keys to the schema manifest. The optional vector declaration below describes the dimension and distance rule. Check the schema reference and the endpoint contract before installing an index. # manifest.toml — a 768-dim collection. Nothing here selects an index. [vector] dim = 768 # required distance = "cosine" # cosine | l2 | dot | manhattan | l1 Install centroids (admin). This example assumes an existing ivf_demo collection with at least 256 three-dimensional vectors stored using the cosine metric. One vector is not enough: training requires at least four vectors per partition, and this request asks for 64 partitions. Use the vector-write pattern to load your representative dataset first. Use explicit endpoint settings supplied for your deployment; do not derive them by editing OC_URL. See API connection setup. curl --fail-with-body -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/vector/ivf_demo/train-and-install-centroids" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"partitions":64,"max_iterations":25,"seed":42}' Check trained, installed, dim, populated and any populate_skipped reason. Supported single-writer installations populate postings from stored vectors; a replicated configuration can require a separate supported population step. See the training walkthrough. The nprobe knob. nprobe controls how many groups a query searches. A larger value usually examines more candidates, which can improve recall at the cost of more work. Recall means the share of relevant nearest neighbors that the approximate search finds. Compare several values against exact search on a test set. Choose the smallest value that meets your quality requirement. curl --fail-with-body -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/vector/ivf_demo/topk" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"query":[0.1,0.2,0.3],"dim":3,"metric":"cosine","index":"ivf","k":10,"nprobe":4}' index: "ivf" selects the trained index. Omitting it selects the default index, so nprobe would not tune the IVF search. The query dimension and metric must match the data you loaded. When to pick IVF over HNSW. Consider IVF when its measured memory and search behavior suit your dataset better than HNSW. HNSW is a graph-based index that follows links between nearby vectors. Neither has a universal size threshold. Test the same queries, filters and update workload with each supported index. For compressed vectors, continue to IVF-PQ. Vector record API Previous Page IVF-PQ indexes Next Page --- ## IVF-PQ (residualised). | OriginChainDB docs Canonical source: https://originchaindb.com/docs/vector/ivf-pq Vector search IVF-PQ (residualised). IVF-PQ combines grouped search with compressed vectors. IVF selects groups of candidates; product quantization (PQ) represents each vector using short codes. The residual form encodes a vector’s difference from its group centroid. Compare compressed differences within vector groupsShort PQ codes approximate vectors; their size alone is not total database memory usage. 01 Choose the vector’s groupFind its representative centroid. 02 Calculate the remaining differenceRepresent what the centroid does not capture. 03 Store short PQ codesEncode that difference with the trained codebook. 04 Estimate candidate distancesCheck approximate matches against an exact-search baseline. Why residualised matters. The centroid already represents the group’s rough location. Encoding only the remaining difference can use the compressed codes more effectively. At query time, lookup tables estimate distances from those codes. The result is approximate, so validate which neighbors it returns. Memory math. Count the actual codes and all supporting data. For example, 128 float32 values use 512 bytes. Sixteen 8-bit PQ codes use 16 bytes for the codes alone: a 32-fold reduction for that part, before codebooks, IDs, centroids and other index overhead. Do not use the code-size ratio as a guarantee of total database memory savings. Recall floor. Test recall against exact nearest-neighbor results from the same dataset. Change the number of probed groups and compression settings, then compare both missed matches and query time. A small synthetic test does not establish a quality floor for your production data. Measure your workload There is no dataset-size or throughput guarantee in this guide. Capacity depends on vector dimensions, record metadata, index overhead, available resources and the workload. Measure a representative sample before planning a larger deployment. Start with IVF setup and quantization choices. IVF indexes Previous Page Vector compression Next Page --- ## Vector quantization. | OriginChainDB docs Canonical source: https://originchaindb.com/docs/vector/quantization Vector search Vector quantization. Quantization stores vectors in a smaller representation. It can reduce memory, but the search may lose some precision. Compare compressed results with an uncompressed baseline before choosing a configuration. Measure the cost of smaller vectorsUse only supported metric and compression combinations; keep raw vectors unless you deliberately choose otherwise. 01 Measure an uncompressed baselineRecord memory, query time and nearest-neighbor results. 02 Choose supported compressionCheck binary or PQ options against your metric and deployment. 03 Build from representative dataVerify the installed configuration and retained-vector setting. 04 Compare quality and total memoryInclude index overhead and missed neighbors in the decision. The trade table. RepresentationWhat changesWhat to measure Float32Keeps each coordinate as a 32-bit value.Baseline memory and result quality. BinaryStores a compact bit representation.Missed neighbors and any reranking cost. Product quantization (PQ)Stores short codes for parts of a vector.Codebook overhead, recall and update cost. IVF-PQCombines grouped search with compressed residuals.Group probing, recall and total index memory. Check your deployed capabilities before selecting a representation. Binary quantization is supported with cosine; incompatible dot, L2 or Manhattan combinations are refused. Raw-code size is not total database memory. Pick one at install. Use the documented runtime configuration for the vector collection. The schema’s dimension and distance declarations are separate from compression settings. A made-up manifest key does not configure an index. Confirm the installed index configuration before comparing query results. Train a PQ codebook. A codebook is a learned set of representative vector parts. Train it with vectors that resemble the records you will search. Use the documented IVF-PQ build endpoint; there is no install-pq request in this guide's API contract. Prepare a sufficiently large stored corpus first; the three-value quickstart alone is not a training dataset. With the explicit endpoint settings from API authentication, the request is: curl --fail-with-body -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/vector/embeddings/create-ivf-pq-index" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ -d '{"preset":"compressed","seed":42,"drop_raw_vectors":false}' This trains and installs a compressed index from the existing embeddings collection on a supported deployment. Check trained, installed and raw_vectors_retained in the response. The request keeps the original vectors. Setting drop_raw_vectors: true is an irreversible, separate choice; read the build API before using it. Memory math. At 128 dimensions, float32 coordinates use 512 bytes per vector. A 128-bit binary representation uses 16 bytes. Sixteen 8-bit PQ codes also use 16 bytes for the codes alone. Total memory includes codebooks, identifiers, centroids and index structures. Measure that total rather than quoting the raw-code ratio as database-wide savings. Continue with IVF or vector search. IVF-PQ indexes Previous Page Vector search use cases Next Page --- ## Run your first vector search | OriginChainDB docs Canonical source: https://originchaindb.com/docs/vector/quickstart Vector search Run your first vector search Store a vector containing three numbers, then find it with a similar query. These small coordinates make the request easy to inspect; they are a test fixture, not a real text embedding. Find one three-number test vectorThese coordinates are a test fixture, not an embedding that understands text. 01 Connect to the test collectionUse the complete instance address and required credentials. 02 Write item-1Store three values with the example dimension and metric. 03 Send a similar query vectorKeep the same dimension and metric. 04 Find item-1 in the resultA vector write does not create a source table row. 1. Connect This Bash example uses a new vector-table name, vector_demo. It demonstrates the API with three numbers; these are test coordinates, not a useful text embedding. Add database identity headers when required. export OC_BASE_URL="https://YOUR_INSTANCE_HOST" export OC_TENANT="YOUR_TENANT_ID" # Load OC_BEARER from your secret manager. : "${OC_BEARER:?Set OC_BEARER first}" 2. Write the vector curl --fail-with-body -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/vector/vector_demo/put" \ -H "Authorization: Bearer $OC_BEARER" -H "Content-Type: application/json" \ -d '{"id":"item-1","embedding":[0.1,0.2,0.3],"dim":3,"metric":"cosine"}' Use embedding for a write and set dim to the exact number of values. The first write establishes the vector table’s dimension and metric. Reusing an ID replaces its vector. This call does not create a source row. 3. Search curl --fail-with-body -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/vector/vector_demo/topk" \ -H "Authorization: Bearer $OC_BEARER" -H "Content-Type: application/json" \ -d '{"query":[0.1,0.2,0.3],"dim":3,"k":5,"metric":"cosine"}' The result contains item-1. Use query when searching and the same dimension and metric as the stored vectors. A declared dimension of 768 with only three values is an invalid request. 4. Use real embeddings Generate the full vector using an embedding model, then search with the same model. Keep IDs aligned with your source records. Use saved embedders and scheduled runs for table columns, or compute vectors in your application. The vector-record API is a separate interface with index names and namespaces. Its request shape is not interchangeable with this vector-table API. Next: dimensions, metrics and filtering, worked examples or retrieval-augmented generation. Vector search overview Previous Page Vector schemas Keep embeddings consistent and connect matches back to their source records. --- ## Vector record API | OriginChainDB docs Canonical source: https://originchaindb.com/docs/vector/records Vector search Vector record API Use the vector-record API to create a named index, store records and search within a namespace. A namespace separates groups of records inside the index. This API requires a supported dedicated deployment and the appropriate vector grants. It is separate from the vector-table API and is not available on Free or multi-store sharded deployments. Search records inside a named vector indexThis dedicated-deployment API is separate from vector tables and is unavailable on Free. 01 Create or select the indexCheck its dimension, metric and required grants. 02 Choose a namespaceRecord IDs are scoped within this group. 03 Upsert compatible recordsProvide the representations required by the index and inspect the receipt. 04 Search and fetch known IDsVerify matching records within the same namespace. Indexes, namespaces and credentials This API stores records in vector indexes and namespaces. It is separate from the vector-table API, where vectors are associated with SQL row IDs. A write through one API does not automatically populate the other. Use the instance HTTPS endpoint, tenant ID and a bearer credential with an authenticated subject and the required vector grants. Read, write, delete and manage permissions are distinct. Creating an index requires tenant-level manage permission. A generic instance credential without the required subject or grant can be refused; ask your administrator to provision an appropriate credential. Set the server environment values OC_ENDPOINT, OC_TENANT, OC_TOKEN and, after creating or selecting an index, OC_INDEX_ID. Use the returned index identity in requests. Record IDs are scoped to their namespace. A newly created index includes the __default__ namespace. Create a small index Send this JSON body to POST /v1/tenants/:tenant/vector-indexes. The example uses three-dimensional vectors for readability; choose the dimension produced by your embedding model. { "name": "catalog-vectors", "dimension": 3, "metric": "cosine" } The response describes the index, including index_id, name, state, dimension and metric. Dense metric values are cosine, dot, l2 and manhattan. Enable sparse storage with sparse: true when needed. Generated-embedding index configuration is not available through this API. Upsert records Upsert means add a record if its ID is new, or update the record with the same ID. Use a small test namespace first. Send this body to POST /v1/tenants/:tenant/vector-indexes/:index/records/upsert. Each record needs an ID and the representations required by its index. Supplied dense values must match the index dimension. { "namespace": "__default__", "records": [ { "id": "item-1", "values": [ 1, 0, 0 ], "metadata": { "category": "notebook" } }, { "id": "item-2", "values": [ 0.8, 0.2, 0 ], "metadata": { "category": "planner" } } ] } Records can contain values, sparse_values, metadata, and text for configured text fields. Sparse values use an indices array and a matching values array. The response includes upserted_count, namespace_created and a write receipt. Fetch by ID Fetch is a POST request, with projection flags specifying which data to return. curl "$OC_ENDPOINT/v1/tenants/$OC_TENANT/vector-indexes/$OC_INDEX_ID/records/fetch" \ -H "Authorization: Bearer $OC_TOKEN" \ -H "Content-Type: application/json" \ --data '{"namespace":"__default__","ids":["item-1"],"include_metadata":true}' { "namespace": "__default__", "ids": [ "item-1", "item-2" ], "include_values": true, "include_metadata": true } The response’s records object is keyed by record ID; missing lists requested IDs not returned. Record details include a revision token, and the response includes its namespace and read position. A revision token identifies the version you read. Send it with a supported conditional update when you want the write rejected if someone else has changed the record. Search the index Send this body to POST /v1/tenants/:tenant/vector-indexes/:index/search. Search is a sibling of records, not a records/query route. { "namespace": "__default__", "mode": "semantic", "k": 5, "dense": { "vector": [ 1, 0, 0 ] }, "include_metadata": true } semantic compares vector meaning, lexical matches text, and hybrid combines the two. dense_with_text_filter narrows vector search with a text condition. Each mode needs the corresponding index configuration. Dense queries accept a vector or a record ID; sparse queries use indices and values. Lexical queries use a configured field and query text. Inspect hits, returned, completeness, the individual legs and the reported read position. Requesting a number of results does not guarantee that many matches. Dense quality defaults to approximate high_recall; fast and exact are additional modes subject to caller eligibility. Search does not use cursors or paginate. Search currently refuses expected_generation and the body field timeout_ms. Stored-text projection is unavailable, and queries with a lexical leg cannot return projected values or metadata through this search route. Some plans also refuse filters or require_complete when they cannot enforce them; handle the named refusal instead of dropping the option silently. Update or delete selected IDs Use records/update to update one record by ID. Metadata merge, replacement and removal are separate fields; select the operation you intend. Conditional writes accept if_revision_token. { "namespace": "__default__", "id": "item-1", "metadata_merge": { "category": "journal" } } Use records/delete to remove specified IDs. Its response includes counts of deleted and missing IDs plus a receipt. This example removes only item-2. { "namespace": "__default__", "ids": [ "item-2" ] } Route reference Let T mean /v1/tenants/:tenant/vector-indexes and I mean T/:index. Send JSON bodies on POST and PATCH requests. The table lists the main request fields; unknown or unsupported fields can be refused. Method and routeRequest fieldsResult or behavior POST Tname; dimension, metric, sparse, text_fields, visibility_fields, deletion_protection, tags, identifier_profileCreate and describe an index. Some options are immutable after creation. POST T/listname, prefix, limit, cursorindexes and optional next_cursor, limited to accessible indexes. GET INo bodyIndex description. PATCH Ideletion_protection, tagsConfigure the mutable index settings. DELETE INo bodyDelete the index; deletion protection can refuse it. POST I/records/upsertnamespace, recordsWrite supplied records; count and receipt. POST I/records/fetchnamespace, ids; include_values, include_sparse, include_metadata, metadata_fields, text_fieldsRecords keyed by ID, missing IDs and receipt_position. POST I/records/fetch-by-filternamespace and one nonempty filter or filter_expr; limit, cursor, consistency, projection fieldsMatching records and optional next_cursor. POST I/records/list-idsnamespace; prefix, limit, cursor, consistencyIDs and optional next_cursor. POST I/records/countnamespace; filter or filter_exprCount and namespace. POST I/records/updatenamespace, id; metadata_merge, metadata_replace, metadata_remove, values, sparse_values, text_set, text_remove, if_revision_tokenUpdate one ID; receipt. POST I/records/deletenamespace, ids. The separate delete-all form uses all, confirm and optionally dry_run.Delete selected IDs, or explicitly clear a namespace. POST I/namespaces/createname; declared_capacityCreate a named namespace. POST I/namespaces/describename; include_deletingNamespace state, counts and position. POST I/namespaces/listprefix, limit, cursor, include_deletingnamespaces and optional next_cursor. POST I/namespaces/configurename; declared_capacityChange declared capacity. POST I/namespaces/deletename, confirmDelete a named namespace; confirm must match its name. The default namespace cannot be deleted. GET I/statsNo bodyIndex and namespace statistics. POST I/searchnamespace, mode, k; dense, sparse, lexical, fusion, filter or filter_expr, supported projection, require_completeRanked hits, completeness and read position; some options are refused for particular plans. For paged reads, pass the returned next_cursor unchanged with the same request scope. Consistency is read_committed; snapshot pagination is unavailable. Search has no next cursor. Namespace-wide deletion requires an explicit confirmation equal to the namespace name; review a dry run before an intended bulk removal. Dry runs are supported for the delete-all form, not for upsert, update by ID, delete by IDs or namespace deletion. Record writes refuse expected_generation; use the record’s if_revision_token for supported conditional writes. Availability, permissions and errors 501 with reason record_api_not_enabled: this engine has not enabled the API. 501 unsupported_topology: the requested deployment topology is not supported. The record API does not support tenants spread across multiple engine stores. 403 key_scope_insufficient or permission_denied: use a credential with the required identity and grants. 404 index_not_found or namespace_not_found: check the identity and your access. These answers do not disclose whether an inaccessible resource exists. 403 record_level_policy_unsupported: the record operation cannot honor the caller’s row-level policy. It refuses rather than bypassing that policy. 503 record_api_restore_pending: the record API is waiting for restore processing to finish. Follow the reported retry guidance. Inspect error codes, reasons and retry guidance before retrying. Filter-based update and delete jobs, a Pinecone-compatible endpoint, and Pinecone SDK compatibility are not available. There is no throughput or dataset-scale guarantee implied by these examples. Create and manage embeddings Previous Page IVF indexes Next Page --- ## Data Processing Addendum - OriginChain Canonical source: https://originchaindb.com/dpa legal Data Processing Addendum Last updated: 24 October 2026 1. Parties & scope This Addendum forms part of the Master Services Agreement between the customer ("Controller") and Silicoyn Technologies Pvt Ltd ("OriginChain" or "Processor"). It governs the processing of Personal Data the Controller submits to the OriginChain Service. 2. Roles The Controller is the data controller; OriginChain is the data processor. OriginChain processes Personal Data only on documented instructions from the Controller - typically the API and console actions taken by the Controller's authenticated users. 3. Categories of data & data subjects The Service is a general-purpose database; the Controller decides what to store. OriginChain does not classify Personal Data on the Controller's behalf. Typical categories include: End-user identifiers (email, account id) Application content (rows, schema, query history) Operational telemetry (request timestamps, error codes) Special-category data (health, biometrics, political opinion etc.) may only be processed under an Enterprise contract with appropriate sector-specific addenda. 4. Sub-processors OriginChain uses the following sub-processors as of the date above. We notify Controllers in advance of any addition or replacement. Amazon Web Services Cloud infrastructure: compute, storage, backups, DNS, object storage, and our managed account database. Razorpay Payment processing. Card data is tokenised - OriginChain never receives PAN or CVV. Anthropic AI model provider for Ask AI, the console assistant, on OriginChain's own account. Used only when one of the Controller's users uses Ask AI: the messages that user sends and the results of the reads Ask AI runs for them (which can include Customer Data the user is allowed to read) are processed to compose answers. Ask AI acts with that user's permissions and makes no change without their approval. Model provider (Controller-selected) Natural-language compilation of /v1/ask requests. The Controller supplies its own model-provider credentials, so the provider is whichever the Controller has configured. Prompts are submitted to that provider and discarded; OriginChain does not store model output beyond the response it returns. 5. International transfers Customer data is stored in the region selected by the Controller and does not leave it, except that when one of the Controller's users uses Ask AI, the messages that user sends and the data Ask AI reads to answer them are processed by the model provider listed above, which may be outside that region. Live regions span Asia-Pacific, Europe, North and South America, Africa and the Middle East; the current list is published by the control plane and shown in the console when an instance is created. A Controller that must keep data within a specific jurisdiction should select a region in that jurisdiction. Cross-border transfers, if any, occur only when the Controller routes AI traffic through a model endpoint in another region - controlled by the Controller's tenant configuration. 6. Security See /security for the full posture. Summary: TLS for every external endpoint, Argon2id for stored credentials, isolated tenant resources, daily backups encrypted at rest, and principle-of-least-privilege engineer access that is brokered and audit-logged (no direct SSH). 7. Data subject requests On the Controller's instruction, OriginChain will assist with the rectification, erasure, restriction, or export of Personal Data. Self-serve mechanisms: Erasure: cancel a subscription with the "delete data" option, or contact privacy@originchaindb.com to expedite. Export: scan the affected schemas via the API. We do not gate exports. Rectification: standard write API. 8. Deletion & retention On termination of a tenant subscription with the "delete data" flag set: The per-tenant compute and storage volume are destroyed within 24 hours. Backup snapshots age out after 30 days per the standard retention policy. Earlier deletion is available on written request. Operational metadata in our management systems (instance and subscription rows) is retained for 7 years to satisfy financial record-keeping obligations under Indian tax law (Section 44AA, Income Tax Act, 1961). Security logs (auth events, failed login attempts) are retained for 90 days. 9. Breach notification OriginChain will notify the Controller without undue delay, and in any event within 72 hours of becoming aware, of any Personal Data Breach affecting the Controller's data. Notification includes the nature of the breach, the categories and approximate number of records affected, the likely consequences, and the measures taken or proposed to address it. 10. Audit OriginChain provides on request: SOC 2 Type 1 reports as they are issued (Type II available on request once attested), the security questionnaire (today: /security), and access to engagement-specific evidence (penetration test reports, vulnerability scans, access logs filtered to the Controller's tenant). On-site audits are negotiated per Enterprise contract. 11. Liability Liability under this Addendum is governed by the limitation-of-liability clause in the Master Services Agreement. 12. Governing law This Addendum is governed by the laws of India. Disputes are subject to the exclusive jurisdiction of the courts in Bengaluru, Karnataka. Where a Controller is established in the EU/UK and EU/UK data protection law applies to the processing, the parties incorporate the EU Standard Contractual Clauses (Module Two: Controller to Processor) as a separate signed annex. 13. Contact Privacy office: privacy@originchaindb.com Postal address: Silicoyn Technologies Pvt Ltd, Bengaluru, Karnataka, India. --- ## Enterprise: dedicated to your workload | OriginChainDB Canonical source: https://originchaindb.com/enterprise Enterprise Your workload. Your operating requirements. Build on a multimodal database with dedicated resources. Bring your data, deployment requirements and success criteria. We’ll work through the configuration with your team. Talk to our team Explore the architecture Dedicated deploymentYOUR ENVIRONMENT Your applicationBuilt around your data. Your selected region OriginChainDBSingle tenant SQLVectorGraphFull-text ComputeDedicated capacity StorageDedicated volumes AccessRecoverySupport A deployment shaped around your requirements. Resources, options and terms are agreed for your configuration. Built around your business The resources you need. A foundation you understand. Choose the database configuration for the work it needs to do, from application queries to retrieval and connected records. 01 Dedicated resources Capacity for your application. Run on dedicated compute and storage. Size the instance around your records, indexes, query mix and expected concurrency. Explore configurations 02 Regional deployment A region you can plan around. Choose a supported region for your database and its backups. Discuss network access and any private deployment requirements with the team. Review deployment options 03 Multimodal database One engine. More ways to build. Use SQL, vector, graph and full-text interfaces for your workload. Connect the supported tools and SDKs your developers already use. Explore the product Production planning Make recovery part of the deployment. Availability and recovery solve different problems. Set the expectations for each before your application goes live. Read the operations guide ! Define your recovery objectives, then validate them against the selected configuration and a restore rehearsal. AVAILABILITY Choose the standby configuration. An optional warm standby follows the primary in the same region. Replication is asynchronous; recent writes can be missing after an abrupt primary failure. Promotion is operator-driven by default. Replication behaviour RECOVERY Start with a tested backup path. Dedicated configurations include encrypted daily storage snapshots in the instance’s region. Restore into a fresh instance and verify application-critical data before switching traffic. Backup & restore SUPPORT Agree the operating relationship. Discuss support coverage, escalation contacts and availability commitments with the team. The deployment agreement defines the services and terms for your environment. Plan support coverage Archive streaming and point-in-time recovery remain in preview. Current recovery planning should use daily snapshots; review the documented limits for your instance. Ready for the review Give each team a clear starting point. Bring security, engineering and procurement into the conversation early. Work through the requirements that affect your deployment. 01 Security & data protection Review controls, security programs in progress, the data processing agreement and the requirements for your data. Security overview 02 Architecture & recovery Confirm the topology, backup approach, promotion procedure and recovery expectations for your configuration. Architecture overview 03 Commercial terms & support Agree capacity, availability commitments, support coverage and any private deployment scope in your agreement. Discuss your requirements Evaluating a regulated workload? Discuss the applicable region, contractual documents and required controls before moving sensitive data. Read the DPA From evaluation to production Prove it with your own workload. Start with representative data and the queries your application depends on. Agree what a successful evaluation looks like before choosing the final configuration. Review the benchmark methodology Describe the workload. Share data volume, query patterns, peak concurrency, required tools and your region preferences. Evaluate the configuration. Test representative reads and writes. Review latency, resource use, access controls and recovery with your engineering team. Agree the path to launch. Confirm sizing, migration steps, operating responsibilities and commercial terms before moving production traffic. Before we begin A few practical questions. Can I begin on a free database? Yes. Use the free configuration to explore the database, then evaluate dedicated resources for your production requirements. Shared and dedicated configurations have different capacity, connectivity and recovery options. Compare pricing and configurations. Can we discuss a private deployment? Yes. Managed deployment in a supported region is the standard starting point. Private deployment requirements are scoped with the team; availability, responsibilities and commercial terms depend on the engagement. What should we bring to a technical walkthrough? A description of your data, representative queries, expected traffic, preferred region and any security or recovery requirements. Include the tools you need to connect and the measurements you want to validate. Where can our security team start? Start with the security overview and authentication guide. Contact the team to discuss planned assessment scope, a security questionnaire and the documentation needed for your review. Build with OriginChainDB Bring the workload. Let’s plan the deployment. Talk to our team Explore the architecture --- ## Events & conversations | OriginChainDB Canonical source: https://originchaindb.com/events Events Meet the team. See what we are building. Find upcoming sessions and revisit past OriginChainDB events. Explore past events Join the community A place for a technical conversation Upcoming The next date will appear here. No upcoming events announced No public sessions are scheduled here right now. Join the community or ask about a session for your team. Discuss a technical session Past events Past events. View the session details and photos. Global Fintech Fest 2026 · Mumbai 8–11 September 2026 Global Fintech Fest One AI multimodal database platform for enterprise data, AI and agentic workflows SpeakerZaheer Kazi · Co-founder & CCO VenueJio World Centre, BKC, Mumbai The session covered structured records, document search, embeddings and entity relationships, and their role in application workflows. Explore the product View more photos from the session + Between events Keep learning. Developer community Ask implementation questions and discuss the work. Product releases Follow published changes and release notes. Documentation Take an idea from a session into an implementation. Build with OriginChainDB Continue the technical conversation. Explore past events Join the community --- ## Run a keyword and vector retrieval example | OriginChainDB Canonical source: https://originchaindb.com/examples/search-rag Search retrieval example From ranked results to readable sources. See how a search application combines keyword and vector results. One file, no packages, and source references you can inspect. Download the example See how to run it Search & RAG Find relevant passages. Give your application the sources for its answer. Illustrative application 01 / Start offline Inspect the result. No account needed. Download the file and run it with Node.js 22 or newer. It uses supplied sample rankings and three small source records. This mode demonstrates application logic. It does not run a database search, create embeddings or generate an AI answer. node search-rag-example.mjs Expected first source Project access Ask the project owner to approve access. After approval, an administrator adds you to the project. Sourceaccess-guide · page 2Passage ID project-access 02 / Connect prepared data Try the same flow against your database. The live mode makes read-only retrieval requests. Use a small collection of public sample documents first. Prepare the source records and indexes Each row needs an ID and text. Keep source and page for citations. Store vectors and index text under the same IDs. Register the table schema, then write each source row. Generate an embedding with your chosen model, then store the vector under the same row ID. Index the passage text using that ID as doc_id. These are separate requests. Check each response before running retrieval, and keep source rows, vectors and text entries in sync when documents change. Set your local environment OC_BASE_URL Your HTTPS database origin, with no path. OC_TENANT The tenant containing your sample passages. OC_TOKEN Your database bearer token, kept in the local environment. OC_TABLE The collection used for source rows, vectors and text entries. OC_TEXT_FIELD The indexed passage field, such as text. For a scoped database user, also set both OC_DB_USER and OC_DB_KEY. Check permissions on text search, vector search and source reads. Create a query file Save query.json with your question and its embedding. Replace the example vector below with one from the same model and dimension as your stored vectors. { "question": "Your question", "embedding": [0.12, 0.34, 0.56], "metric": "cosine" } Run retrieval and inspect the sources node search-rag-example.mjs --live query.json The script runs keyword and vector queries, combines ranked IDs and loads the top source rows. An empty list means no context was found. Failed or denied source reads stop the run. 03 / Evaluate the result Useful evidence comes before an answer. This example ends at retrieved passages. Your application supplies document parsing, embedding generation, permissions, updates and any answer-generation model. Does the expected passage appear in the top results? Can the person making the request open every returned source? Do changed and deleted documents disappear from stale results? What are the total retrieval time and model cost per question? Plan a search pilot The included offline fixture and HTTP contract tests are automated. Results against your database depend on its data, configuration and permissions. Build with OriginChainDB Ready to test your own search workload? Download the example See how to run it --- ## OriginChainDB questions and answers Canonical source: https://originchaindb.com/faq Topics+ Read the documentation Search questions 59 answers Getting started What is OriginChainDB? + OriginChainDB is a distributed multimodal database for SQL records, vector search, full-text search and graph relationships. Ask adds a natural-language query interface over the engine. Explore the database. Link to this answer ↗ What do I get when I sign up? + A provisioned database has an HTTPS endpoint and credentials for its supported API surfaces. Free uses shared infrastructure; dedicated configurations have their own compute and storage. Review the selected configuration and follow the quickstart for your first request. Link to this answer ↗ How much does OriginChainDB cost? + Free includes 2 GB of database storage. Two pooled configurations are available: $29/month for 25 GB storage and 20 GB monthly data transfer, or $49/month for 50 GB storage and 50 GB transfer. Dedicated pricing depends on resources, region and options. Compare configurations and estimates. Link to this answer ↗ Which regions can I deploy to? + Check the regions available for the configuration you select in the console. Dedicated database resources are provisioned in the selected region; account and billing services are global. The pooled configurations are scoped to India (Mumbai). Read the deployment guide. Link to this answer ↗ How do I sign up and get my first connection? + Create an account at app.originchaindb.com, select an available configuration and review its requirements. Once provisioned, use the instance endpoint and credential from the console. Keep credentials on your server and follow the first-query guide. Link to this answer ↗ Why is the dashboard on a different domain? + The public website at originchaindb.com and the authenticated console at app.originchaindb.com are separate applications. Use the website for product information and documentation, and the console for your account and instances. Link to this answer ↗ Free, Starter or dedicated — which should I pick? + Use Free for learning and prototypes. The 25 GB and 50 GB pooled configurations provide fixed monthly shared capacity; choose your configuration in the console. Choose a dedicated configuration when you need your own compute and storage, with recovery and standby options reviewed separately. Compare the current options. Link to this answer ↗ Console & tutorials Where do I start in the new console? + Sign in at app.originchaindb.com, choose your organization, then open an instance. Overview has its status and connection details; Workbench runs queries; Data Explorer browses tables and records. Database Management, Access Control, Configuration and Platform contain the instance’s other tools. Watch the console overview on YouTube. Read the current console guide. Link to this answer ↗ Can I try the console without connecting a real database? + Yes. The demo workspace uses sample organizations, instances and data in your browser. It cannot connect to real instances. To work with your own data, open sign-in from the demo and sign in to the real console; values entered in the demo are not carried over. Link to this answer ↗ How do I create an instance and find its connection details? + Open Instances in your organization and choose Create instance. Review the available configuration and its requirements, then follow the console’s provisioning steps. Once the instance is ready, open Connect. Copy the complete OC_URL and the credential offered for OC_TOKEN without changing the URL path. PostgreSQL uses a separate read-only login. Store any key or token when it is shown. Watch the instance configuration and connection guide on YouTube. Link to this answer ↗ When should I use Workbench instead of Data Explorer? + Use Workbench to write and run queries against the selected instance. Use Data Explorer to inspect namespaces, tables, fields and records, and to open a table’s query. Query support depends on the selected API and configuration. Watch the Workbench tutorial on YouTube. Link to this answer ↗ Why can I see a table but not edit its records? + Data Explorer can display tables that its record editor cannot safely update, including some tables without a primary key or with a composite key. These open read-only with a reason. Your role can also limit editing. Check the explanation shown for the table or action before using another supported API. Watch the Data Explorer tutorial on YouTube. Link to this answer ↗ Why is a console button disabled or waiting? + Check the reason beside the action: your role, the instance state or the selected configuration can make a control unavailable. Workbench and Data Explorer wait while a sleeping instance wakes. Ask an organization administrator about missing permissions. If a control remains unresponsive after its stated requirements are met, contact the team with the page, action and error message, leaving out credentials. Watch the roles and row policies guide on YouTube. Link to this answer ↗ Can I view an instance key or token again after closing it? + Treat a newly issued key or token as a one-time secret. The console keeps it visible until you confirm that you have stored it. Save it securely before continuing. If it is lost, use the permitted key or token management action to issue a replacement and update applications that use it; do not expect the old secret to be shown again. Link to this answer ↗ Where do I find setup instructions for a client or integration? + Open Integrations in your organization, choose the instance, then search or browse the tool groups. Each available integration has setup guidance. Use that instance’s Connect dialog for its actual connection details, and review the linked documentation for the operations supported by the chosen client. Link to this answer ↗ What if a tutorial video looks different from my console or leaves a question unanswered? + Videos show the workflow available when they were recorded; newer options, permissions and configuration limits can differ. Start with the tutorial library, then check the current console’s guidance and the documentation for the step you are following. If you still need help, send the team the video link, timestamp, step title and error message. Leave out passwords, tokens and private data. Link to this answer ↗ Capabilities Can I use an Elasticsearch client with my instance? + Dedicated deployments expose a supported subset of the Elasticsearch-compatible API for 7.x clients. Use the instance HTTPS endpoint followed by /v1/tenants/{tenant}/es, with the tenant ID shown in Connect. Authentication accepts an OriginChainDB token as Bearer, as the password in Basic authentication, or in the ApiKey header format. This does not establish compatibility with every client operation or Kibana. Read the Elasticsearch connection guide. Check current support and authentication. Link to this answer ↗ Is the vector record API available on my configuration? + The vector record API is available on dedicated deployments with the required vector capability enabled. It supports indexes, namespaces, dense and sparse vectors, and metadata. It is separate from the existing vector-table API and is not available on the Free configuration. A Pinecone-compatible endpoint and SDK compatibility are not available yet. Read the vector record API reference. Link to this answer ↗ What query shapes does OriginChainDB support? + The four data models are SQL records, vectors, full-text indexes and graph relationships. Ask is a natural-language interface, not a fifth storage model. Each API has its own supported operations and limits; the documentation shows the request and result shapes. Link to this answer ↗ What are 'atomic cross-shape writes'? + Atomicity applies to the writes included in a supported operation or transaction. A row update does not automatically update a separately written vector or full-text index. Coordinate those index writes in your application and use stable record IDs to connect results. See transaction guarantees and full-text indexing. Link to this answer ↗ Is OriginChainDB a distributed database? + Dedicated configurations can use a primary and optional standby with asynchronous replication. The primary accepts writes; promotion and availability depend on the configured topology. This is not a promise of quorum commit or multiple active writers. See replication and recovery behavior and your service agreement. Link to this answer ↗ Can vector search and SQL hit the same row? + Yes. Use the same stable ID for a SQL row and its vector entry, then fetch the row for a returned search ID. Supply vectors through the vector API, or use a saved embedder on a dedicated configuration. Configure an embedding schedule to process new and optionally changed rows; a row edit alone does not start an unscheduled job. See how vector entries relate to rows. Link to this answer ↗ How does natural-language /ask work? + Ask first tries a deterministic grammar against the schema catalog. If that cannot resolve the question, it uses the configured LLM; a compiled plan can then be cached. Pass a schema scope and use show_plan to inspect the result. Schema changes can invalidate cached plans. Read the Ask reference. Link to this answer ↗ Do I bring my own LLM key? + Ask can fall back to the LLM configured for the instance. Review the provider, credential handling and provider terms before enabling that path. The deterministic grammar and plan cache can answer supported requests without a new LLM call. See how Ask chooses its path. Link to this answer ↗ What does the AI compiler see? + An Ask question is sent to the configured LLM when the deterministic path needs that fallback. Do not include secrets or sensitive personal data in the question. Review the configured provider and data handling requirements rather than assuming every external inference call stays in the database region. Read the request guidance. Link to this answer ↗ Does OriginChainDB support graph queries? + Yes. Declare relations on registered tables, then follow connected records or use supported graph algorithms. Cypher and algorithm endpoints have different syntax, limits and result shapes; supported Cypher is a subset. Review traversal examples and limits. Link to this answer ↗ What languages does full-text search support? + The HTTP API uses Unicode tokenization and lowercase normalization across scripts. Engine stemmers and other analyzer stages are not all selectable through the API: do not assume stemming, lemmatization or accent folding is enabled. Check the live analyzer behavior and synonym support. Link to this answer ↗ Does OriginChainDB support transactions? + Single-row writes are atomic. The preview /tx API defaults to snapshot isolation with commit-time conflict detection and an optional serializable mode; SQL session transactions use read committed with different conflict behavior. Pick the surface for your workload and handle commit failures explicitly. Compare the two transaction APIs. Link to this answer ↗ Migration & embeddings Which sources can I migrate, and does Migrate keep them in sync? + Migrate copies data into a dedicated OriginChainDB instance. Supported sources include PostgreSQL and CockroachDB, MySQL and MariaDB, SQL Server, MongoDB, and S3-compatible object-storage files in CSV, TSV, JSONL or JSON-array format. Open your instance’s Platform area and select Data migration under Migrations. Review the proposed structure and mappings before approving the move. Supported PostgreSQL and MySQL sources can use live sync during migration. Other sources use a one-time copy. SQLite file imports are not offered. Watch the migration workflow overview on YouTube. Read the migration guide. Link to this answer ↗ Can I check a migration before copying rows? + Yes. Review the source analysis and destination mappings, then use Check data to find values that will not fit the plan before moving them. Check data does not write to the destination. Source access is read-only. Allowing masked samples helps detect column types; with samples off, analysis reads the structure only. Check data is also available after a failed or cancelled move. Link to this answer ↗ What does “rows set aside” mean after a migration? + By default, a one-time copy sets aside rows that cannot be moved and continues with the rest. You can instead choose Stop the table on the Source step. A table with set-aside rows is partial, not Verified. Inspect each recorded reason and fix the source values. Manual retry is available for supported PostgreSQL, CockroachDB, MySQL and SQL Server tables with usable primary keys; it adds missing rows without overwriting existing records. Retries are not automatic and are not available for MongoDB or file sources. Link to this answer ↗ Can I generate embeddings for a table already on my instance? + Yes, on dedicated configurations. Save and test an embedder in your organization’s Settings, under Embedders. Then open the instance’s Platform area and choose Embeddings. Select a table keyed by one column, the text columns in the order to combine them, optional row conditions and a maximum number of rows to embed. Runs use saved embedders and apply the initiating member’s row policies and column masks. Embedding a masked key or text column is refused. Read the embedding runs guide. Link to this answer ↗ Do embeddings update automatically when I change a row? + On dedicated configurations, set up an embedding schedule for new rows and optionally changed rows. Without a schedule, start an explicit run to refresh vectors. Runs that regenerate stored vectors also replace their metadata; other metadata under the same row ID is not retained. Review row limits in the embedding schedules guide. Link to this answer ↗ Where is my data sent when I use a saved embedder? + The selected text is sent to the saved embedder’s URL to generate vectors. Review that provider’s data handling and charges before running it, and set the required maximum row count. The current production workflow requires your own saved embedder; a managed OriginChainDB embedding service is not available. Do not include credentials in text columns selected for embedding. Link to this answer ↗ Performance What latencies should I expect? + Latency depends on query shape, data size, indexes, hardware, load and network distance. Measure the full request path on your own dataset; a published benchmark is evidence for its stated setup, not a latency guarantee for every configuration. Review the benchmark methods and results. Link to this answer ↗ How fast is /ask? + A cache hit, a fresh grammar compilation and an LLM fallback have different costs. Inspect the cache field and query plan, then measure the path your application uses. There is no single response time that covers all three. See plan-cache behavior. Link to this answer ↗ How accurate and fast is vector search? + Vector accuracy and latency depend on the index, dimensions, metric, filters and search settings. Compare recall and tail latency together using a representative query set; fast and high_recall modes make different tradeoffs. Read published measurements and choose search settings. Link to this answer ↗ What throughput can I expect? + Use the configuration estimator for capacity planning, then benchmark your workload with representative concurrency, writes and queries. Sizing estimates are not measured throughput guarantees, and adding a standby does not imply linear query scaling. Review the benchmark resources. Link to this answer ↗ How many vectors can I store? + Capacity depends on vector dimensions, metadata, the index representation and available memory and storage. A documented index option does not establish measured performance at every corpus size. Review the index choices and discuss a representative capacity test. Link to this answer ↗ Operations How are backups handled? + Dedicated configurations include a daily storage snapshot. Snapshot recovery and continuous archive are separate paths; the operations guide documents current archive limitations. Free and pooled configurations do not include point-in-time recovery. Review backups and recovery expectations. Link to this answer ↗ Do you support point-in-time recovery? + Continuous archive and restore-to-timestamp options for dedicated configurations are in preview. The operations guide records lagging or stalled archive progress, so do not treat sub-second or per-second recovery as delivered behavior. Plan against the available daily snapshot and review your recovery requirements with the team. Read the current recovery caveats. Link to this answer ↗ How does failover work? + A configured standby follows the primary asynchronously, so abrupt primary loss can lose recent acknowledged writes. Promotion is fenced by the writer lease; automatic promotion is opt-in and depends on the configured path and catch-up state. A standby does not replace a backup. Read the failover procedure and durability caveats. Link to this answer ↗ What observability do I get? + Health and readiness endpoints expose instance status; the usage endpoint reports per-tenant counts and activity. SQL EXPLAIN helps inspect query plans, and the operations guide describes tracing and monitoring options. Confirm the signals available on your deployed configuration. Explore operational monitoring. Link to this answer ↗ Which SDKs are available? + Python, TypeScript and Go clients cover different parts of the HTTP API. Python has the widest coverage; TypeScript also offers a control-plane client, while Go covers query surfaces. Use plain HTTP for operations your chosen SDK does not wrap. Compare the client coverage. Link to this answer ↗ Can I subscribe to live updates? + The HTTP reference documents a watch interface for change notifications. Check its supported subscription scope, delivery behavior and client handling before using it to keep another system in sync. Do not assume it is a durable replay log or a universal CDC replacement. Read the HTTP API reference. Link to this answer ↗ Security & compliance Is OriginChainDB single-tenant? + Dedicated configurations have their own compute and storage. Free and the $29 and $49 pooled configurations use shared infrastructure. Database isolation, network paths and access controls should be evaluated for the chosen deployment. Review the deployment boundaries. Link to this answer ↗ How is my data encrypted? + Managed public endpoints use HTTPS. The security page describes where TLS terminates and how the network path differs between shared and dedicated deployments. Review storage, backup and key-management requirements for your selected configuration. Read the security overview. Link to this answer ↗ Is there an audit log? + Review which identity, request and outcome fields your deployed service records, where you can access them, and the retention or export options in your agreement. Console preview screens alone do not establish live audit coverage. Review access and operational records. Link to this answer ↗ What about SOC 2, HIPAA, and GDPR? + Contact security@originchaindb.com for current assessment status, questionnaires and contractual requirements. A database feature is not a compliance certification; evaluate the deployment and applicable agreement for your workload. Review the published security information. Link to this answer ↗ Where exactly does my data live? + Dedicated database resources are provisioned in the selected region. Account and billing are global services; external LLM providers and other integrations have their own data paths. Confirm database, backup and integration requirements together for your deployment. Read the deployment guide. Link to this answer ↗ Billing How do add-ons work? + The dedicated estimator includes the four data models without separate model fees. Resource sizing, standby, recovery, networking and other agreed options affect the configuration. Confirm the available capabilities and final quote before launch. Review the configuration options. Link to this answer ↗ What happens if I upgrade or add an add-on mid-cycle? + Commercial timing follows the applicable agreement; the published Terms distinguish immediate upgrades from next-cycle downgrades. Do not assume all changes are available in place or have no interruption. Free, pooled and dedicated configurations currently do not support in-place switching between them. Review the Terms and discuss a change. Link to this answer ↗ Is there an annual discount? + Contact the team to agree a billing term or custom commitment. The public estimator shows a monthly equivalent and does not apply an automatic annual discount. Discuss commercial terms. Link to this answer ↗ What if I go over my configuration's quota? + The $29 configuration includes 25 GB storage and 20 GB monthly transfer; the $49 configuration includes 50 GB storage and 50 GB monthly transfer. Check current usage limits and billing terms in the console before purchasing. For other configurations, review included usage and the final agreement. See current allowances. Link to this answer ↗ What's included in Enterprise? + Enterprise is scoped around your deployment, network, region, recovery, support and contractual requirements. Confirm each capability and service commitment with the team rather than assuming a preset package or an unshipped topology. Discuss a custom deployment. Link to this answer ↗ Do vector, graph and full-text cost extra? + The dedicated pricing estimator includes SQL, vector, graph and full-text without separate per-model fees. Rows and indexes still consume compute, memory and storage, so workload size affects the estimate. Size a configuration. Link to this answer ↗ What is the Starter plan? + The current shared options are Configuration 25 GB pooled at $29/month with 20 GB monthly transfer, and Configuration 50 GB pooled at $49/month with 50 GB transfer. Both are monthly USD configurations with shared compute. Select a configuration in the console and review checkout before paying. See the current configuration names and limits. Link to this answer ↗ What does the cheapest dedicated configuration include? + The public estimator starts at $320/month for a Mumbai baseline with 2 vCPU, 8 GB RAM and 20 GB storage. This is a planning estimate in USD before applicable taxes; availability and the final quote are confirmed before launch. Review and adjust the estimate. Link to this answer ↗ What happens when I outgrow Starter? + Review a dedicated configuration when you need more capacity or dedicated resources. In-place switching from pooled to dedicated is not currently available; plan the data movement and application cutover with the team. Discuss the deployment path. Link to this answer ↗ ? No matching answers. No answer matches . Try another term or clear the topic filter. Ask support ↗ Still have a question? Contact our team or email support@originchaindb.com. --- ## Industry use cases | OriginChainDB Canonical source: https://originchaindb.com/industries Industries How industries use OriginChainDB. Find practical use cases for your industry. Compare SQL, vector, graph and full-text combinations, then follow a worked example. Browse industries Talk to our team Example applications Banking Investigate a transfer Retail Find the right product Telecom Understand a service disruption OriginChainDB Records, search indexes and relationships SQLVectorGraphFull-text Four query models, used as the application needs them. Use cases Choose your industry. Every industry has a use case table with suggested data models, source links and a worked implementation example. Finance & payments Banking Investigating an unusual transfer 10 use cases Data models Implementation Finance & payments Financial services & payments A payment arrives without a usable invoice reference 10 use cases Data models Implementation Finance & payments Lending Checking an incomplete business loan application 10 use cases Data models Implementation Finance & payments NBFCs The borrower paid, but the instalment shows overdue 10 use cases Data models Implementation Insurance & investing Insurance Checking a repair estimate against the policy 10 use cases Data models Implementation Insurance & investing Wealth management Preparing for a client’s planned expense 10 use cases Data models Implementation Insurance & investing Mutual funds Finding the applicable holdings and exit-load terms 10 use cases Data models Implementation Insurance & investing Capital markets Reviewing a new financing disclosure 10 use cases Data models Implementation Commerce & operations E-commerce & retail Finding a waterproof commuter bag under $80 10 use cases Data models Implementation Commerce & operations Contact centres & BPOs Explaining a delayed refund 10 use cases Data models Implementation Commerce & operations Telecom Several sites fail after a network change 10 use cases Data models Implementation Health & travel Healthcare Finding the current intake procedure 10 use cases Data models Implementation Health & travel Airlines & aviation An inbound delay puts a connection at risk 10 use cases Data models Implementation 13 industries Documentation Implementation resources Check the query interfaces, client libraries and access controls before choosing an approach. Database SQL, vector, graph and full-text capabilities. Integrations SDKs, database clients, HTTP APIs and MCP. Security Access controls and compliance information. Build with OriginChainDB Discuss your application with us. Browse industries Talk to our team --- ## Airlines & aviation use cases and data models | OriginChainDB Canonical source: https://originchaindb.com/industries/airlines-aviation Airlines & aviation Help passengers with missed connections. Connect flight updates, booking segments and carrier policies. Help support agents find affected connections and check the passenger’s options. Explore use cases Talk to our team Connection support Review a missed connection and check an alternative route. Illustrative use case 01 / Use case guide 10 practical use cases. Compare the data models behind everyday industry tasks, from finding records to following connections. SQL Filter and calculate Vector Match similar meaning Graph Follow relationships Full-text Find words and phrases ✓ Suggested model combination Scroll across to compare all four models Airlines & aviation: 10 use cases, suggested query models and industry references. Use case How the data models help SQL Vector Graph Full-text Source 01 Identify connections at risk An inbound delay leaves a passenger with little time for an onward flight. Graph follows the booking's connected flight segments; SQL compares updated arrivals, departures and gate transfer times for agent review. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [1] 02 Find passenger rebooking options An agent needs alternatives after a passenger misses a connection. Graph finds onward journey options; SQL checks times and reported availability; Full-text retrieves applicable rebooking rules before booking-system confirmation. SQL included — Vector not needed for this example Graph included Full-text included [1] [2] 03 Find delay assistance guidance An agent needs the carrier's meal or hotel policy for a disrupted journey. Vector matches the passenger's situation to guidance; SQL selects the carrier and disruption category; Full-text retrieves the applicable assistance conditions. SQL included Vector included — Graph not needed for this example Full-text included [2] 04 Review flight refund eligibility A passenger declines a disrupted itinerary and asks about a refund. SQL retrieves cancellation, schedule-change and acceptance records; Full-text finds current refund conditions for an authorized agent to review. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [2] 05 Locate delayed checked bags A passenger needs the latest status of a checked bag. Graph connects bag tags to the passenger's flight segments; SQL retrieves the latest bag tracking event and claim status. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [3] 06 Prepare baggage expense claims A passenger needs to submit receipts against the correct baggage incident. Graph links receipts to the bag incident and trip; SQL totals submitted expenses; Full-text retrieves claim instructions for staff review. SQL included — Vector not needed for this example Graph included Full-text included [3] [4] 07 Coordinate airport mobility assistance A requested wheelchair service must follow the passenger through connecting airports. Graph links assistance requests to journey segments and airports; SQL checks request status and updated connection times for service staff. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [5] 08 Check travel document requirements A check-in agent needs current passport and visa requirements for an itinerary. Graph follows destination and transit points; SQL filters nationality and travel dates; Full-text retrieves document requirements for staff confirmation. SQL included — Vector not needed for this example Graph included Full-text included [6] 09 Explain ticket change rules A passenger wants to understand restrictions before changing a booking. SQL retrieves ticket and fare details; Full-text locates the applicable change restrictions and fare-difference conditions for the agent. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [7] 10 Find special baggage guidance A traveller asks how to carry an unusual item. Vector matches the item description to baggage categories; SQL checks recorded size and weight limits; Full-text retrieves packing and acceptance conditions. SQL included Vector included — Graph not needed for this example Full-text included [8] Use the query interfaces you need, then connect their results through shared record IDs in your application. Industry sources 8 These sources describe real industry workflows. The model combinations above are proposed OriginChainDB designs, not customer deployment claims. United Airlines — United Mobile App Now Gives People More Information About Their Connecting Flight (opens in a new tab) U.S. Department of Transportation — Airline Cancellation and Delay Dashboard (opens in a new tab) Delta Air Lines — Damaged, Delayed or Lost Baggage (opens in a new tab) Delta Air Lines — Online Baggage Claim (opens in a new tab) Delta Air Lines — Wheelchairs, Scooters & Assistive Devices (opens in a new tab) International Air Transport Association — Timatic Solutions (opens in a new tab) Delta Air Lines — Ticket Rules & Restrictions (opens in a new tab) Delta Air Lines — Special Baggage Items (opens in a new tab) 02 / A closer look An inbound delay puts a connection at risk An inbound delay puts a connection at risk. A support agent needs the linked itinerary, updated flight information, available alternatives and the policy that applies to this disruption. The illustration uses a synthetic booking. What makes it difficult 01 Flight updates and booking records arrive from different systems. 02 A single disrupted segment affects connecting journeys. 03 Rebooking guidance varies by carrier and circumstances. Suggested approach Check the journey before suggesting a change Follow connected flight segments, retrieve current status and search the applicable carrier policy. Verify candidate alternatives with the booking system before offering them. 03 / Queries What each data model does Select a model to see the question it answers. SQL · Find the facts The question Which onward flights leave after the revised arrival? Filter affected segments, times and candidate availability. Explore SQL Vector · Match the meaning The question Find guidance for a delayed inbound connection. Find approved guidance that matches a traveller's situation. Explore Vector Graph · Follow the connections The question Which connections depend on this inbound flight? Connect journeys, bookings and dependent flight segments. Explore Graph Full-text · Find the exact wording The question Find the conditions attached to this disruption waiver. Look up exact waiver codes and policy conditions. Explore Full-text Use shared record IDs to combine results from the different query interfaces in your application. 04 / Implementation How to build it STEP 01 Choose a delay scenario Use one hub, authorized flight data and synthetic bookings. Agree which options agents can offer and which cases need specialist handling. STEP 02 Link flight segments Keep flight, segment and booking IDs, update timestamps and policy effective dates. Refresh records and search indexes when sources change. STEP 03 Prepare rebooking options Combine flight filters, journey links and carrier guidance. Show source times and policy citations. Recheck seats and rules with the booking service. STEP 04 Replay past disruptions Test changing availability and unsuitable suggestions with support staff. Pilot with authorized agents while retaining existing booking and approval controls. 05 / Testing What to measure Compare these results with your current process before rollout. Valid option rate Check how many proposed options pass current availability and policy validation. Time to a useful brief Measure the time an agent needs to find the affected connection and relevant guidance. Stale information Track results superseded by a newer flight, seat or policy update. Booking and operations retain control This example covers passenger support. Authorized staff and airline systems confirm bookings and operational actions; it does not control aircraft or make safety decisions. Security 06 / Sources Examples from the industry Published projects and reference material relevant to this use case. Industry example 25 June 2025 United Airlines United Mobile App now gives people more information about their connecting flight United announced connection information including countdowns, gate directions, flight status and rebooking options when a connection is missed. Read the source Industry context DOT dashboard U.S. Department of Transportation Airline Customer Service Dashboard The dashboard compares airlines' commitments to passengers during controllable cancellations and delays, showing that available assistance differs between carriers. Read the source These are industry references, not OriginChainDB customer stories. The implementation above is a proposed example. Build with OriginChainDB Discuss your application with us. Explore use cases Talk to our team --- ## Banking use cases and data models | OriginChainDB Canonical source: https://originchaindb.com/industries/banking Banking Investigate suspicious transactions. Find transfers, linked accounts and previous case notes in one investigation view. Give analysts the records they need to review an alert. Explore use cases Talk to our team Transaction investigation Trace a transfer through verified account links. Illustrative use case 01 / Use case guide 10 practical use cases. Compare the data models behind everyday industry tasks, from finding records to following connections. SQL Filter and calculate Vector Match similar meaning Graph Follow relationships Full-text Find words and phrases ✓ Suggested model combination Scroll across to compare all four models Banking: 10 use cases, suggested query models and industry references. Use case How the data models help SQL Vector Graph Full-text Source 01 Suspicious transfer network review Investigators need the accounts and prior cases surrounding an unusual transfer. SQL filters transfers, Graph follows recorded account links, and Vector retrieves similarly described case notes for analyst review. SQL included Vector included Graph included — Full-text not needed for this example [1] 02 Business ownership evidence review Onboarding teams need to verify the people behind a business account. SQL selects current customer records, Graph traces documented ownership, and Full-text finds names in supporting filings. SQL included — Vector not needed for this example Graph included Full-text included [2] 03 Correspondent account activity review Reviewers need to compare a respondent bank's activity with its agreed services. SQL summarizes account activity, Graph links respondent banks and services, and Full-text retrieves relevant agreement clauses. SQL included — Vector not needed for this example Graph included Full-text included [3] 04 Trade finance document checks Trade teams need to investigate inconsistent invoices, shipments and payment details. SQL compares recorded values, Graph connects trade parties and shipments, and Full-text locates conflicting document descriptions. SQL included — Vector not needed for this example Graph included Full-text included [4] 05 Sanctions alert evidence review Analysts need payment details and source records to resolve a screening alert. SQL selects the flagged message and list version, while Full-text retrieves matching names and references for analyst review. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [5] 06 Check fraud case investigation Investigators need to connect altered checks with deposits and related accounts. SQL compares check amounts and deposit dates, while Graph follows recorded links among checks, deposits and accounts. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [6] 07 Deposit complaint evidence retrieval Service teams need account events and earlier correspondence to resolve a deposit complaint. SQL retrieves account events, Vector finds similarly described complaints, and Full-text locates relevant terms and correspondence. SQL included Vector included — Graph not needed for this example Full-text included [7] 08 Funding concentration review Treasury teams need to see reliance on particular funding sources. SQL aggregates funding by maturity and currency, while Graph groups documented relationships between funding counterparties. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [8] 09 Bank service outage tracing Incident teams need to identify which critical services depend on a failed system. Graph traces service and supplier dependencies, while Vector retrieves similar incident reports and recovery notes. — SQL not needed for this example Vector included Graph included — Full-text not needed for this example [9] 10 Deposit insurance record preparation Operations teams need to resolve missing depositor and account ownership records. SQL checks required fields and balances, while Graph links deposit accounts with recorded owners and beneficiaries. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [10] Use the query interfaces you need, then connect their results through shared record IDs in your application. Industry sources 10 These sources describe real industry workflows. The model combinations above are proposed OriginChainDB designs, not customer deployment claims. BIS Innovation Hub — Project Aurora: collaborative analysis of money laundering (proof of concept) (opens in a new tab) Federal Financial Institutions Examination Council — Beneficial ownership of legal entity customers (opens in a new tab) Federal Financial Institutions Examination Council — Correspondent accounts: operational risks and monitoring (opens in a new tab) FATF and Egmont Group — Trade-Based Money Laundering: Risk Indicators (opens in a new tab) Swift — Transaction Screening (opens in a new tab) Financial Crimes Enforcement Network — Alert on mail theft-related check fraud schemes (opens in a new tab) Office of the Comptroller of the Currency — Consumer complaints and bank dispute resolution (opens in a new tab) Basel Committee on Banking Supervision — Liquidity monitoring metrics: concentration of funding (opens in a new tab) Basel Committee on Banking Supervision — Principles for operational resilience (opens in a new tab) Federal Deposit Insurance Corporation — Part 370 Information Technology Functional Guide, Version 3.0 (opens in a new tab) 02 / A closer look Investigating an unusual transfer An analyst receives an unusual-transfer alert. The payment record is in one system, linked accounts are in another, and previous investigations sit in written case notes. The analyst needs the supporting evidence in one place. What makes it difficult 01 A single transaction does not show the surrounding network. 02 Case notes use different words for similar activity. 03 Outdated identity links can send a review in the wrong direction. Suggested approach Start from the alert Filter the transactions by account and time, follow verified account links, then search related case notes. Show the source of each result so the analyst can check it. 03 / Queries What each data model does Select a model to see the question it answers. SQL · Find the facts The question Which transfers match this account, date range and amount? Narrow the investigation. Explore SQL Vector · Match the meaning The question Which authorized notes describe a comparable transfer pattern? Find similarly described cases. Explore Vector Graph · Follow the connections The question Which accounts share a confirmed owner or beneficiary? Follow verified account relationships. Explore Graph Full-text · Find the exact wording The question Where is this payment reference mentioned in case notes? Find exact references. Explore Full-text Use shared record IDs to combine results from the different query interfaces in your application. 04 / Implementation How to build it STEP 01 Select closed cases Use de-identified alerts from one review queue. Ask investigators to mark the records they needed to resolve each case. STEP 02 Link the records Assign case, transfer and account IDs. Record where each account relationship came from and when it was valid. Index permitted notes. STEP 03 Build the investigation view Filter transfers with SQL, follow account links with Graph and search notes by words or meaning. Combine the results in your application with case-level access checks. STEP 04 Compare with completed reviews Replay closed cases. Check missing evidence, incorrect links and review time before letting analysts use the tool on open cases. 05 / Testing What to measure Compare these results with your current process before rollout. Evidence coverage Compare retrieved records with the evidence investigators marked necessary. Irrelevant connections Track links rejected because identity, timing or source quality was insufficient. Review effort Measure time spent gathering context on comparable cases before and during the pilot. Analyst review The application manages investigation rules and access. Analysts make the decisions; a shared account relationship or similar note does not establish misconduct. Security 06 / Sources Examples from the industry Published projects and reference material relevant to this use case. Industry example 2025 annual report Hong Kong Monetary Authority Banks sharing context through FINEST HKMA describes expanded bank-to-bank financial-crime information sharing through FINEST, including the enhanced platform introduced in December 2025. This is a documented banking initiative, not an OriginChainDB deployment. Read the source Industry context 31 May 2023 BIS Innovation Hub Project Aurora explores network analysis Project Aurora tested collaborative analysis, network methods and privacy-enhancing techniques using synthetic payments data. It was a proof of concept, not a production banking implementation. Read the source These are industry references, not OriginChainDB customer stories. The implementation above is a proposed example. Build with OriginChainDB Discuss your application with us. Explore use cases Talk to our team --- ## Contact centres & BPOs use cases and data models | OriginChainDB Canonical source: https://originchaindb.com/industries/bpos-contact-centres Contact centres & BPOs Help agents answer refund questions. Retrieve the case status, linked order and applicable refund policy. Give agents the facts and source passages they need to respond. Explore use cases Talk to our team Refund support Check the return and payment before replying about a refund. Illustrative use case 01 / Use case guide 10 practical use cases. Compare the data models behind everyday industry tasks, from finding records to following connections. SQL Filter and calculate Vector Match similar meaning Graph Follow relationships Full-text Find words and phrases ✓ Suggested model combination Scroll across to compare all four models Contact centres & BPOs: 10 use cases, suggested query models and industry references. Use case How the data models help SQL Vector Graph Full-text Source 01 Find approved policy answers An agent needs current guidance for a customer's question. Vector matches the question to guidance; SQL filters approved versions; Full-text retrieves exact policy terms for the agent to check. SQL included Vector included — Graph not needed for this example Full-text included [1] 02 Review customer case history An agent needs the earlier contacts and actions behind an open case. Graph connects the case to contacts, customers and tasks; SQL orders the authorized records by time and status. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [2] 03 Prepare an agent handoff A receiving agent needs context without asking the customer to repeat everything. Graph follows transferred contact records; SQL retrieves their sequence; Full-text finds relevant passages in the conversation transcript. SQL included — Vector not needed for this example Graph included Full-text included [3] 04 Track promised follow up A promised callback or back office action needs an owner and due date. Graph connects follow up tasks to the originating case and responsible team; SQL lists outstanding work by due date. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [2] 05 Match agents to requests A request needs an available agent with the right language and skills. Graph links agents to skills and queues; SQL checks proficiency levels and availability for the routing application. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [4] 06 Review call script adherence Supervisors need evidence that required statements were used during calls. SQL selects contacts for the review period and queue; Full-text locates required wording in transcripts for supervisor review. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [5] 07 Find repeated contact reasons Managers need to understand which issues are driving repeated calls. Vector finds conversations describing similar issues; SQL compares their counts by queue, product and period. SQL included Vector included — Graph not needed for this example — Full-text not needed for this example [5] 08 Identify cases needing escalation Supervisors need to review conversations containing unresolved complaints. Full-text finds complaint and escalation phrases; SQL filters unresolved contacts and their waiting times for supervisor review. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [6] 09 Check queue staffing needs Planners need workload totals before preparing agent schedules. SQL summarizes historical contact volumes and handling times by queue and interval for a separate forecasting tool. SQL included — Vector not needed for this example — Graph not needed for this example — Full-text not needed for this example [7] 10 Find overdue case actions A supervisor needs to see cases that have missed a response deadline. SQL compares open cases with their service deadlines; Graph connects each overdue case to its owner and escalation team. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [8] Use the query interfaces you need, then connect their results through shared record IDs in your application. Industry sources 8 These sources describe real industry workflows. The model combinations above are proposed OriginChainDB designs, not customer deployment claims. Amazon Web Services — Use AI agents for real-time assistance (opens in a new tab) Amazon Web Services — Connect Customer Cases (opens in a new tab) Amazon Web Services — Use conversational analytics APIs for chat analytics (opens in a new tab) Amazon Web Services — Set up routing in Connect Customer based on agent proficiencies (opens in a new tab) Amazon Web Services — Connect Customer conversational analytics (opens in a new tab) Amazon Web Services — Create conversational analytics rules using the Connect Customer admin website (opens in a new tab) Amazon Web Services — Create forecasts in Connect Customer (opens in a new tab) Amazon Web Services — Create rules that send in-app notifications (opens in a new tab) 02 / A closer look Explaining a delayed refund A customer asks why a refund has not arrived. The agent needs the return status, payment reference and the policy that applies to that purchase. Similar past cases may help, but an old answer can contain an outdated rule. What makes it difficult 01 Agents switch between case, order and policy systems. 02 Similar questions use different words. 03 Customer and tenant permissions must follow every lookup. Suggested approach Give the agent facts and policy together Retrieve the latest transaction status and the policy for that purchase. Show sources beside any suggested reply, and escalate missing or conflicting information. 03 / Queries What each data model does Select a model to see the question it answers. SQL · Find the facts The question Find this account's pending refund cases. Filter cases by tenant, account, status and time. Explore SQL Vector · Match the meaning The question Match 'money has not come back' to refund guidance. Find relevant guidance despite different wording. Explore Vector Graph · Follow the connections The question Which return and payment belong to this case? Connect cases to orders, payments and returns. Explore Graph Full-text · Find the exact wording The question Find the current clause for delayed refunds. Retrieve exact policy clauses and reference codes. Explore Full-text Use shared record IDs to combine results from the different query interfaces in your application. 04 / Implementation How to build it STEP 01 Choose a support queue Use redacted or synthetic cases and approved articles. Define tenant access, escalation rules and actions the assistant cannot take. STEP 02 Link cases and policies Connect case, order and payment IDs. Retain tenant fields, policy effective dates and versions. Refresh indexes and embeddings after policy changes. STEP 03 Retrieve an answer Apply access checks, retrieve the case facts and search current guidance. If a model drafts the reply, provide approved results and display their sources. STEP 04 Test alongside agents Compare suggestions with resolved cases. Check unsupported replies, stale policies and cross-tenant access before showing suggestions to a small agent group. 05 / Testing What to measure Compare these results with your current process before rollout. Supported answers Have reviewers check that each suggested answer follows the cited facts and policy. Time to evidence Compare the time agents need to locate the correct supporting information. Safe escalation Check whether incomplete or conflicting cases reach a human reviewer correctly. Agents approve customer commitments The application handles identity checks, model calls and escalation. Authorized staff and existing payment services control refunds and other account actions. Security 06 / Sources Examples from the industry Published projects and reference material relevant to this use case. Industry example 22 July 2025 TTEC Digital TTEC Digital launches Angel Associate Assist TTEC Digital announced an agent-assistance product that supplies relevant knowledge, suggested responses and workflow guidance during customer conversations. Read the source Industry context 6 June 2023 Consumer Financial Protection Bureau Chatbots in consumer finance The CFPB describes risks from inaccurate chatbot responses and customers being unable to reach human support, particularly when financial questions become complex. Read the source These are industry references, not OriginChainDB customer stories. The implementation above is a proposed example. Build with OriginChainDB Discuss your application with us. Explore use cases Talk to our team --- ## Capital markets use cases and data models | OriginChainDB Canonical source: https://originchaindb.com/industries/capital-markets Capital markets Search company filings by issuer. Find reported figures, relevant passages and verified entity relationships. Keep each result tied to its filing, reporting period and original disclosure. Explore use cases Talk to our team Issuer research Connect an issuer’s filing to the entities it describes. Illustrative use case 01 / Use case guide 10 practical use cases. Compare the data models behind everyday industry tasks, from finding records to following connections. SQL Filter and calculate Vector Match similar meaning Graph Follow relationships Full-text Find words and phrases ✓ Suggested model combination Scroll across to compare all four models Capital markets: 10 use cases, suggested query models and industry references. Use case How the data models help SQL Vector Graph Full-text Source 01 Reported financial fact comparison Compare issuer disclosures without mixing reporting periods, units or amendments. Use SQL to select facts by issuer, period and unit, and Full-text to retrieve the corresponding filing passages for verification. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [1] [2] 02 Financing disclosure research Find passages explaining an issuer's liquidity, financing needs and uncertainties. Use SQL to scope issuer filings, Vector to retrieve related financing discussions, and Full-text to locate named facilities and exact terms. SQL included Vector included — Graph not needed for this example Full-text included [2] 03 Legal entity parent review Inspect reported accounting-parent relationships while preserving dates and exceptions. Use SQL to filter dated LEI records and Graph to trace reported direct and ultimate accounting-parent links without inferring missing relationships. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [3] 04 Corporate action evidence review Connect an event announcement with its recorded entitlements and instructions. Use SQL to select event dates and statuses, Graph to trace event–security–instruction links, and Full-text to retrieve announcement terms. SQL included — Vector not needed for this example Graph included Full-text included [4] 05 Trade allocation exception review Investigate mismatches between an institutional trade block and its allocations. Use SQL to compare recorded quantities and matching statuses, and Graph to trace allocations back to their trade block and counterparties. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [5] 06 Settlement exception investigation Assemble trade status and correspondence across custodians when settlement breaks. Use SQL to select unsettled items, Graph to trace the custody chain, and Full-text to retrieve relevant exception messages. SQL included — Vector not needed for this example Graph included Full-text included [6] 07 Settlement instruction change review Identify trades affected by an amended or incomplete standing settlement instruction. Use SQL to select instruction versions and pending trades, and Graph to trace the account, custodian and instruction dependencies. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [7] 08 Collateral agreement term review Find agreement terms behind a disagreement over a margin call. Use SQL to retrieve the recorded call inputs and agreement version, and Full-text to locate threshold, currency and transfer-amount clauses. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [8] 09 Margin dispute investigation support Investigate missing trades, valuation differences and collateral discrepancies in a disputed call. Use SQL to compare supplied positions and balances, Graph to trace trade–agreement links, and Vector to retrieve similar resolved dispute notes. SQL included Vector included Graph included — Full-text not needed for this example [8] 10 Trade report correction tracing Recover the original report and correction history before operations amend a TRACE submission. Use SQL to select report dates and statuses, Graph to trace correction lineage, and Full-text to locate exact control numbers in supporting messages. SQL included — Vector not needed for this example Graph included Full-text included [9] Use the query interfaces you need, then connect their results through shared record IDs in your application. Industry sources 9 These sources describe real industry workflows. The model combinations above are proposed OriginChainDB designs, not customer deployment claims. U.S. Securities and Exchange Commission — EDGAR Application Programming Interfaces (opens in a new tab) U.S. Securities and Exchange Commission — How to Read a 10-K/10-Q (opens in a new tab) Global Legal Entity Identifier Foundation — Level 2 Data: Who Owns Whom (opens in a new tab) DTCC — Corporate Actions Technical Documentation Hub (opens in a new tab) DTCC — Trade Allocation and Matching: CTM (opens in a new tab) DTCC — An Asset Manager's Approach to Managing Trade Exceptions (opens in a new tab) DTCC — Standing Settlement Instruction Management: ALERT (opens in a new tab) International Swaps and Derivatives Association — Collateral Management Suggested Operational Practices (opens in a new tab) FINRA — TRAQS Corporate Bonds and Agency Debt User Guide (opens in a new tab) 02 / A closer look Reviewing a new financing disclosure A company files an update about a financing arrangement. An analyst needs the latest disclosed figures, relevant debt wording and the entities involved, while keeping amendments and reporting periods separate. What makes it difficult 01 Company names, tickers and legal entities are not interchangeable. 02 A reported figure may use a different unit or period. 03 A current filing can amend or add context to an earlier one. Suggested approach Resolve the issuer before comparing filings Match the legal entity and preserve each figure’s unit and reporting period. Search related disclosures and show amendments or conflicting values for the analyst to review. 03 / Queries What each data model does Select a model to see the question it answers. SQL · Find the facts The question Which disclosed facts belong to this issuer and quarter? Filter filings and reported facts by issuer, period and unit. Explore SQL Vector · Match the meaning The question Which disclosures discuss pressure on refinancing? Retrieve passages describing similar financial themes. Explore Vector Graph · Follow the connections The question Which disclosed entities are connected to this issuer? Follow verified issuer, subsidiary and parent relationships. Explore Graph Full-text · Find the exact wording The question Where is this credit agreement referenced? Locate exact facility names, instruments and filing terms. Explore Full-text Use shared record IDs to combine results from the different query interfaces in your application. 04 / Implementation How to build it STEP 01 Choose issuers and questions Use public or licensed filings for a defined issuer set. Have analysts mark the relevant passages and figures. STEP 02 Preserve filing identifiers Map CIK and LEI identifiers with reviewed rules. Keep accession numbers, periods, units, amendments and source URLs. Maintain explicit entity links and search indexes. STEP 03 Build the research view Retrieve facts for the issuer and period, search disclosures and follow verified relationships. Display conflicting values and unresolved entity matches. STEP 04 Replay filing events Test amendments and company-name changes against original disclosures. Monitor source updates and have analysts review the pilot results. 05 / Testing What to measure Compare these results with your current process before rollout. Entity resolution quality Count incorrect and unresolved issuer or parent matches in a reviewed test set. Fact traceability Verify that each figure retains its source filing, unit and reporting period. Disclosure freshness Measure source-to-index delay and the handling of amendments or replaced documents. Analysts verify the disclosures Your application handles source access, ingestion, entity matching and ranking. Trading decisions and execution remain in the appropriate research and market systems. Security 06 / Sources Examples from the industry Published projects and reference material relevant to this use case. Industry example Updated 8 April 2025 U.S. Securities and Exchange Commission Public filings and structured financial facts The SEC exposes filing histories and extracted XBRL financial data through EDGAR APIs, including company identifiers, filing metadata and facts with measurement context. Read the source Industry context Accessed 3 November 2026 GLEIF Verified legal-entity parent relationships GLEIF’s Level 2 data reports direct and ultimate accounting-consolidating parent relationships, with links between LEI records where those identifiers are available. Read the source These are industry references, not OriginChainDB customer stories. The implementation above is a proposed example. Build with OriginChainDB Discuss your application with us. Explore use cases Talk to our team --- ## E-commerce & retail use cases and data models | OriginChainDB Canonical source: https://originchaindb.com/industries/ecommerce-retail E-commerce & retail Find relevant products that are available. Match a shopper’s words to product descriptions, then check price, stock and compatibility. Use the same product IDs across search results and inventory records. Explore use cases Talk to our team Product discovery Match a rainy-commute search to an available waterproof bag. Illustrative use case 01 / Use case guide 10 practical use cases. Compare the data models behind everyday industry tasks, from finding records to following connections. SQL Filter and calculate Vector Match similar meaning Graph Follow relationships Full-text Find words and phrases ✓ Suggested model combination Scroll across to compare all four models E-commerce & retail: 10 use cases, suggested query models and industry references. Use case How the data models help SQL Vector Graph Full-text Source 01 Find products by need Shoppers describe a use or occasion instead of a product name. Vector matches the request to product descriptions; SQL checks price, stock and available sizes. SQL included Vector included — Graph not needed for this example — Full-text not needed for this example [1] [2] 02 Look up product models Shoppers need a specific model among similar catalog entries. Full-text finds model names in catalog text; SQL filters the matching products by variant and availability. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [2] 03 Suggest related alternatives A shopper needs another option when a selected product is unavailable. Vector finds products with similar descriptions; SQL keeps alternatives within the shopper's price and stock limits. SQL included Vector included — Graph not needed for this example — Full-text not needed for this example [3] 04 Recommend complementary products Shoppers need useful additions to the product they selected. Graph follows curated links to complementary products; SQL checks that each suggested item is active and in stock. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [3] 05 Check product bundle stock A bundle cannot be offered unless enough component items are available. Graph connects bundles to their components; SQL compares component quantities with stock to calculate available bundles. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [4] 06 Track stock between stores Store staff need to find a delayed inventory transfer. SQL filters transfers by origin, destination and status; Full-text finds transfer references and notes. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [5] 07 Explain order delivery status A customer needs the latest delivery status for each shipment. Graph connects an order to its items and shipments; SQL retrieves the latest tracking status and update time. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [6] 08 Check return request eligibility Staff must check whether a purchased item can still be returned. SQL checks purchase dates, market and item status; Full-text retrieves the return policy that applied to the order. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [7] 09 Find exchange size options A customer wants a different size of a returned item. Graph links the purchased item to its size variants; SQL checks stock and price differences before staff confirm the exchange. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [8] 10 Review common return reasons Merchants need to see which product problems drive repeated returns. SQL counts returns by recorded reason, product, size and period so merchants can review recurring problems. SQL included — Vector not needed for this example — Graph not needed for this example — Full-text not needed for this example [8] Use the query interfaces you need, then connect their results through shared record IDs in your application. Industry sources 8 These sources describe real industry workflows. The model combinations above are proposed OriginChainDB designs, not customer deployment claims. Amazon Science — The technology behind Amazon's GenAI-powered shopping assistant, Rufus (opens in a new tab) Shopify — Storefront search (opens in a new tab) Shopify — Customize product recommendations with Shopify Search & Discovery (opens in a new tab) Shopify — Eligibility and considerations for using product bundles (opens in a new tab) Shopify — Viewing and searching your inventory transfers (opens in a new tab) Shopify — Order status page (opens in a new tab) Shopify — Setting up return and cancellation rules (opens in a new tab) Shopify — Creating returns and exchanges (opens in a new tab) 02 / A closer look Finding a waterproof commuter bag under $80 A shopper asks for a waterproof commuter bag under $80. The description mentions weather protection, stock lives in another feed, and accessories are linked elsewhere. Keyword matching alone misses part of the request. What makes it difficult 01 Shopper language differs from catalog wording. 02 A relevant result may be unavailable or over budget. 03 Product variants and compatible accessories need context. Suggested approach Combine intent search with stock filters Use vector search to find suitable descriptions, SQL to check price and stock, and Graph to find compatible accessories. Rank eligible products in your application. 03 / Queries What each data model does Select a model to see the question it answers. SQL · Find the facts The question Only show in-stock bags below $80. Check price, size, stock and market availability. Explore SQL Vector · Match the meaning The question Find products suited to a rainy commute. Match the shopper's intent to product descriptions. Explore Vector Graph · Follow the connections The question Which replacement straps fit this bag? Follow links between variants, products and accessories. Explore Graph Full-text · Find the exact wording The question Find descriptions that mention waterproof fabric. Locate exact materials, model names and care terms. Explore Full-text Use shared record IDs to combine results from the different query interfaces in your application. 04 / Implementation How to build it STEP 01 Choose a catalog category Use authorized products, inventory data and search queries with customer details removed. Define price, stock and market filters. STEP 02 Link products and variants Keep stable product IDs, description versions and source timestamps. Record accessory compatibility. Your ingestion pipeline updates records, embeddings and search indexes. STEP 03 Filter search candidates Combine result IDs in the application, check current product attributes and rank eligible items. Show the description that explains the match. STEP 04 Compare search results Evaluate the same queries against existing search. Check poor matches and unavailable products before a limited rollout. Recheck price and stock at checkout. 05 / Testing What to measure Compare these results with your current process before rollout. Search relevance Measure how many top results satisfy human-reviewed shopping intents. Availability accuracy Track recommendations that fail the latest stock or price check. Update freshness Measure the delay between a catalog change and its searchable version. Checkout confirms availability Search results do not reserve inventory. Your commerce services control final prices, stock commitments, payments and orders. Security 06 / Sources Examples from the industry Published projects and reference material relevant to this use case. Industry example 4 October 2024 Amazon Science The technology behind Amazon's GenAI-powered shopping assistant, Rufus Amazon's technical account describes conversational shopping that answers product questions, compares options and makes recommendations using product information. Read the source Industry context 8 January 2025 GS1 How long will the transition to 2D barcodes take? GS1 describes a gradual retail transition in which existing barcodes and richer 2D formats coexist while systems and point-of-sale capabilities are updated. Read the source These are industry references, not OriginChainDB customer stories. The implementation above is a proposed example. Build with OriginChainDB Discuss your application with us. Explore use cases Talk to our team --- ## Financial services & payments use cases and data models | OriginChainDB Canonical source: https://originchaindb.com/industries/financial-services-payments Financial services & payments Resolve unmatched payments. Match payments to invoices using transaction details, remittance messages and settlement records. Show operators which references match and which differences need checking. Explore use cases Talk to our team Payment reconciliation Compare a payment reference with the invoice it may settle. Illustrative use case 01 / Use case guide 10 practical use cases. Compare the data models behind everyday industry tasks, from finding records to following connections. SQL Filter and calculate Vector Match similar meaning Graph Follow relationships Full-text Find words and phrases ✓ Suggested model combination Scroll across to compare all four models Financial services & payments: 10 use cases, suggested query models and industry references. Use case How the data models help SQL Vector Graph Full-text Source 01 Payment to invoice matching Operations teams need candidates for payments with incomplete remittance references. SQL checks amounts and currencies, Full-text finds invoice references, and Vector suggests similar invoice descriptions for operator review. SQL included Vector included — Graph not needed for this example Full-text included [1] 02 Cross border payment tracing Support teams need to locate a delayed payment along its processing route. SQL retrieves timestamped payment statuses, while Graph follows linked intermediary and beneficiary events. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [2] 03 Merchant payout batch reconciliation Finance teams need to explain the difference between sales totals and bank payouts. SQL totals charges, fees and adjustments, while Graph traces each payout to its recorded settlement transactions. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [3] 04 Card dispute evidence gathering Dispute teams need relevant receipts, delivery records and customer correspondence. SQL selects the dispute and deadline, Graph links order and delivery evidence, and Full-text finds relevant customer messages. SQL included — Vector not needed for this example Graph included Full-text included [4] 05 Missing refund status investigation Support teams need trace references for a refund that a customer cannot see. SQL retrieves refund status and network references, while Full-text finds those references in support correspondence. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [5] 06 Payment decline pattern analysis Operations teams need to distinguish issuer declines from blocked payments and integration errors. SQL groups failure codes and excludes repeat attempts, while Vector finds similar incident descriptions for troubleshooting. SQL included Vector included — Graph not needed for this example — Full-text not needed for this example [6] 07 Merchant onboarding document review Onboarding teams need to resolve inconsistent business, identity and payout details. SQL checks verification status, Graph connects merchant entities and documents, and Full-text finds names in submitted evidence. SQL included — Vector not needed for this example Graph included Full-text included [7] 08 Subscription payment failure review Billing teams need to understand which failed invoices still need customer follow-up. SQL selects unpaid invoices and retry history, while Graph traces subscriptions to their configured payment methods. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [8] 09 Beneficiary payment detail checks Operators need to resolve account and routing discrepancies before resubmitting a payment. SQL compares stored payment fields with validation results, while Full-text retrieves the original beneficiary instructions. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [9] 10 Payment screening exception review Compliance teams need the message context behind a flagged payment. SQL retrieves the payment and screening result, while Full-text locates party names and remittance wording for analyst review. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [10] Use the query interfaces you need, then connect their results through shared record IDs in your application. Industry sources 10 These sources describe real industry workflows. The model combinations above are proposed OriginChainDB designs, not customer deployment claims. Scotiabank — The new language of payments: structured remittance and reconciliation (opens in a new tab) Swift — Closing the case on payment investigations (opens in a new tab) Stripe — Payout reconciliation report (opens in a new tab) Stripe — Respond to disputes (opens in a new tab) Stripe — How to trace a refund using reference numbers (opens in a new tab) Stripe — Payment declines and failure analysis (opens in a new tab) Adyen — Onboarding guidelines and verification issues (opens in a new tab) Stripe — Failed subscription and invoice payment retries (opens in a new tab) Swift — Payment Pre-validation: beneficiary account verification (opens in a new tab) Swift — Transaction Screening (opens in a new tab) 02 / A closer look A payment arrives without a usable invoice reference A payment reaches the bank but cannot be matched confidently to an invoice. A reference is incomplete, fees change the amount, and the remittance explanation lives in a message. Operations must distinguish a valid match from a coincidence. What makes it difficult 01 Payment, invoice and settlement identifiers do not always align. 02 Amounts differ because of fees, partial payments or currency conversion. 03 An exception needs an explanation, not just a suggested match. Suggested approach Exact matching first Match references, currencies and amounts using approved rules. For unresolved payments, search remittance wording for possible invoices and send the candidates to an operator. 03 / Queries What each data model does Select a model to see the question it answers. SQL · Find the facts The question Which open invoices match this currency, account and permitted amount range? Apply the matching rules. Explore SQL Vector · Match the meaning The question Which invoice descriptions resemble this remittance explanation? Suggest a candidate from wording. Explore Vector Graph · Follow the connections The question Which invoice, batch and settlement events connect to this payment? Trace the payment lifecycle. Explore Graph Full-text · Find the exact wording The question Which remittance messages contain this invoice number? Locate exact message references. Explore Full-text Use shared record IDs to combine results from the different query interfaces in your application. 04 / Implementation How to build it STEP 01 Define matching rules Choose one payment rail. Set currency and amount tolerances, and decide which exceptions require an operator. Use masked historical records. STEP 02 Preserve payment references Link payment, invoice and settlement IDs. Keep original messages, timestamps and corrected versions. Index the remittance text. STEP 03 Show candidate matches Run exact checks first. Search descriptions for unresolved payments. Your application ranks candidates and shows the references and differences behind each suggestion. STEP 04 Check known exceptions Compare with approved matches. Include duplicate payments, reversals and partial payments. Measure false matches before introducing assisted review. 05 / Testing What to measure Compare these results with your current process before rollout. False matches Track suggestions that operators reject, especially wrong-counterparty and duplicate matches. Exception resolution time Compare time to gather evidence and resolve equivalent exception categories. Record freshness Measure delay between settlement updates and their appearance in the review workspace. Settlement stays in your payment system OriginChainDB stores and retrieves the records. Your payment platform controls accounting entries, settlement, approvals and reversals. Security 06 / Sources Examples from the industry Published projects and reference material relevant to this use case. Industry example 6 May 2025 Scotiabank Structured payment data for reconciliation Scotiabank describes embedding ISO 20022 into its systems and using richer remittance information to support payment-to-invoice reconciliation. This is Scotiabank’s own industry example, not an OriginChainDB customer story. Read the source Industry context Reviewed November 2026 Swift ISO 20022 for financial institutions Swift explains how richer payment information can support reconciliation and reduce manual correction and investigation. Adopting a message standard still leaves downstream systems responsible for using that information effectively. Read the source These are industry references, not OriginChainDB customer stories. The implementation above is a proposed example. Build with OriginChainDB Discuss your application with us. Explore use cases Talk to our team --- ## Healthcare use cases and data models | OriginChainDB Canonical source: https://originchaindb.com/industries/healthcare Healthcare Find approved operating procedures. Retrieve current nonclinical procedures by service and location. Show the document version and responsible team, using synthetic requests for the pilot. Explore use cases Talk to our team Procedure lookup Find the current intake procedure and the team responsible. Illustrative use case 01 / Use case guide 10 practical use cases. Compare the data models behind everyday industry tasks, from finding records to following connections. SQL Filter and calculate Vector Match similar meaning Graph Follow relationships Full-text Find words and phrases ✓ Suggested model combination Scroll across to compare all four models Healthcare: 10 use cases, suggested query models and industry references. Use case How the data models help SQL Vector Graph Full-text Source 01 Find referral service options A coordinator needs service locations matching an already approved referral. Vector matches service wording; SQL filters location and appointment availability; Graph links services to providers and sites for staff review. SQL included Vector included Graph included — Full-text not needed for this example [1] 02 Find available appointment slots An accepted referral is waiting for an appointment. SQL lists available slots for the required service; Graph connects the referral, service and booking request for scheduling staff. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [1] [2] 03 Follow up unbooked referrals Referral staff need to find requests still waiting for a booking. SQL filters referrals by booking state and age; Graph connects each request to contact attempts and the responsible provider. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [3] [2] 04 Check referral document completeness A referral is missing an attachment required by the receiving service. Full-text retrieves the service's submission instructions; Graph links the referral to attachments; SQL checks required document flags and submission dates. SQL included — Vector not needed for this example Graph included Full-text included [3] [4] 05 Review insurance coverage details Registration staff need the latest eligibility and benefit response before a visit. SQL retrieves the latest payer response, including service coverage, deductibles, copayments and network differences, for registration staff. SQL included — Vector not needed for this example — Graph not needed for this example — Full-text not needed for this example [5] 06 Check prior authorization requirements Administrative staff need the payer's documentation checklist for a planned service. SQL selects the payer, service and current requirement version; Full-text retrieves the required document list for staff review. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [6] 07 Track prior authorization responses Staff need to see whether a request was approved, denied or returned for more information. SQL filters authorization responses by status and date; Graph connects each response to its request and requested supporting documents. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [6] 08 Check outstanding claim status Billing staff need the latest payer status for unpaid claims. SQL lists unpaid claims and response timestamps; Graph connects each claim to its status inquiries and payer replies. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [7] 09 Explain claim payment adjustments Billing staff need to understand why a claim payment differs from the billed amount. SQL retrieves adjustment amounts at claim and line level; Full-text finds the supplied reason codes and their published explanations. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [8] 10 Reconcile remittances with claims A remittance covers several claims and must be matched to the right accounts. Graph links remittances to claims and claim lines; SQL compares payments and adjustments with the recorded account balances. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [8] Use the query interfaces you need, then connect their results through shared record IDs in your application. Industry sources 8 These sources describe real industry workflows. The model combinations above are proposed OriginChainDB designs, not customer deployment claims. NHS England Digital — e-Referral Service (opens in a new tab) NHS England Digital — Appointment slot issues within the NHS e-Referral Service (opens in a new tab) NHS England Digital — Referring a patient - NHS e-Referral Service (opens in a new tab) NHS England Digital — Directory of Services: creating and maintaining services (opens in a new tab) Centers for Medicare & Medicaid Services — Operating Rules for Eligibility and Claims Status (opens in a new tab) Centers for Medicare & Medicaid Services — CMS Interoperability and Prior Authorization Final Rule CMS-0057-F (opens in a new tab) Centers for Medicare & Medicaid Services — Claim Status Request and Response (opens in a new tab) Centers for Medicare & Medicaid Services — Health Care Payment and Remittance Advice (opens in a new tab) 02 / A closer look Finding the current intake procedure A coordinator needs the intake procedure for a particular service and site. The same process has several names, an older document is still searchable, and responsibility has moved to another team. This demonstration uses synthetic requests and nonclinical procedures. What makes it difficult 01 Staff describe the same process in different ways. 02 Retired procedures can appear alongside current versions. 03 Service, site and process ownership need to stay connected. Suggested approach Filter by service, site and approval date Search staff wording against approved procedures, then return the active version and its owner. Retired documents should be excluded from current guidance. 03 / Queries What each data model does Select a model to see the question it answers. SQL · Find the facts The question Show the active intake procedure for this site. Filter by site, service, approval status and effective date. Explore SQL Vector · Match the meaning The question Find the process for arranging a first appointment. Match staff wording to approved operational guidance. Explore Vector Graph · Follow the connections The question Which team owns this service's intake process? Link services, locations, procedures and accountable teams. Explore Graph Full-text · Find the exact wording The question Find the procedure that references form IN-014. Locate exact form codes and wording in approved documents. Explore Full-text Use shared record IDs to combine results from the different query interfaces in your application. 04 / Implementation How to build it STEP 01 Choose nonclinical documents Use approved operational procedures and synthetic requests with no patient information. Define access rules and questions that require staff help. STEP 02 Record versions and owners Store procedure IDs, approval dates and source links. Connect services and teams. Retire old versions and refresh text and vector indexes after changes. STEP 03 Show the approved source Apply access and version filters before retrieving passages. Display the current document and owner. Route missing or conflicting guidance to staff. STEP 04 Review with staff Test retired documents, ambiguous questions and restricted access. Keep staff review during the pilot and remain within the approved nonclinical scope. 05 / Testing What to measure Compare these results with your current process before rollout. Current-source accuracy Check how often results point to the active procedure for the requested service and site. Citation validity Verify that each answer is supported by the linked document and version. Access isolation Test that users cannot retrieve documents outside their authorized scope. HIPAA readiness: coming soon This demonstration uses synthetic or appropriately deidentified data. Confirm service scope, safeguards and any required business associate agreement before processing protected health information. It does not provide clinical advice. Security 06 / Sources Examples from the industry Published projects and reference material relevant to this use case. Industry example 7 June 2023 Google Cloud & Mayo Clinic Google Cloud collaborates with Mayo Clinic on generative AI The organizations announced Mayo Clinic as an early adopter exploring enterprise search to help staff find information and support healthcare and administrative workflows. Read the source Industry context HHS guidance U.S. Department of Health & Human Services Guidance on HIPAA & Cloud Computing HHS explains that cloud providers handling electronic protected health information for covered entities or business associates can have HIPAA obligations, including an appropriate business associate agreement. Read the source These are industry references, not OriginChainDB customer stories. The implementation above is a proposed example. Build with OriginChainDB Discuss your application with us. Explore use cases Talk to our team --- ## Insurance use cases and data models | OriginChainDB Canonical source: https://originchaindb.com/industries/insurance Insurance Find the evidence for each claim. Retrieve the policy in force, relevant clauses and supporting documents for a claim. Help handlers identify what is missing before reviewing coverage. Explore use cases Talk to our team Motor claim review Find repair evidence and the policy terms for a motor claim. Illustrative use case 01 / Use case guide 10 practical use cases. Compare the data models behind everyday industry tasks, from finding records to following connections. SQL Filter and calculate Vector Match similar meaning Graph Follow relationships Full-text Find words and phrases ✓ Suggested model combination Scroll across to compare all four models Insurance: 10 use cases, suggested query models and industry references. Use case How the data models help SQL Vector Graph Full-text Source 01 Claims coverage evidence review Find the policy wording and endorsements relevant to a reported loss. Use SQL to select the policy version on the loss date and Full-text to locate exact clauses for the handler. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [1] 02 Claims intake document routing Associate incoming evidence with the correct claim and policy. Use SQL to filter open claims, Graph to follow recorded claim–policy links, and Full-text to locate supplied claim references. SQL included — Vector not needed for this example Graph included Full-text included [2] [1] 03 Medical claim document review Find relevant passages across a claim's medical documents. Use SQL to scope the claim and document dates, Vector to retrieve related descriptions, and Full-text to find exact medical terms. SQL included Vector included — Graph not needed for this example Full-text included [2] 04 Underwriting submission evidence review Bring exposure data, loss histories and risk reports into an underwriter's review. Use SQL to select submission records, Vector to retrieve related risk narratives, and Full-text to locate exact loss references. SQL included Vector included — Graph not needed for this example Full-text included [3] 05 Connected claims investigation support Examine recurring parties across claims referred for investigation. Use SQL to scope referred claims by date and Graph to trace documented claimant, vehicle and provider connections for investigators. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [4] 06 Delegated risk data checks Investigate missing or inconsistent fields in coverholder risk reports. Use SQL to surface missing fields and duplicate references, and Full-text to find the corresponding binder wording for review. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [5] 07 Premium bordereau reconciliation Trace premium reporting discrepancies to the relevant binder and reporting party. Use SQL to compare reported premium records by period and Graph to trace their binder, coverholder and managing-agent relationships. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [5] 08 Delegated claims authority review Verify the administrator's recorded appointment before routing a claim. Use SQL to filter appointment records, Graph to follow administrator–managing-agent relationships, and Full-text to retrieve the documented scope of authority. SQL included — Vector not needed for this example Graph included Full-text included [6] 09 Catastrophe forecast evidence checks Explain differences between catastrophe forecast returns and supporting scenarios. Use SQL to compare reported snapshots, Graph to connect returns to supplied model-run records, and Full-text to retrieve scenario assumptions. SQL included — Vector not needed for this example Graph included Full-text included [7] 10 Catastrophe loss reporting support Assemble claims associated with a named catastrophe for reporting review. Use SQL to select reporting periods, Graph to follow recorded claim–event links, and Full-text to find the catastrophe's official description. SQL included — Vector not needed for this example Graph included Full-text included [8] Use the query interfaces you need, then connect their results through shared record IDs in your application. Industry sources 8 These sources describe real industry workflows. The model combinations above are proposed OriginChainDB designs, not customer deployment claims. Allianz — Smarter claims management, smoother settlements (opens in a new tab) Zurich Insurance — AI at Zurich: medical document intelligence and claims intake (opens in a new tab) Zurich North America — AI tool brings real-world value to Zurich USMM underwriters (opens in a new tab) National Insurance Crime Bureau — Staged and Caused Accident Investigation Guide (opens in a new tab) LIMOSS — Delegated Data Manager: binder and bordereaux management (opens in a new tab) Lloyd's — Delegated Claims Administrators: appointment and oversight (opens in a new tab) Lloyd's — 2027 Capital and Planning: Catastrophe Risk (opens in a new tab) Lloyd's — Catastrophe Codes and Major Loss Reporting (opens in a new tab) 02 / A closer look Checking a repair estimate against the policy A repair estimate arrives after a claim has been opened. The handler must check the policy version in force, find the relevant clause and identify which evidence is still missing before making a decision. What makes it difficult 01 Policy wording and endorsements live in separate files. 02 The same damage is described differently in each document. 03 An incomplete evidence pack causes another follow-up. Suggested approach Match the claim to the policy version Use the loss date to select the applicable policy. Search its clauses and linked claim documents, then show missing evidence to the handler. 03 / Queries What each data model does Select a model to see the question it answers. SQL · Find the facts The question Which policy covered this vehicle on the loss date? Select the claim, loss date and policy version. Explore SQL Vector · Match the meaning The question Which passages describe damage like this repair report? Retrieve similar descriptions from approved claim documents. Explore Vector Graph · Follow the connections The question Which documents and parties belong to this claim? Follow declared links between claim, policy, vehicle and repairer. Explore Graph Full-text · Find the exact wording The question Where does the policy mention the excess or exclusion? Locate exact clause names, reference numbers and terms. Explore Full-text Use shared record IDs to combine results from the different query interfaces in your application. 04 / Implementation How to build it STEP 01 Choose one claim type Use authorized closed claims with unnecessary personal data removed. Have handlers identify the documents and clauses required for each review. STEP 02 Link claims and documents Assign claim, policy and passage IDs. Store effective dates and file references. Your ingestion pipeline extracts text and maintains search indexes and embeddings. STEP 03 Retrieve within the claim Filter by access and policy dates. Search relevant wording and follow document links. Show the source passages and missing inputs in the handler’s screen. STEP 04 Compare with handler reviews Check policy versions, missing evidence and incorrect matches against closed cases. Pilot with handlers while keeping claim decisions in the existing approval process. 05 / Testing What to measure Compare these results with your current process before rollout. Evidence completeness Compare the retrieved pack with the documents handlers marked as required. Correct policy version Check whether each cited clause belongs to the policy effective on the loss date. Review effort Compare time spent finding evidence against the existing workflow, without assuming a saving. Claims handlers retain approval The application manages extraction, index updates and business rules. Authorized insurance systems and reviewers control coverage decisions, reserves and payments. Security 06 / Sources Examples from the industry Published projects and reference material relevant to this use case. Industry example 5 February 2025 Allianz Insurance Copilot supports claims handlers Allianz describes an Insurance Copilot launched for automotive claims in Austria, helping adjusters ask questions and navigate case information. Read the source Industry context Accessed 3 November 2026 Zurich Insurance Document intelligence and claims intake Zurich identifies medical document intelligence and automated claims intake among its insurance AI use cases, alongside responsible AI practices. Read the source These are industry references, not OriginChainDB customer stories. The implementation above is a proposed example. Build with OriginChainDB Discuss your application with us. Explore use cases Talk to our team --- ## Lending use cases and data models | OriginChainDB Canonical source: https://originchaindb.com/industries/lending Lending Review loan applications with their source documents. Find missing documents, conflicting borrower details and the applicable lending policy. Keep the source and date visible for the underwriter. Explore use cases Talk to our team Application review Check the application documents and identify what is missing. Illustrative use case 01 / Use case guide 10 practical use cases. Compare the data models behind everyday industry tasks, from finding records to following connections. SQL Filter and calculate Vector Match similar meaning Graph Follow relationships Full-text Find words and phrases ✓ Suggested model combination Scroll across to compare all four models Lending: 10 use cases, suggested query models and industry references. Use case How the data models help SQL Vector Graph Full-text Source 01 Loan application completeness review Underwriters need to identify missing or inconsistent application evidence. SQL checks required application fields, while Graph links each borrower claim to its submitted supporting documents. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [1] 02 Self employed income evidence review Underwriters need to reconcile business income across tax returns and financial statements. SQL compares income periods, Vector retrieves relevant income guidance, and Full-text locates supporting tax schedules for underwriter review. SQL included Vector included — Graph not needed for this example Full-text included [2] 03 Property appraisal evidence review Collateral reviewers need to investigate inconsistent property facts and appraisal commentary. SQL compares recorded property facts, Vector finds relevant review guidance, and Full-text retrieves the appraiser's supporting explanations. SQL included Vector included — Graph not needed for this example Full-text included [3] 04 Business loan covenant monitoring Credit teams need to check reported financials against agreed loan conditions. SQL calculates agreed reporting measures, while Full-text retrieves the covenant clauses for a credit officer's review. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [4] 05 Construction loan draw review Loan administrators need inspections, budgets and lien records before reviewing a draw request. SQL compares requested draws with budgets, Graph links inspections and lien records, and Full-text retrieves unresolved inspection findings. SQL included — Vector not needed for this example Graph included Full-text included [5] 06 Mortgage closing document comparison Closing teams need to explain changes between loan estimates and final disclosures. SQL compares recorded rates and fees, while Full-text retrieves explanations in the corresponding document versions. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [6] 07 Mortgage escrow discrepancy investigation Servicers need to explain mismatches among escrow collections, tax bills and insurance payments. SQL reconciles escrow amounts and dates, while Graph links the loan to tax bills, insurance invoices and disbursements. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [7] 08 Borrower hardship package review Servicing specialists need complete, current evidence before assessing a request for mortgage assistance. SQL checks document dates and completeness, Vector retrieves relevant assistance guidance, and Full-text finds supporting hardship statements for specialist review. SQL included Vector included — Graph not needed for this example Full-text included [8] 09 Loan credit reporting dispute review Servicers need to investigate a borrower's disputed balance or repayment history. SQL compares ledger and reported values, Graph links reporting submissions to the loan, and Full-text retrieves the borrower's evidence. SQL included — Vector not needed for this example Graph included Full-text included [9] 10 Loan payoff quote verification Servicers need to explain why a dated payoff quote differs from the displayed balance. SQL reconciles principal, accrued interest and recorded fees, while Full-text retrieves relevant payoff terms for servicing review. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [10] Use the query interfaces you need, then connect their results through shared record IDs in your application. Industry sources 10 These sources describe real industry workflows. The model combinations above are proposed OriginChainDB designs, not customer deployment claims. Fannie Mae — Contents of the Application Package (opens in a new tab) Fannie Mae — Underwriting Factors and Documentation for a Self-Employed Borrower (opens in a new tab) Fannie Mae — Review of the Appraisal Report (opens in a new tab) Office of the Comptroller of the Currency — Comptroller's Handbook: Commercial Loans (opens in a new tab) Office of the Comptroller of the Currency — Comptroller's Handbook: Commercial Real Estate Lending (opens in a new tab) Consumer Financial Protection Bureau — Review documents before closing (opens in a new tab) Consumer Financial Protection Bureau — Problems with escrow or impound accounts (opens in a new tab) Fannie Mae — Receiving a Borrower Response Package (opens in a new tab) Consumer Financial Protection Bureau — How to dispute an error on a credit report (opens in a new tab) Consumer Financial Protection Bureau — Payoff amounts and current balances (opens in a new tab) 02 / A closer look Checking an incomplete business loan application A small-business applicant submits documents across several channels. The reviewer must reconcile consented account information, business identifiers and the current lending policy before requesting more evidence. What makes it difficult 01 Different submissions can describe the same business differently. 02 Missing or outdated evidence creates repeated follow-ups. 03 A reviewer needs the applicable policy version, not the nearest-sounding passage. Suggested approach Check completeness before eligibility Use structured checks for required borrower facts. Search approved policy documents for supporting clauses, restricted to the correct loan product and policy version. 03 / Queries What each data model does Select a model to see the question it answers. SQL · Find the facts The question Which required fields are missing or inconsistent for this application? Check structured evidence. Explore SQL Vector · Match the meaning The question Which approved policy passages address irregular business income? Find relevant policy explanations. Explore Vector Graph · Follow the connections The question Which documents and consent records belong to this borrower and business? Connect the application and its evidence. Explore Graph Full-text · Find the exact wording The question Where does this application number or policy clause appear? Match exact identifiers and terms. Explore Full-text Use shared record IDs to combine results from the different query interfaces in your application. 04 / Implementation How to build it STEP 01 Choose a loan product Use de-identified applications and an underwriter-approved checklist. Define permitted data uses, retention and reviewer access. STEP 02 Record document provenance Keep application, business, document and consent IDs. Store dates, extraction confidence and policy versions. Update indexes when documents change or consent is withdrawn. STEP 03 Build the review brief Select the application and policy version with SQL. Retrieve relevant passages and linked documents. Mark missing or conflicting facts in the application. STEP 04 Review with underwriters Compare completed applications with expert annotations. Test outdated policies, withdrawn consent and restricted documents before a supervised pilot. 05 / Testing What to measure Compare these results with your current process before rollout. Evidence completeness Compare the brief against an underwriter-authored checklist for each application. Policy accuracy Check whether retrieved passages belong to the correct product, jurisdiction and effective version. Follow-up effort Measure repeated requests caused by missing, inconsistent or hard-to-find evidence. The lender makes the credit decision Retrieval helps find evidence. Eligibility, affordability, fairness checks and approval remain in the lender’s decision process. Security 06 / Sources Examples from the industry Published projects and reference material relevant to this use case. Industry example 24 May 2023 FinBox & IIFL Finance Cash-flow and GST-based business lending FinBox reports working with IIFL Finance on an MSME lending product using cash-flow and GST data through the Account Aggregator ecosystem. This documents a real lending workflow, not an OriginChainDB implementation. Read the source Industry context October 2026 Sahamati & CRIF Consent to Credit: Account Aggregator impact report The report describes Account Aggregator use in underwriting and monitoring, with case studies spanning home loans, small-business credit and new-to-credit borrowers. Its findings concern the AA ecosystem, not database performance. Read the source These are industry references, not OriginChainDB customer stories. The implementation above is a proposed example. Build with OriginChainDB Discuss your application with us. Explore use cases Talk to our team --- ## Mutual funds use cases and data models | OriginChainDB Canonical source: https://originchaindb.com/industries/mutual-funds Mutual funds Answer questions about fund disclosures. Find holdings, scheme terms and addenda for the correct fund, plan and reporting period. Give service teams the source document for each answer. Explore use cases Talk to our team Fund disclosures Locate holdings and terms for the correct reporting period. Illustrative use case 01 / Use case guide 10 practical use cases. Compare the data models behind everyday industry tasks, from finding records to following connections. SQL Filter and calculate Vector Match similar meaning Graph Follow relationships Full-text Find words and phrases ✓ Suggested model combination Scroll across to compare all four models Mutual funds: 10 use cases, suggested query models and industry references. Use case How the data models help SQL Vector Graph Full-text Source 01 Disclosed portfolio holdings review Find a scheme's holdings and commentary for the same reporting period. Use SQL to select the scheme and dated holdings, and Full-text to locate matching scheme names and commentary in its factsheet. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [1] 02 Exit load term lookup Find the redemption wording applicable to a particular scheme and investment date. Use SQL to select dated scheme terms, Vector to match investor wording, and Full-text to locate the exact exit-load clause. SQL included Vector included — Graph not needed for this example Full-text included [2] [4] 03 NAV publication reconciliation Identify missing or inconsistent published NAV records for each scheme and date. Use SQL to compare imported NAV snapshots and Graph to trace each scheme–plan record to its source publication. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [3] 04 Riskometer change review Retrieve the notice behind a change in a scheme's disclosed riskometer. Use SQL to select riskometer records by scheme and date, and Full-text to find the associated change notice. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [4] 05 KYC exception evidence lookup Find the recorded KYC status and guidance relevant to an investor's service request. Use SQL to retrieve the authorized status record and Full-text to locate the matching status explanation and document checklist. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [5] 06 Unclaimed payment tracing Investigate redemption or distribution payments that did not reach the investor. Use SQL to select unpaid items, Graph to trace folio and payment-account links, and Full-text to retrieve recorded failure reasons. SQL included — Vector not needed for this example Graph included Full-text included [6] 07 SIP mandate servicing review Find the mandate and instructions behind a request to change a SIP bank account. Use SQL to retrieve SIP status, Graph to follow the registered mandate–bank relationship, and Full-text to locate applicable change instructions. SQL included — Vector not needed for this example Graph included Full-text included [7] 08 Nomination update evidence checks Review a new nomination request against existing folio and holder records. Use SQL to select nomination versions, Graph to trace folio-holder relationships, and Full-text to retrieve the submitted request and signature instructions. SQL included — Vector not needed for this example Graph included Full-text included [8] 09 Unit transmission document review Check the evidence supplied when a nominee requests transmission of units. Use SQL to list received documents, Graph to connect the folio, deceased holder and nominee, and Full-text to retrieve the relevant checklist. SQL included — Vector not needed for this example Graph included Full-text included [9] 10 Scheme disclosure change tracking Identify which scheme documents and service answers need review after an addendum. Use SQL to select effective dates, Graph to link addenda to affected schemes and documents, and Vector to retrieve related existing explanations. SQL included Vector included Graph included — Full-text not needed for this example [4] Use the query interfaces you need, then connect their results through shared record IDs in your application. Industry sources 9 These sources describe real industry workflows. The model combinations above are proposed OriginChainDB designs, not customer deployment claims. HDFC Mutual Fund — Fund Factsheets: portfolio details and scheme information (opens in a new tab) HDFC Mutual Fund — Redemption Related FAQs (opens in a new tab) Association of Mutual Funds in India — Latest and historical NAV downloads (opens in a new tab) HDFC Mutual Fund — Addenda and Notices: scheme and riskometer changes (opens in a new tab) Association of Mutual Funds in India — Know Your Customer: status checks, forms and modification guides (opens in a new tab) HDFC Mutual Fund — Unclaimed Mutual Funds: payment tracing and claim procedures (opens in a new tab) HDFC Mutual Fund — Systematic Investment Plan: servicing and mandate changes (opens in a new tab) HDFC Mutual Fund — Register or Update Nominee Details (opens in a new tab) Association of Mutual Funds in India — Nomination: formalities for transmitting units to nominees (opens in a new tab) 02 / A closer look Finding the applicable holdings and exit-load terms An investor asks about a scheme’s holdings and exit-load wording. The service team must identify the correct scheme and plan, use the applicable disclosure date and locate the relevant document passage. What makes it difficult 01 A scheme name may have several plans and options. 02 Monthly factsheets and later addenda can disagree if dates are ignored. 03 Holdings tables and scheme wording use different formats. Suggested approach Resolve the scheme and date first Select the exact scheme, plan and period before searching documents. Keep reporting dates and effective dates separate so answers do not mix holdings or terms from different versions. 03 / Queries What each data model does Select a model to see the question it answers. SQL · Find the facts The question Which holdings were disclosed for this scheme in September? Select a scheme, plan and reporting-period snapshot. Explore SQL Vector · Match the meaning The question Which passage explains what happens when units are sold early? Find relevant explanations when investor wording differs. Explore Vector Graph · Follow the connections The question Which disclosure and addendum belong to this scheme? Connect the scheme to its manager, holdings and documents. Explore Graph Full-text · Find the exact wording The question Where does the applicable document say ‘exit load’? Locate exact scheme names, ISINs and terms. Explore Full-text Use shared record IDs to combine results from the different query interfaces in your application. 04 / Implementation How to build it STEP 01 Choose a fund family Start with public or licensed disclosures and operations-approved questions. Leave investor records out of the first pilot. STEP 02 Map scheme versions Record scheme codes, plan options, ISINs, reporting dates and effective dates. Link passages to source documents and refresh indexes when versions change. STEP 03 Search within the scheme Filter by scheme and date, then retrieve wording and related disclosures. Show missing dates or conflicting versions to the service team. STEP 04 Test publication updates Compare with approved answers. Test renamed schemes, changed terms and superseded documents before publishing responses to investors. 05 / Testing What to measure Compare these results with your current process before rollout. Scheme match accuracy Check results against the intended scheme, plan and option in the evaluation set. Version correctness Track responses that use an incorrect disclosure period or superseded term. Update completion Measure the delay from an approved source update to searchable, verified records and indexes. Fund information, with source references The application manages ingestion and response review. Investment advice, suitability checks, returns calculations and transactions stay in their existing systems. Security 06 / Sources Examples from the industry Published projects and reference material relevant to this use case. Industry example Accessed 3 November 2026 HDFC Mutual Fund A recurring factsheet publication workflow HDFC Mutual Fund publishes factsheets containing scheme objectives, fund managers, portfolio holdings, risk ratios and historical performance, with a monthly publication intent. Read the source Industry context Accessed 3 November 2026 SEBI Separate scheme disclosure document types SEBI’s mutual-fund filings directory provides separate access to statements of additional information, scheme information documents and key information memoranda. Read the source These are industry references, not OriginChainDB customer stories. The implementation above is a proposed example. Build with OriginChainDB Discuss your application with us. Explore use cases Talk to our team --- ## NBFCs use cases and data models | OriginChainDB Canonical source: https://originchaindb.com/industries/nbfcs NBFCs Resolve loan servicing disputes. Bring instalment records, payment receipts and borrower messages into one case view. Help servicing teams check a discrepancy before contacting the borrower again. Explore use cases Talk to our team Instalment dispute Compare a payment receipt with an instalment still marked overdue. Illustrative use case 01 / Use case guide 10 practical use cases. Compare the data models behind everyday industry tasks, from finding records to following connections. SQL Filter and calculate Vector Match similar meaning Graph Follow relationships Full-text Find words and phrases ✓ Suggested model combination Scroll across to compare all four models NBFCs: 10 use cases, suggested query models and industry references. Use case How the data models help SQL Vector Graph Full-text Source 01 Instalment receipt reconciliation Servicing teams need to investigate a paid instalment that still appears overdue. SQL compares scheduled instalments with posted receipts, while Full-text locates payment references in borrower messages. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [1] 02 Microfinance household obligation review Credit officers need a complete view of a household's declared income and existing repayments. SQL totals recorded income and repayments, while Graph connects verified household members and loan obligations for officer review. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [2] 03 Gold collateral inventory checks Branch auditors need to reconcile pledged gold records with custody and verification records. SQL compares recorded weights and valuations, Graph links pledged items to loans and custody records, and Full-text retrieves audit findings. SQL included — Vector not needed for this example Graph included Full-text included [3] 04 Vehicle repossession file review Authorized reviewers need the contract, notices and repayment history before considering repossession. SQL shows arrears and notice dates, Graph links the vehicle and case records, and Full-text retrieves contract clauses for human review. SQL included — Vector not needed for this example Graph included Full-text included [4] 05 Co lending share reconciliation Partner operations teams need to reconcile borrower payments with each lender's recorded share. SQL compares escrow movements and allocated amounts, while Graph connects borrower loans with partner shares and agreements. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [5] 06 Securitisation pool performance review Servicing teams need to trace pool reports back to the underlying loan payments. SQL aggregates collections and arrears, while Graph traces pool membership and servicing records back to individual loans. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [6] 07 Funding maturity mismatch review Treasury teams need to compare expected loan inflows with borrowing repayments. SQL groups cash flows into maturity periods, while Full-text retrieves funding terms behind timing assumptions. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [7] 08 Factoring invoice evidence review Receivables teams need accepted invoice evidence before reviewing a financing request. SQL checks invoice amounts and status, Graph links sellers, buyers and factoring units, and Full-text retrieves acceptance evidence. SQL included — Vector not needed for this example Graph included Full-text included [8] 09 Collection monitoring consent checks Collections teams need to confirm the permitted purpose and validity of account monitoring consent. SQL checks consent status and dates, while Graph links each account-data request to its borrower, loan and consent record. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [9] 10 Repayment mandate failure investigation Servicing teams need to distinguish failed debit instructions from missing repayment account updates. SQL groups debit failure codes, Graph connects mandates to repayment accounts, and Vector retrieves similar service notes for staff review. SQL included Vector included Graph included — Full-text not needed for this example [10] Use the query interfaces you need, then connect their results through shared record IDs in your application. Industry sources 10 These sources describe real industry workflows. The model combinations above are proposed OriginChainDB designs, not customer deployment claims. Bajaj Finance — Manage loan payments and investigate missing payment updates (opens in a new tab) Reserve Bank of India — Microfinance framework FAQs: household income and indebtedness (January 2025) (opens in a new tab) Muthoot Finance — Loan policy: gold collateral records and verification (March 2026) (opens in a new tab) Mahindra Finance — Repossession of vehicles (opens in a new tab) Reserve Bank of India — Co-Lending Arrangements Directions, 2025: operational arrangements (opens in a new tab) Reserve Bank of India — Securitisation of Standard Assets Directions, 2021 (updated December 2022) (opens in a new tab) Reserve Bank of India — NBFC Asset Liability Management Directions, 2025 (updated July 2026) (opens in a new tab) Receivables Exchange of India — TReDS FAQs: invoice acceptance and factoring units (opens in a new tab) Sahamati — Consent template CT035: account monitoring for overdue collections (opens in a new tab) Bajaj Finance — Why EMI payments fail: repayment mandates and account details (opens in a new tab) 02 / A closer look The borrower paid, but the instalment shows overdue A servicing team sees an unpaid instalment. The borrower says they paid, a receipt was uploaded separately, and the account record has not been reconciled. The team needs a reliable case history before contacting the borrower again. What makes it difficult 01 Receipts, ledger entries and service notes arrive on different timelines. 02 The same borrower can have multiple facilities and service requests. 03 Monitoring data must stay within its permitted purpose and validity. Suggested approach Reconcile the payment before follow-up Compare the scheduled instalment with posted receipts. Link the relevant messages and service requests, and flag stale or conflicting records for the servicing team. 03 / Queries What each data model does Select a model to see the question it answers. SQL · Find the facts The question Which scheduled instalments have no matching posted receipt? Compare instalments and receipts. Explore SQL Vector · Match the meaning The question Which authorized notes describe a similar payment-posting problem? Find related service descriptions. Explore Vector Graph · Follow the connections The question Which facilities, receipts and service cases link to this borrower? Build the borrower’s case context. Explore Graph Full-text · Find the exact wording The question Which receipt or message includes this payment reference? Find the precise reference. Explore Full-text Use shared record IDs to combine results from the different query interfaces in your application. 04 / Implementation How to build it STEP 01 Choose a servicing queue Start with masked payment-posting cases. Define the required borrower data, authorized roles and permitted monitoring purposes. STEP 02 Link receipts to facilities Assign borrower, facility, receipt and case IDs. Keep timestamps, corrections and consent references. Refresh indexes when notes change. STEP 03 Show the discrepancy Compare repayment status with SQL, follow facility links and search receipt references. Your application flags stale or conflicting records for verification. STEP 04 Test before customer contact Replay resolved cases with duplicate receipts, late postings and expired permissions. Have servicing staff approve the results before use in customer follow-ups. 05 / Testing What to measure Compare these results with your current process before rollout. Posting discrepancies Track verified mismatches separately from cases caused by delayed updates. Repeat contacts Measure avoidable follow-ups for cases whose supporting receipt already existed. Freshness and access Test how quickly corrected data appears and whether expired or out-of-scope evidence is withheld. Servicing controls remain with your team Your application enforces consent, reconciliation and collection policies. A retrieved note or relationship does not authorize an adverse credit or collection action. Security 06 / Sources Examples from the industry Published projects and reference material relevant to this use case. Industry example 2023 Setu & Snapmint Separate consent for underwriting and monitoring Setu describes a Snapmint onboarding flow with separate consent for an initial underwriting fetch and recurring monitoring fetches. This is a documented Account Aggregator example, not an OriginChainDB customer deployment. Read the source Industry context Reviewed November 2026 Sahamati Account Aggregator ecosystem and consent-based data sharing Sahamati describes Account Aggregators as a way to share financial information between institutions with the individual’s consent. Its current materials cover credit underwriting and monitoring across the ecosystem. Read the source These are industry references, not OriginChainDB customer stories. The implementation above is a proposed example. Build with OriginChainDB Discuss your application with us. Explore use cases Talk to our team --- ## Telecom use cases and data models | OriginChainDB Canonical source: https://originchaindb.com/industries/telecom Telecom Investigate network outages. Connect alarms, network dependencies and recent changes. Help engineers find what affected sites share and retrieve the relevant runbook. Explore use cases Talk to our team Outage investigation Trace affected sites to a shared network dependency. Illustrative use case 01 / Use case guide 10 practical use cases. Compare the data models behind everyday industry tasks, from finding records to following connections. SQL Filter and calculate Vector Match similar meaning Graph Follow relationships Full-text Find words and phrases ✓ Suggested model combination Scroll across to compare all four models Telecom: 10 use cases, suggested query models and industry references. Use case How the data models help SQL Vector Graph Full-text Source 01 Prioritize active network alarms Engineers need a manageable list of current alarms to investigate. SQL filters alarms by severity, site and time; Full-text finds specific alarm codes and messages. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [1] 02 Map affected customer services An incident team needs to know which services depend on failing equipment. Graph follows equipment and service dependencies; SQL checks active services and current incident timestamps. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [2] 03 Compare recent maintenance changes Engineers need to see whether affected systems share a recent maintenance change. Graph connects changes to affected equipment and services; SQL compares maintenance times with alarm onset for engineer review. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [2] 04 Find similar resolved incidents An engineer needs useful precedents for an unfamiliar network symptom. Vector finds similar incident descriptions; SQL filters by equipment and resolution status; Full-text retrieves recorded fault codes and recovery notes. SQL included Vector included — Graph not needed for this example Full-text included [3] 05 Track customer trouble tickets Support teams need the current state of a fault reported across partner systems. SQL filters open tickets by severity and age; Graph follows related partner tickets; Full-text finds fault descriptions and ticket references. SQL included — Vector not needed for this example Graph included Full-text included [4] 06 Check service order progress Operations staff need to find service orders that are still incomplete. SQL filters orders by status and requested date; Graph connects each order to its service items for staff review. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [5] 07 Check address service availability A sales agent needs to know whether a requested service can be delivered. Graph follows service designs to required resources; SQL checks location, capacity and qualification results before the service team confirms availability. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [6] 08 Find installation appointment slots A customer needs an available time for an installation or repair visit. SQL filters open appointment slots by place and time; Graph links the visit to its order or trouble ticket. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [7] 09 Reconcile network inventory records Recorded equipment details no longer match the latest network discovery. SQL compares discovered and recorded resource attributes; Graph traces changed equipment relationships for inventory staff to review. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [8] 10 Explain monthly bill changes A support agent needs to explain an increase in a customer's bill. SQL compares charges, credits and discounts across billing periods; Graph connects each changed charge to its account and product. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [9] Use the query interfaces you need, then connect their results through shared record IDs in your application. Industry sources 9 These sources describe real industry workflows. The model combinations above are proposed OriginChainDB designs, not customer deployment claims. TM Forum — Fault Management (opens in a new tab) KDDI — Starting Operation of Fault Recovery support Agent (opens in a new tab) Telefónica — Driving network incident resolution with AI agents and LLMs (opens in a new tab) TM Forum — TMF621 Trouble Ticket REST API Specification R14.5.1 (opens in a new tab) TM Forum — TMF641 Service Ordering Management API User Guide v4.1.1 (opens in a new tab) TM Forum — Service Qualification Management (opens in a new tab) TM Forum — TMF646 Appointment Management API REST Specification R19.0.1 (opens in a new tab) TM Forum — Resource Discovery and Reconciliation (opens in a new tab) TM Forum — TMFC031 Bill Calculation Management v3.0.0 (opens in a new tab) 02 / A closer look Several sites fail after a network change Several sites report degraded service after a network change. Alarms arrive from different systems, customer reports use different descriptions, and the affected sites may share an upstream device. Engineers need evidence before choosing a recovery action. What makes it difficult 01 Alarm volume hides related symptoms. 02 Service impact and physical dependencies live apart. 03 Old topology or runbooks can mislead an investigation. Suggested approach Trace shared network dependencies Start with the affected sites and follow their upstream connections. Compare alarms with recent changes, then retrieve runbooks and previous incidents that help engineers test a cause. 03 / Queries What each data model does Select a model to see the question it answers. SQL · Find the facts The question Show critical alarms for these sites since the change. Narrow events by region, time, device and severity. Explore SQL Vector · Match the meaning The question Find past incidents describing intermittent packet loss. Find incidents and guidance with similar symptoms. Explore Vector Graph · Follow the connections The question Which device is shared by the affected sites? Trace service, site and upstream network dependencies. Explore Graph Full-text · Find the exact wording The question Find the approved procedure for this error code. Locate exact alarm codes and runbook instructions. Explore Full-text Use shared record IDs to combine results from the different query interfaces in your application. 04 / Implementation How to build it STEP 01 Choose a region or service Use authorized read-only alarm exports, topology records and resolved incidents. Define the investigation questions with engineers. STEP 02 Record topology and timestamps Assign service, device and change IDs. Store event and ingestion times, topology validity and runbook versions. Refresh indexes after source changes. STEP 03 Show candidate causes Combine affected services, dependency paths and recent changes. Link supporting runbooks and mark uncertain relationships for the engineer to check. STEP 04 Replay resolved incidents Check missed dependencies and stale topology against known incidents. Pilot read-only triage first; keep network changes behind existing operator approvals. 05 / Testing What to measure Compare these results with your current process before rollout. Time to useful evidence Measure how quickly an engineer finds a relevant dependency and supporting records. Incident coverage Check whether the known cause appears among the evidence in replayed incidents. Topology freshness Track stale or incorrect links discovered during incident review. Engineers confirm the cause A shared dependency suggests where to investigate. It does not prove causation or authorize a network change. Existing operations systems control recovery. Security 06 / Sources Examples from the industry Published projects and reference material relevant to this use case. Industry example 19 February 2026 KDDI Starting operation of Fault Recovery Support Agent KDDI announced operation of a fault-recovery support agent for selected services. It connects system information, equipment alarms and operational history to help staff identify failure causes. Read the source Industry context 30 March 2026 Telefónica Driving network incident resolution with AI agents and LLMs Telefónica discusses network incident resolution using correlated information across services, users and network elements, alongside operational systems and AI assistance. Read the source These are industry references, not OriginChainDB customer stories. The implementation above is a proposed example. Build with OriginChainDB Discuss your application with us. Explore use cases Talk to our team --- ## Wealth management use cases and data models | OriginChainDB Canonical source: https://originchaindb.com/industries/wealth-management Wealth management Prepare client meeting briefs. Retrieve permitted account records, earlier meeting notes and approved research for an adviser. Show dates and sources alongside the brief. Explore use cases Talk to our team Meeting preparation Prepare account information and client goals for the next meeting. Illustrative use case 01 / Use case guide 10 practical use cases. Compare the data models behind everyday industry tasks, from finding records to following connections. SQL Filter and calculate Vector Match similar meaning Graph Follow relationships Full-text Find words and phrases ✓ Suggested model combination Scroll across to compare all four models Wealth management: 10 use cases, suggested query models and industry references. Use case How the data models help SQL Vector Graph Full-text Source 01 Client meeting preparation Recover earlier client goals and discussion context before a meeting. Use SQL to select permitted, dated client notes and Vector to retrieve earlier discussions related to the planned agenda. SQL included Vector included — Graph not needed for this example — Full-text not needed for this example [1] 02 Meeting follow-up tracking Locate unfinished commitments recorded in client meetings. Use SQL to filter recorded actions by owner and status, and Full-text to locate the original commitment in consented meeting notes. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [1] 03 Approved research retrieval Find firm research that addresses an adviser's client question. Use SQL to filter approved publication dates, Vector to find related research themes, and Full-text to locate exact product or issuer names. SQL included Vector included — Graph not needed for this example Full-text included [1] 04 Portfolio commentary evidence assembly Connect portfolio analytics with relevant firm market commentary. Use SQL to select dated holdings and supplied analytics, and Vector to retrieve relevant approved market commentary for adviser review. SQL included Vector included — Graph not needed for this example — Full-text not needed for this example [2] 05 Client profile completeness review Identify missing onboarding information about a client's circumstances and objectives. Use SQL to surface incomplete profile fields and Full-text to retrieve the corresponding application questions and client responses. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [3] 06 Account transfer exception review Investigate transfer requests rejected for incomplete or inconsistent account information. Use SQL to select rejected requests, Graph to trace sending and receiving account links, and Full-text to retrieve rejection explanations. SQL included — Vector not needed for this example Graph included Full-text included [4] 07 Beneficiary record review Review recorded beneficiaries and allocation shares across a client's accounts. Use SQL to retrieve designation versions and recorded percentages, and Graph to trace account, primary-beneficiary and contingent-beneficiary links. SQL included — Vector not needed for this example Graph included — Full-text not needed for this example [5] 08 Account authority evidence lookup Distinguish a trusted contact from someone authorized to act for the client. Use Graph to separate recorded contact and representative relationships, and Full-text to retrieve the supporting authorization documents for staff review. — SQL not needed for this example — Vector not needed for this example Graph included Full-text included [6] 09 Missing cost basis investigation Trace unknown lot information after an account or asset transfer. Use SQL to locate lots with missing basis, Graph to trace transfer lineage, and Full-text to retrieve associated confirmations and statements. SQL included — Vector not needed for this example Graph included Full-text included [7] 10 Account service and fee questions Explain the services and fees associated with the client's account agreement. Use SQL to identify the account type and agreement version, and Full-text to locate the applicable service and fee disclosures. SQL included — Vector not needed for this example — Graph not needed for this example Full-text included [8] Use the query interfaces you need, then connect their results through shared record IDs in your application. Industry sources 8 These sources describe real industry workflows. The model combinations above are proposed OriginChainDB designs, not customer deployment claims. Morgan Stanley — AI at Morgan Stanley Debrief launch (opens in a new tab) BlackRock — Aladdin Wealth launches AI-enabled commentary at Morgan Stanley (opens in a new tab) FINRA — Opening a Brokerage Account: Part 1 (opens in a new tab) FINRA — Regulatory Notice 23-06: account transfer fraud controls (opens in a new tab) Fidelity — How to Update Your Beneficiaries (opens in a new tab) U.S. Securities and Exchange Commission — Trusted Contact (opens in a new tab) Fidelity — Cost Basis Help: reasons for unknown cost basis (opens in a new tab) FINRA — Brokerage and Advisory Accounts: Factors to Consider When Choosing an Account Type (opens in a new tab) 02 / A closer look Preparing for a client’s planned expense A client mentions a major upcoming expense. Before the next meeting, the adviser needs the latest permitted account view, earlier goals and relevant approved research, without losing the dates or sources behind them. What makes it difficult 01 Client context is spread across notes and account systems. 02 A research passage may be relevant but out of date. 03 Similar client names or households can lead to the wrong record. Suggested approach Retrieve within the adviser’s access Resolve the client and household first. Retrieve current account snapshots, open follow-ups and approved research relevant to the meeting. Keep advice and suitability checks in the adviser’s process. 03 / Queries What each data model does Select a model to see the question it answers. SQL · Find the facts The question Which open follow-ups belong to this client? Filter permitted account snapshots, dates and pending tasks. Explore SQL Vector · Match the meaning The question Which research discusses funding a near-term expense? Match a plain-language concern to approved research. Explore Vector Graph · Follow the connections The question Which accounts are linked to this authorized household? Follow verified client, household and account relationships. Explore Graph Full-text · Find the exact wording The question Where did the client mention the planned purchase? Find precise topics, product names and note references. Explore Full-text Use shared record IDs to combine results from the different query interfaces in your application. 04 / Implementation How to build it STEP 01 Define the brief Choose one meeting type and a consented or de-identified sample. Specify which account fields, notes and research each adviser may see. STEP 02 Verify client identities Link client, household, account and document IDs. Retain consent, publication dates and source timestamps. Refresh indexes when sources change. STEP 03 Assemble the information Apply access and freshness filters before combining results. Show sources and unanswered questions. Any model-generated summary must retain citations. STEP 04 Test with advisers Compare against adviser-prepared briefs. Test wrong-client and stale-document cases. Require review before sharing a brief with a client. 05 / Testing What to measure Compare these results with your current process before rollout. Source coverage Check how many briefing statements can be opened in an authorized source record. Freshness Measure stale account snapshots and superseded research returned in test briefs. Access isolation Test that a different adviser or household identity cannot retrieve the same restricted context. Advisers remain responsible for advice The database retrieves information. Consent enforcement, suitability checks, model calls and client recommendations remain with your application and advisers. Security 06 / Sources Examples from the industry Published projects and reference material relevant to this use case. Industry example 26 June 2024 Morgan Stanley AI-assisted notes with adviser review Morgan Stanley describes Debrief generating meeting notes with client consent, identifying actions and drafting an email for the adviser to edit and send. Read the source Industry example 2 October 2025 BlackRock Aladdin Wealth Connecting portfolio analytics and commentary BlackRock announced an AI-enabled commentary tool at Morgan Stanley that brings portfolio analytics and firm-level market insights into adviser commentary. Read the source These are industry references, not OriginChainDB customer stories. The implementation above is a proposed example. Build with OriginChainDB Discuss your application with us. Explore use cases Talk to our team --- ## Integrations, SDKs & MCP | OriginChainDB Canonical source: https://originchaindb.com/integrations Integrations Your tools. Your code. Connected to your data. Bring your database workspace, application language and AI tools to OriginChainDB. Choose the connection that fits what you want to build. Find your connection Explore the HTTP API Built to connect Three entry points Database toolsPostgreSQL listener { }Your applicationSDKs & HTTP AI toolsMCP server ONE MULTIMODAL DATABASEOriginChainDB SQLVectorGraphFull-text Choose an interface. Use its supported operations and access controls. Database tools Keep the workspace you know. Open your data in pgAdmin or DBeaver, or connect your application through a compatible driver. 01 Database workspace pgAdmin Use Query Tool to explore records and run supported SQL through your instance’s PostgreSQL listener. Connection guide 02 Database workspace DBeaver Connect with the PostgreSQL driver, browse a known table and query your data from a familiar editor. Connection guide 03 Application code Drivers & ORMs Use the current read-only PostgreSQL login for compatible queries. Send writes and schema changes through the HTTPS API. Review compatibility Dedicated instances SQL clients and ORMs require an enabled PostgreSQL listener. The current login is read-only. Copy its host, port, credentials and TLS settings from Connect. Free and pooled configurations use the HTTPS API. Connect first. Then test your workflow. Protocol support does not guarantee every PostgreSQL extension, administration tool or ORM migration will work. Check supported behavior SDKs & APIs Build in your language. Connect over HTTPS with an OriginChainDB client. Work with records, queries and search operations from your application code. Eight SDKs are available on GitHub. Follow the installation steps for the version in your language guide and check its API coverage. View all eight languages HTTPS Need the direct interface? Use the HTTP reference for endpoints not wrapped by your client, or when building your own integration. Browse API operations TypeScript / JavaScript Handwritten application client. Python Sync and async clients. Go Generated services and models. Java Generated HTTP client. C# Generated HTTP client. Ruby Generated HTTP client. PHP Generated HTTP client. Rust Generated HTTP client. Handwritten and generated clients expose different APIs. Operations also depend on engine capabilities and permissions. MCP integration Give your AI tools database context. The earlier OriginChainDB MCP integration connects a compatible AI client to tools for schema discovery, SQL, natural-language questions and search. A local stdio server carries tool requests to your database’s HTTPS endpoint. Your configured credentials and the database determine which operations can run. Request MCP access Read the integration guide The server for the new access-token connection is not yet a verified public install. Confirm availability and client setup before connecting your instance. Tool directorystdio oc_list_schemas Inspect tables and their structure oc_sql Run supported SQL oc_ask Ask questions about your tables oc_vector_topk Retrieve similar vectors oc_fts_search Search indexed text Ask and search tools require the corresponding instance capabilities. Make the first connection A clear path from setup to your app. Verify one small request, then test the operations your application will use. 01 Choose the interface Use HTTPS for SDK and API requests, or the dedicated listener for supported PostgreSQL clients. Connection settings 02 Scope the credentials Use the credentials for your chosen interface. Keep secrets in your server environment and verify the intended access. Authentication & access 03 Test the real workload Check reads, authorized writes and expected failures. Review transaction and retry behavior before moving production traffic. Compatibility guidance Bringing an existing database? Use Migrate to review schemas and mappings, copy records and verify the result before switching your application. Explore Migrate Build with OriginChainDB Make OriginChainDB part of your stack. Find your connection Explore the HTTP API --- ## MCP for AI clients | OriginChainDB Canonical source: https://originchaindb.com/integrations/mcp MCP Your AI client. Your database, in reach. MCP (Model Context Protocol) lets an AI assistant use tools in other software. See how a database connection works, then check server availability for your setup. Request MCP access Read technical notes MODEL CONTEXT PROTOCOL What tables are available? AI clientYour workspace OriginChain MCPFive database tools Your databaseOriginChainDB oc_list_schemasExample result ▦customersid · name · email ▦ordersid · customer_id · total Your client calls a tool. OriginChainDB returns the data. Compatibility preview · request availability A first request From a question to a database result. Start with the structure of your data. Then choose the query you need. 01 / CONNECTION Choose the database your client can use. Ask our team to confirm a server version that supports your client and database connection. Use the configuration supplied for that version. This walkthrough illustrates a local server sending database requests over HTTPS. The server for the new access-token connection is not yet available as a verified public install. Connection checklistPreview ClientA supported MCP client ServerA compatible, verified version AccessCredentials for that server's connection format Use the setup instructions supplied for your client. 02 / TOOL CALL See what the client is asking for. For this question, the client can use oc_list_schemas. Review the tool name and arguments in your client before continuing. The review controls depend on your MCP client and its settings. QuestionExample “What tables are available?” Tooloc_list_schemas Inspect the tables, columns and indexes in the configured tenant. DestinationYour OriginChainDB instance 03 / RESULT Read the schema. Ask the next question. The returned schema describes your tables and columns. Your client can use these names to prepare a query. Review returned data and errors before using the answer in your work. Schema resultIllustrative Example tables and columns returned by schema discovery TableColumns customersid, name, email ordersid, customer_id, total A next question “Show the orders for a customer.” Illustrative walkthrough. No database connection or query is made. Tool directory Database tools. A clear job for each. These are tools from the earlier integration. The available list must be confirmed for the server version and instance you use. 01 oc_list_schemas Understand the structure Inspect your tables, columns and indexes. Example intent“What tables are available?” 02 oc_sql Run SQL Run supported SQL with parameters. Example intent“Which orders were placed today?” 03 oc_ask Ask in plain language Ask a question about your tables. Example intent“Show new customers this month.” 04 oc_vector_topk Find similar records Find similar records using a vector (a numeric representation of data) and optional filters. Example intent“Find records similar to this example.” 05 oc_fts_search Search indexed text Find text using words and phrases. Example intent“Find passages that mention delivery.” Ask and search tools require the corresponding instance capabilities. Multiple tool calls remain separate requests. Setup & access A local connection. Your database access. MCP gives your client a set of database tools. The connection still uses your configured credentials. Explore authentication 01 Runs alongside your client Your client starts a local server and talks to it through stdio (standard input/output). The server sends database requests over HTTPS. 02 Uses the access you configure Your credentials and the database determine which requests can run. Verify the intended access before connecting an AI client. 03 Get the right setup A verified public server for the new connection flow is still pending. Our team can confirm availability and provide the correct setup when your configuration is supported. Request MCP access Build with OriginChainDB Connect your client to your data. Request MCP access Read technical notes --- ## Partners | OriginChainDB Canonical source: https://originchaindb.com/partners Partners Build with us. Start with a project. Work with us on an integration, a customer project or a practical developer guide. Discuss a partnership Find your starting point Different skills joining one project Ways to work together Three ways to work together. Tell us what you want to build and who it will help. Implementation Deliver a project Migrate existing data. Build an application. Plan a deployment. Explore migration Technology Connect a tool Build a connector, SDK or framework integration. Define and test what it supports. Current integrations Shared learning Share what works Publish a tested example or practical guide. Host a technical workshop. Browse the documentation A clear starting point Tell us what you have in mind. Share the project, the current setup and the help you need. We can then discuss the scope and responsibilities. Start the conversation 01 Describe the use case Name the users, the tools involved and the result you want. 02 Plan the work Agree on the scope, owners and checks needed before release. 03 Write the setup guide Explain setup, supported features and who maintains the integration. Our memberships Our program memberships. OriginChainDB is a member of NVIDIA Inception and IAMAI. Build with OriginChainDB What could we build together? Discuss a partnership Find your starting point --- ## Evaluate your workload | OriginChainDB Canonical source: https://originchaindb.com/pilot Technical pilot Test your workload. Decide with evidence. Try one application with your own data. Check the results before planning a wider move. Plan a pilot See the evaluation process A workload measured against agreed criteria Document search & RAG pilot One document collection. A clear test of usefulness. Bring a small, approved document set and questions with known supporting passages. Compare keyword, vector and combined retrieval before adding answer generation. Discuss a search pilot Agree on the baseline Record how your existing search handles the same questions. Include questions that the documents cannot answer. Set the pass criteria Choose a target for relevant results, source-access checks, response time and cost. Agree on the sample size and review method. Review the evidence together Keep the results and test conditions. Decide whether to expand, adjust or stop. Confirm scope, support and pricing with the team. From scope to decision Four steps to a clear decision. Choose one workload and agree on what success means. Set the schedule and support around that scope. Use a data sample approved by your team. 01 Set the goal Choose one task. Record how it works today and what would make the pilot successful. 02 Prepare the data Use realistic records and permissions. Add the indexes and embeddings the task needs. 03 Run the checks Run repeatable queries. Measure accuracy, response time, errors and resource use. 04 Make the decision Compare results with the goal. Decide what to keep, change or stop. Choose what to measure Check three things that matter. Check the answers, the speed and the work needed to run the app. Results Correct answers Compare results with known answers. Review search relevance and connections. Performance Response time Use realistic data and simultaneous requests. Include the work done by your app. Operation Day-to-day operation Try updates, permission checks and restores. Record costs and index maintenance. Before the first session What to bring to the first call. Your application and current database setup. Example queries, data size and update frequency. Permission, region and recovery requirements. An approved data sample and the people reviewing results. Benchmark methodology How to compare results with their test conditions attached. Plan the instance cost Hourly equivalents help compare plans; current billing remains monthly. Discuss scope and support Agree on the technical work and commercial terms for your pilot. Build with OriginChainDB Bring one workload and a clear question. Plan a pilot See the evaluation process --- ## Pricing — Free, Shared & Dedicated | OriginChainDB Canonical source: https://originchaindb.com/pricing Pricing Start with your idea. Choose your capacity. One multimodal database. Start free, choose shared capacity, or configure dedicated resources around your application. Compare plans Talk to our team Four data models. A plan for your next step. 01FreeTry your first applicationStart here 02SharedChoose a storage allowance 03DedicatedSize your own resources SQL · Vector · Graph · Full-text 01 / Find your starting point A clearer way to compare. Prices in USD. Hourly equivalents use 730 hours per month. Applicable taxes are additional. Free Explore For learning, prototypes, and your first application. $0/ hr Free. No card required. Start free 2 GB database storage Shared, scale-to-zero infrastructure Workbench and API access One free database per account Unused databases are deleted after 90 days, following a 14-day email warning. Shared Build A predictable plan for a smaller application. $0.040/ hr equivalent $29 billed monthly Shared database storage25 GB50 GB Choose shared 25 GB database storage 20 GB monthly transfer included Shared compute, capped at 1 vCPU Single node in Mumbai No replicas or adjustable compute. Review your configuration at checkout. Dedicated Your resources Single-tenant resources, sized for your workload. From $0.438/ hr equivalent $320 estimated per month Configure dedicated From 2 vCPU and 8 GB memory From 20 GB dedicated storage Daily snapshots PostgreSQL endpoint for your tools Baseline: one node in Mumbai, single zone, public networking and 100 GB monthly transfer. Hourly amounts are rounded price equivalents, not pay-as-you-go billing. Shared plans remain monthly; dedicated pricing is confirmed with your configuration. Have enterprise requirements? Let’s scope your region, private connectivity, recovery and support together. Explore Enterprise 02 / Dedicated estimator Size it. See the estimate. Choose your compute and storage. See the hourly equivalent and its monthly planning total. MumbaiOther regions on request Compute & memory 2 vCPU · 8 GB RAM 4 vCPU · 16 GB RAM 8 vCPU · 32 GB RAM 16 vCPU · 64 GB RAM 32 vCPU · 128 GB RAM 64 vCPU · 256 GB RAM Resources for your primary node. Storage per node20 GB100 GB500 GB2 TB5 TB10 TB20 TB50 TB Standard SSD · 3,000 IOPS · 125 MiB/s. Add a warm standbyMatching resources in a second availability zone. Replication is asynchronous. Recovery behavior and promotion procedures are agreed for your deployment. Included in this estimate Four data modelsDaily snapshotsPublic networking100 GB monthly transfer This estimates provisioned capacity, not query throughput. Additional transfer, private networking, PITR and custom regions require separate sizing. Need a custom setup? The baseline estimate is shown. Enable JavaScript to change the configuration, or contact us for a quote. Your dedicated database $0.438/ hr Hourly price equivalent $320 estimated per month 2 vCPU · 8 GB RAM · 20 GB storage Platform$0.082/hr Compute$0.342/hr Storage$0.014/hr Standby & replication Email this configuration Planning estimate, before taxes. Calculated from unrounded monthly rates over 730 hours. Final terms are confirmed before launch. Compare all dedicated sizes + One primary node, 20 GB storage, single zone, public networking and 100 GB monthly transfer. Platform included. ComputeMemoryHourly equivalentConfiguration 2 vCPU 8 GB $0.438/hr 4 vCPU 16 GB $0.753/hr 8 vCPU 32 GB $1.370/hr 16 vCPU 64 GB $2.603/hr 32 vCPU 128 GB $5.082/hr 64 vCPU 256 GB $10.027/hr 03 / The details that matter Pick the right resources. Explore the database Compare Free, Shared and Dedicated database resources ResourceFreeSharedDedicated Database storage 2 GB25 or 50 GB20 GB–50 TB per node Compute SharedShared · up to 1 vCPU2–64 vCPU per node Region Assigned at launchMumbaiMumbai; other regions on request Monthly outbound transfer Check your console allowance20 or 50 GB included100 GB in the baseline estimate PostgreSQL client endpoint Not availableNot availableAvailable on dedicated instances Standby Not availableNot availableOptional · priced separately Recovery Check your configurationNo point-in-time recoveryDaily snapshots; PITR in preview Shared plans have no reserved IOPS or throughput. Moving between free, shared and dedicated configurations currently requires planning; in-place changes are not available. Read the deployment guide. 04 / Vezual credits Create with AI. Buy credits when you need them. Optional, one-time packs for AI dashboard creation and revision. Purchased separately from your database. 100 credits $15 one-time 10 successful AI operations Get credits 500 credits $69 one-time 50 successful AI operations Get credits 1,000 credits $129 one-time 100 successful AI operations Get credits A successful creation or AI revision uses 10 credits. Failed generations do not consume credits. Viewing and manual editing do not use generation credits; live queries use your database resources. Credits belong to the purchasing account in its selected organization. Explore Vezual Before you choose Clear pricing. Clear expectations. Have a particular workload in mind? Bring your capacity, region and recovery requirements. Ask a pricing question Does the hourly figure mean I’m billed by the hour? The hourly figure is a comparison equivalent: the monthly amount divided by 730 hours, rounded for display. Shared plans are still billed monthly. Dedicated figures are planning estimates, with final billing terms agreed before launch. This page does not introduce usage-hour billing or an idle-time discount. Are the four data models charged separately? The dedicated estimate includes SQL, vector, graph and full-text without separate model fees. Records and indexes use storage, compute and memory, so the capacity you need still affects your configuration. What changes the dedicated estimate? Compute, storage and a standby change the estimate here. It assumes Mumbai, public networking and 100 GB monthly outbound transfer. A standby assumes 100 GB monthly writes for replication transfer. Other regions, extra transfer, private networking and recovery options need a separate quote. Is point-in-time recovery included? Daily snapshots are included for dedicated instances. Point-in-time recovery is in preview and is not included in this estimator. Confirm retention, availability and restore requirements with our team. Are Vezual credits included in a database plan? No. Database resources and Vezual AI generation credits are separate purchases. Each successful AI creation or revision uses 10 credits. A 100-credit pack can cover ten creations, or five creations with one AI revision each. Can I agree an enterprise or annual plan? Talk to us about your deployment, support and commercial requirements. No annual discount is assumed in these estimates. Explore Enterprise. Build with OriginChainDB Find the right home for your data. Compare plans Talk to our team --- ## Privacy policy - what OriginChain collects Canonical source: https://originchaindb.com/privacy privacy Privacy notice How we collect, use and protect personal data on this website and in OriginChain Cloud. The short version OriginChain is a managed database product operated by Silicoyn Technologies Pvt Ltd ("we"), an Indian private limited company headquartered in Bengaluru. You sign up, we run your managed instance for you. The rows you store are yours: we do not read them, sell them, or let them leave the region you picked. This notice is published in compliance with Section 5 of the Digital Personal Data Protection Act 2023 ("DPDP Act") and applies to all personal data we process, regardless of where you are located. Who we are Data Fiduciary: Silicoyn Technologies Pvt Ltd, a company incorporated under the Indian Companies Act 2013 with its registered office in Bengaluru, Karnataka, India. Grievance Officer / Data Protection Officer: reachable at grievance@originchaindb.com. Complaints are acknowledged within 24 hours and resolved within 15 days, as required by Section 7(c) of the DPDP Act and the IT Rules 2021. What this website collects Optional website analytics runs only after you choose “Allow analytics”. Google Analytics receives the public page path and selected actions, such as example downloads or a successfully submitted contact enquiry. We do not send your form text, email address, search queries, URL query strings or fragments to Analytics. Analytics uses a browser identifier and technical information about the visit; it is not linked to your database account. Advertising features are disabled. Choose “No thanks” to use the site without analytics, or change your choice using “Analytics preferences” at the bottom of a marketing page. We retain your preference for 180 days and honour browser Do Not Track and Global Privacy Control signals. Google may process this analytics data outside India. We do not fingerprint visitors. The console asks for analytics permission separately. If you opt in before creating an account, it can report three milestones to the same Google Analytics property: signup completed, your first new database running, and your first successful Workbench query. It sends milestone names and a fixed page label, never account or database identifiers, query text, results or private console URLs. Hashed identifiers stay in your browser to prevent duplicate counting; they expire after 180 days or are removed when you withdraw consent. A shared analytics cookie can connect your consented website visit with these console milestones. Use “Analytics preferences” in the console to decline or withdraw; this stops measurement and removes analytics cookies without interrupting your work. Our content-delivery and hosting layer records standard access logs - IP address, user agent, referrer, timestamp - for abuse prevention and security monitoring. Those logs are retained for 30 days and then discarded. We do not link them to any other identifier. Lawful purpose: Section 4(2) DPDP Act - "specified purpose" of operating and securing a public website. OriginChain Cloud - the managed service When you sign up we collect the email, organisation name, and billing details you give us. Account-related personal data is stored in our managed account database in the Mumbai (Asia Pacific) region. That account system never touches the rows you put into your tenant. Your tenant lives in the region you pick. Rows, transaction logs, backups, and snapshots stay in that region. We do not replicate personal data across regions unless you explicitly request it. We collect operational metrics from your tenant - request rates, latencies, cache hit ratios, replication lag - over a private channel, and use them to run the service and show you dashboards. We never sample the content of your rows or your queries. Ask AI, the assistant in the console, is the one exception, and only when you use it. What you type to Ask AI, and the results of the reads it runs to answer you (which can include rows from your databases), are sent to our model provider to compose the answer. Ask AI acts only with your own permissions and changes nothing without your approval. Your conversations are kept in your own browser, not on our servers; we record the size of each answer (token counts), the actions you approved, and any rating you give, never the conversation itself. Access to your tenant from our side is limited to a small on-call team, fully audit-logged, and only used to respond to a support ticket you file or to a live incident affecting your tenant. Lawful purpose: Section 4(2)(a) DPDP Act - performance of the service contract you signed up for; Section 4(2)(b) for tax / accounting record-keeping. Categories of personal data Identity & contact data: name, email address, organisation name. Billing data: tokenised card identifier (we never receive PAN/CVV - Razorpay does), billing address, GSTIN if provided, invoice history. Authentication data: hashed bearer tokens (Argon2id), session cookies, IP address of recent sign-ins. Service-content data: any rows you choose to store in your tenant. We treat the entire row blob as opaque - we do not classify, index for ML, or enrich it. When you use Ask AI, the rows it reads for you are processed by our model provider to answer you. Operational telemetry: request timestamps, error codes, latency buckets, cache-hit rates. No row content, no query content. Who we share data with Sub-processors used to deliver the Service: • Amazon Web Services, Inc. - cloud infrastructure: compute, storage, backups, DNS, object storage, our managed account database, and monitoring. • Razorpay Software Pvt Ltd - payment processing. Card data is tokenised; we never receive PAN or CVV. • Anthropic - AI model provider: (1) Ask AI, the console assistant: the messages you send it and the results of the reads it runs for you, to compose answers; (2) natural-language compilation of /v1/ask requests when the LLM compiler runs. We do not store model output beyond the response we return. We do not sell personal data, share it with advertisers, or use it for cross-product marketing. We may disclose personal data when compelled by a valid Indian legal request (court order, summons under Section 91 CrPC, lawful direction of a government agency under Section 69 IT Act). We notify you of such requests where legally permitted. Where data is processed By default, all customer rows and tenant operational data stay in the Mumbai (Asia Pacific) region - Indian sovereign territory. Account-level data (email, billing) is processed in the Mumbai region. For cloud-service data, cross-border transfer occurs if (a) you select a non-Indian region for your tenant, or (b) you route /v1/ask traffic through a model endpoint in another region, or (c) you use Ask AI in the console: what you send it, and the data it reads to answer you, are processed by our model provider, which may be outside India. Each is an explicit choice on your part. Where the DPDP Act restricts cross-border transfer to specific countries, we comply with the restriction and notify you if your selected configuration becomes non-compliant. How long we keep data Tenant rows: as long as the database exists. When a database is deleted, its stored data is erased within 7 days and its backup snapshots within 30 days. Account / contact data: while the account is active, plus 7 years of billing record retention as required by Section 44AA of the Income Tax Act 1961. Authentication & security logs: 90 days. Marketing-site access logs: 30 days. Your rights as a Data Principal Under Sections 11–14 of the DPDP Act, you have the right to: (a) confirm whether we process your personal data and obtain a summary; (b) seek correction or erasure of inaccurate or unlawful data; (c) nominate a person to exercise these rights on your behalf in case of incapacity; (d) grievance redress for unsatisfactory responses. To exercise any right, email grievance@originchaindb.com. We respond within 15 days. If unsatisfied, you may approach the Data Protection Board of India established under Section 18 of the DPDP Act. If you are an EU/UK resident and EU/UK data protection law applies, GDPR-equivalent rights apply: access, rectification, erasure, restriction, portability, objection. The same email reaches us; we respond within 30 days. Consent and withdrawal We rely primarily on contractual necessity (Section 4(2)(a) DPDP Act) - you signed up to use a service, we process the personal data needed to deliver it. For anything outside the strict service-delivery scope (e.g. opt-in marketing emails), we ask explicit consent and you can withdraw it at any time from /app/settings. How we protect data TLS 1.2+ on every external endpoint. Argon2id for stored credentials. AES-256 encryption at rest on all volumes and object storage (provider-managed keys; customer-managed keys available on Enterprise). Principle-of-least-privilege access control with no direct SSH - operator access is brokered and fully audit-logged. Daily encrypted backup snapshots into a 30-day-retention vault. See /security for the full posture. Personal data breach If we become aware of a personal data breach affecting you, we will notify you and the Data Protection Board of India in accordance with Section 8(6) of the DPDP Act and the breach-notification rules thereunder. The notification will describe the nature of the breach, categories and approximate number of affected records, likely consequences, and steps taken to mitigate it. Data Processing Addendum If you are processing personal data of others on the Service, you are the Data Fiduciary and Silicoyn Technologies Pvt Ltd is your Data Processor. The full DPA is at originchain.ai/dpa; email legal@originchaindb.com for a counter-signed copy. Children's data OriginChain is not directed at children under 18 and we do not knowingly collect personal data of children. If you believe a child has provided us with personal data, email grievance@originchaindb.com and we will delete it. Changes to this notice If this notice materially changes, we will update the date at the top of the page, note the change in our changelog, and email everyone on the managed service. We will not quietly start collecting anything new. Questions about any of this? Email us directly. We reply within a day. support@originchaindb.com→ --- ## Products | OriginChainDB Canonical source: https://originchaindb.com/product Product overview Build more from the data you have. Move your data in, query it four ways and build useful applications. Find answers with Ask AI, create views with Vezual and connect the tools your team already uses. Explore products Start building A foundation. A new perspective. Build with the database. Explore with a visual workspace. 01 / The engine OriginChainDB SQL, vector, graph and full-text in one engine. Build search and connected-data features around the records your application uses. Explore the database SQL Vector Graph Full-text One databaseFour ways to query 02 / The workspaceBeta Vezual Describe the view you need. Turn your selected database tables into dashboards and live data pages you can refine and share. Explore Vezual Your data, in view Describe a view of your data+ Illustrative workspace Move in. Find answers. Bring your data. Ask your next question. Tools to help you move an existing workload and make its data easier to explore. Migrate Data migration Move existing data into OriginChainDB. Review schemas and mappings, check your data and verify the copied records before switching your application. PostgreSQLMySQLSQL ServerMongoDBObject-storage files 01Review 02Copy 03Verify OriginChainDB Available on dedicated configurations, with live sync for supported PostgreSQL and MySQL sources. Explore Migrate Ask AI Natural language Ask questions about your tables in plain language. Inspect the query plan and returned database rows to understand how your question was answered. Your question“Show records created this month.” 01Query plan 02Database results Illustrative flow Model-assisted questions use your configured provider. Choose the tables and review the generated plan. Explore Ask AI Model providers Four data models Choose how you query. Start with the question your application needs to answer. 01 / SQL Structured records Find the facts in your records. Filter records, join related tables and calculate totals for your application. 02 / Vector Meaning & similarity Look beyond matching words. Search embeddings for similar meaning, then retrieve the records behind each match. 03 / Graph Relationships Follow the connections. Explore relationships between records to uncover context, dependencies and paths. 04 / Full-text Words & phrases Make your content searchable. Find terms and phrases in indexed text, with ranked search for relevant results. Query capabilities depend on your configuration and selected add-ons. Compare plans Connect your tools Keep the tools you know. Bring your database clients, application code and AI assistants to OriginChainDB. Explore integrations SQL client and ORM connections require a dedicated PostgreSQL listener. The current login is read-only; use HTTPS for writes and schema changes. Connect with your instance's PostgreSQL endpoint to browse records and run supported SQL from a familiar workspace. Connect your SQL client Use compatible PostgreSQL drivers for read-only queries. Check the generated SQL; ORM writes and migrations need a different interface. Check ORM compatibility Give AI tools a way to inspect schemas, ask questions and query your database through the OriginChainDB MCP server. Explore MCP setup & availability Choose a client and review its API coverage and preview releases. TypeScript / JavaScript Python Go Java C# Ruby PHP Rust Browse SDKs Around your database Make it work for your team. Manage access, plan recovery and choose where your database runs. Authentication Control who can read your data with database users, roles, row policies and column masks. Explore access controls Storage Choose dedicated capacity and understand snapshots, retention and recovery for your deployment. Explore storage Deployment Start on shared infrastructure and move to dedicated resources in your region as your requirements grow. Explore deployment Your next step From exploring to building. Start free --- ## Ask AI: natural-language database queries | OriginChainDB Canonical source: https://originchaindb.com/product/ask Ask AI Ask in your words. See the query it runs. Turn a question about your tables into database results. Keep the selected data and executed query plan visible, so your team can understand the answer. Start free Read the Ask guide Question to resultAsk AI Your questionWhat do you want to find? Context from your selected tables 01Query plan Read the tablesApply the conditionsReturn the result 02Database rows Ready for your application Illustrative flow · ask, inspect, understand Make data questions easier to answer. Help your team get closer to the records behind a decision. 01 Start with a question. Give people a way to explore tables using the words they use at work, with results returned from the database. 02 Keep the scope clear. Choose relevant tables so the question is interpreted in the context your application intends. 03 Understand the result. Request the executed query plan alongside the rows to inspect the tables, filters and operations behind the answer. A question with context Be specific. Keep the answer useful. A clear question names the data, the condition and the result you want. Ask AI uses that context to compile a query against your registered tables. Explore table scoping See a minimal request A scoped question with the query plan included in the response. { "nl": "Count records in activity.events", "schemas": [ "activity.events" ], "show_plan": true } Illustrative request · use your own registered table Choose the relevant tables Pass the table scope with your question. This gives the compiler a focused set of fields and relationships to consider. Ask one clear question Name the quantity, filter or grouping that matters. Split unrelated requests into separate questions. Inspect the plan and the rows Confirm the intended tables and conditions were used. Compare the result with familiar data before using it in an application workflow. From a question to a feature Bring Ask into your application. Send a question through the API, receive database rows and include the executed plan when you need to explain the result. Built-in rules first. Recognized questions compile directly. Other questions can use the language model configured on your instance. Reuse matching plans. The response reports whether a plan was reused. Reuse depends on the schema and authorization context. Before you build A little more about Ask AI. Explore the documentation Is every question sent to a language model? No. Matching cached plans can be reused, and built-in rules handle recognized questions. Questions that need model assistance are sent to the provider configured on your instance. Consider the question and selected data context when choosing that provider. Can I inspect how the answer was produced? Yes. Set show_plan to request the executed plan with the result. It helps you check the selected tables, filters and operations. The plan is returned after execution. What happens if I do not select tables? The compiler considers the catalog allowed by the active database identity. Giving it a relevant table scope reduces ambiguity, especially in a larger catalog. Build with OriginChainDB Make your next question a query. Start free Read the Ask guide --- ## Authentication & access control | OriginChainDB Canonical source: https://originchaindb.com/product/authentication Authentication Know who connects. Define their access. Give each application a credential with a clear purpose. Manage database identities and permissions, then verify the access your application actually uses. Start free Read the access guide Identity & scope Your applicationServer-side credentials 01 Instance token Authenticate the request Instance + tenant 02 Database identity When required by your instance User + API key Access checked at the database Database-user read controls Table grantsRow policiesColumn masks Illustrative HTTP flow · controls depend on instance configuration The right credential. For the right job. Console membership, database access and service operations have different responsibilities. Keep their credentials distinct. 01 Instance token For application requests Authenticate engine HTTP requests to a specific instance and tenant. Personal tokens inherit the member’s effective access; choosing read/write cannot increase it. Start in Connect; review Your tokens or Organization tokens 02 Database identity For database permissions Identify the database user whose roles, grants and read policies apply. HTTP uses the user’s API key; a per-user SQL listener uses its login password. Manage in Access Control 03 Organization API key For management operations Authenticate supported organization and control-plane operations, including managed embeddings. Keep this separate from credentials that query your database. Use with the relevant service API i Adding someone to your organization’s Team does not itself grant database permissions. Database access Shape the access. Keep the source intact. Use database roles and read controls to decide what an identity can retrieve from your tables. Keep the policy close to the data it protects. Explore database access Test as the intended identity. Check an allowed operation and a denied one on each query path your application uses. An administrative bearer does not demonstrate restricted access. 01 Roles and table grants Group database responsibilities into roles. Review inherited roles and object scopes, then grant the table access each identity needs. 02 Row policies Define read conditions for a table and role. On the documented database-user read path, records that do not satisfy the condition are filtered out. 03 Column masking Configure masks for sensitive columns. Read policies evaluate the underlying values before masking shapes the returned fields. Read about roles and grants From first connection to the next rotation. Keep credentials tied to an owner and purpose, with a clear process for changing or removing access. 01 Create & scope Use the credential offered by Connect. Where access tokens are supported, choose the owner and required permissions, then save the shown-once secret. 02 Connect & verify Copy the complete OC_URL and the credential for OC_TOKEN from Connect. Keep the URL unchanged, load secrets on your server and test the expected access. 03 Replace & confirm Update clients with a replacement token, test it and revoke the old one. Check the returned status, wait for any pending engine confirmation and test that the old credential is refused. Token changes need confirmation. Revocation can reach running engines asynchronously. A successful management response alone does not establish that every engine has applied the change. Follow the credential guide Put access into practice. Find the connection details and controls that match your application. HTTP authenticationBearer and database-identity headers. SQL client connectionsRead-only PostgreSQL login and TLS settings. Access Control guideIdentities, network rules and authorization history. Before you connect A few useful distinctions. Do all HTTP requests need a database-user key? Use the credential supplied by Connect: an access token where supported, or the instance key on other configurations. Where database identity is required, also send both X-OC-DB-User and X-OC-DB-Key. A bearer-only request is not evidence that database-user row policies or masks were applied. Can a token make an application read-only? A personal instance token can carry read-only access, enforced by the service. Selecting read/write does not exceed the member’s effective permissions. Verify the expected allowed and denied operations using the actual token and interface your application uses. What happens when a team member leaves? Removing a member or leaving an organization revokes that member’s personal instance tokens. Check the Team page for any pending confirmations across instances. Organization API keys and database identities are separate; review them and other shared credentials as part of offboarding. What other controls can I review? The connected console exposes network address rules and authorization audit history for the selected instance. Confirm the applied state and available capabilities there. An empty HTTPS IP access list allows requests from any address; it does not open a SQL wire listener. Read the access and network guidance. Build with OriginChainDB Build with access in mind. Start free Read the access guide --- ## Model providers & BYOK | OriginChainDB Canonical source: https://originchaindb.com/product/byok-llm Model providers Choose your model. Ask your data in plain language. Connect your model provider to Ask AI. Review the query it creates and the records it returns. Configure a provider Read the Ask AI guide A key connects a question to a selected model From question to query Ask a question. Check the query. Ask AI turns a question into a query plan. Inspect the selected tables, filters and results. Review generated queries before using them in your application. Three steps to start 01 Select a provider Choose a provider and model available in your instance settings. 02 Save the connection Save your provider key and endpoint settings. Stored keys are encrypted and masked in the console. 03 Inspect one answer Ask about a known table. Check the query and returned rows against your expected answer. Understand a query plan Credentials and configuration Manage your provider connection. Update the instance settings and provider account when your needs change. 01 Change the provider Choose an available provider or model. Update its settings and test a question. 02 Disable BYOK Return to the engine’s default behavior. Keep the saved configuration and test the result. 03 Replace a key Revoke the old key with its provider, then save a new one here. Deleting a saved configuration does not revoke the provider key. Some questions use rules or cached plans. They may not call your model provider. Before connecting Check the provider’s terms and costs. Provider charges are separate from your database plan. Check its data handling, regions and rate limits. Confirm which question and table details are sent to the provider. Ask AI documentation Question format, plans and returned database results. Application access Scope the database identity used by your application. Database pricing Compare instance plans separately from provider charges. Build with OriginChainDB Set up your model provider. Configure a provider Read the Ask AI guide --- ## Multimodal database for search and connected data | OriginChainDB Canonical source: https://originchaindb.com/product/database Distributed multimodal database Four data models. One database. Bring structured queries, semantic search and connected data into one database. Give your application more ways to find the right information, with fewer separate systems for your team to manage. Start building Explore the data models One engine, four ways to query SQL Structured records Vector Meaning and similarity Graph Relationships Full-text Words and phrases OriginChainDBConnected by record IDs Query capabilities Choose the query for the task. Start with one model. Add another as your application needs more ways to find and understand its data. 01 / SQL Filter and aggregate. Look up records, apply conditions and calculate totals across your tables. 02 / Vector Search by meaning. Find semantically similar content using embeddings, even when the wording differs. 03 / Graph Follow connections. Traverse relationships between records to explore their context and dependencies. 04 / Full-text Find the right words. Search indexed text for matching terms and retrieve the passages they appear in. In practiceSee how the four models can work together For a charger lookup, graph finds compatible devices, SQL checks stock, vector finds the relevant setup guide and full-text locates a specific instruction. Your app connects the results using record IDs. Explore the catalog code example What you can build Put your data to work. Bring search, similarity and relationships into the features people use every day. Explore all solutions 01 Knowledge search Find relevant passages by their wording or meaning, then retrieve the source records for your application or AI workflow. 02 Recommendations Discover similar items, follow their relationships and check record attributes before making a suggestion. 03 Fraud investigation Explore connections between accounts, devices and transactions to help investigators spot shared patterns. Behind the queries Keep every result linked to its source. Record IDs let your application connect a search match to the original data and its relationships. Explore the architecture Give your records a shared identity Reference the same record ID in your tables, relationships and search indexes so results can be traced back to their source. Prepare the indexes you need Your ingestion code writes searchable text to the full-text index and stores embeddings in the vector index. Bring results together in your app Use returned IDs to fetch source records and combine the context your application needs. Connect your application Connect the way you build. All documentation HTTP HTTP API Send requests for SQL, vector, graph and full-text queries. Work directly with the responses in your application. Explore the API SQL SQL clients Use the current read-only PostgreSQL login to browse records and run supported queries. Use HTTPS for writes. Connect a SQL client SDK SDK guides Find installation and query examples for your language, with guidance on preview versions and API coverage. Choose your SDK Need to write data? Use the HTTPS API for writes and schema changes Deployment & operations A clear path to production. Choose where your database runs, who can access it and how you recover. 01 Deployment Start on shared infrastructure, then choose dedicated resources in your region. Add an optional warm standby as your workload grows. Explore deployment 02 Access controls Use database roles, row policies and column masks to control which records and fields a database user can read. Review access controls 03 Backup & recovery Plan how you will recover your data. Review backup retention, restore procedures and recovery options for your configuration. Read the recovery guide Choose the capabilities you need. Features and capacity depend on your configuration and selected add-ons. Compare plans Build with OriginChainDB Start with your data. Build what comes next. Run your first query Deployment guide --- ## Full-text search for words, phrases and relevance | OriginChainDB Canonical source: https://originchaindb.com/product/fts Full-text search The right words. The relevant records. Make documents and application content easy to search. Match words and phrases, rank relevant results and bring people straight to the source. Start free Full-text guide data accessSearch terms DOCUMENT / 07Match A guide to data access Define who can read your data and review the access they need. Source record doc-07 Illustrative document. Matches stay connected to their source ID. Choose what a match means. Start with the search behaviour your users need: all the terms, an exact phrase or a ranked list. AND Boolean Does it contain every term? Match records containing all the query words when you need a clear inclusion rule, without relevance ranking. Explore Boolean " " Phrase Do these words appear together? Find an exact sequence of words in the same order, useful for names, quoted passages and specific terminology. Explore Phrase 1·2·3 BM25 Which matches are most relevant? Rank matching content using term frequency, term rarity and document length, then return the leading results. Explore BM25 BM25, phrase search and advanced options require the corresponding full-text capability on your instance. Review feature availability. Search beside your records Keep the content and its context connected. Use a table full-text index to make selected text searchable. Current engine releases maintain these indexes as rows are inserted, updated and deleted. Define a full-text index Search results carry record IDs, so your application can retrieve the source and follow its relationships. 01 Select the text Choose the fields people need to search in your table. 02 Choose the search mode Match terms, find a phrase or rank results by relevance. 03 Open the original record Use the returned ID to show the matching content and its context. Using the separate document-index API? Your application submits text under a document ID and re-indexes it when the source changes. These explicit entries are separate from row-maintained table indexes. Use the original record's ID to keep results connected. Read the indexing guide Relevance you can understand Make the best matches easier to recognize. Refine how you retrieve content and give people a clearer reason to open a result. A search across fields Give the title more say. Title Higher weight Body Supporting context Choose field weights in your query to reflect where a match matters most. Illustrative weighting, not a relevance score. Give fields different weight Make a title match count differently from a mention in the body, using multi-field weights. Show why content matches Use supported BM25 highlights, facets and scoring explanations to help people understand the results. Express a more precise query Use the query DSL for supported filters, negation and field-level clauses when a simple search needs more control. What should I know about search terms and scores? The simple query endpoint tokenizes and lowercases text. Choose phrase or boolean behaviour through the mode; typed operators such as “AND” or “NOT” are not a query language on that endpoint. Use the DSL for supported structured clauses. BM25 scores explain relevance within a query. Compare the results for that query, rather than comparing scores between different searches. Read the search reference Build your search experience. Start with a query, then choose how your application connects. Start with ranked search Index sample content and return relevant matches. Connect an Elasticsearch client Review supported client operations and deployment requirements. Build with an SDK Choose a client and check its full-text API coverage. Elasticsearch compatibility Existing index upgrade guide Build with OriginChainDB Make your content easier to find. Start free Full-text guide --- ## Graph queries for connected data | OriginChainDB Canonical source: https://originchaindb.com/product/graph Graph Your data connects. Make those links useful. Follow relationships between records to find context, trace dependencies and investigate patterns. Keep those connections beside the data your application already uses. Start free Build your first relationship Context through connections RecordsDeclared relationshipsIllustrative graph Ask a connected question See more than a single record. A connection can explain context, reveal a dependency or give an investigation its next step. 01 What else is connected? Find neighbouring records and use their attributes to build a fuller view of a person, document or asset. Neighbours & reverse lookups 02 How are these related? Explore bounded neighbourhoods and choose a path method to investigate the route between records. Traversal & paths 03 Which patterns stand out? Use supported ranking and community methods to investigate influence and groups within your relationships. Ranking & communities Model the relationship Start with the references already in your data. Give a reference field a named relation so the database can follow it. Source fieldrecords.topic_id The reference on your record. Named relationshipabout Target keytopics.id The record it connects to. 01 / Declare Define the connection. Choose the source field, target key and relation name. Set the traversal direction your application needs. 02 / Write Keep working with records. The engine maintains declared relationships as rows are written, updated or removed. 03 / Explore Follow the relation. Use the graph API or supported Cypher patterns to reach connected identities and records. Use supported key types and relation directions. Traversal methods have their own schema and depth requirements. Build a graph schema Choose your query One connection. Several ways to explore. Choose a method that returns what your application needs: nearby identities, a neighbourhood, a route or the fields of connected records. Explore the graph API 01 Follow a declared relationship Start with one record and inspect its neighbours. Use reverse lookups when the relation's configured direction supports them. Neighbour endpoints return record identities. Fetch the underlying rows when your application needs their fields. Explore one-hop queries 02 Explore a bounded neighbourhood Use breadth-first traversal to find records within a chosen number of hops. Keep the scope relevant to the question. Choose a path endpoint when you need a route. Reachability and a materialized path are different results. Explore traversal methods 03 Return connected records with Cypher Describe a supported pattern and return the fields your application needs from the matching records. OriginChainDB implements a documented Cypher subset over declared relations. Check supported patterns before porting queries. Read the Cypher guide Connected to the rest of your data Make a search result the start of discovery. Use record IDs to move from a match to its source, then explore the relationships around it. 01 Find a starting point. Use SQL, vector or full-text queries to locate the relevant records. 02 Add the connections. Follow declared relationships to retrieve the context around a match. 03 Build the experience. Combine the results your application needs for discovery, recommendations or investigation. Graph capabilities and algorithms depend on your configuration. Compare plans and add-ons. Build with OriginChainDB Start with a record. Follow its connections. Start free Build your first relationship --- ## Migrate your data | OriginChainDB Canonical source: https://originchaindb.com/product/migrate Migrate Move your data. Review every step. Bring existing databases and files into OriginChainDB. Review the mapping, check your data and verify the move before you switch your application. Explore dedicated plans Migration guide Illustrative migration planReview FromYour sourceExisting records ToOriginChainDBMapped tables Field mappingDestination type record_idtext created_attimestamp descriptiontext Inspect the plan before you move. Supported sources Start with what you have. Copy selected data from supported databases or object-storage files. Use live sync with supported PostgreSQL or MySQL sources to keep applying changes until switchover. Migrate requires a dedicated configuration. File imports support CSV, TSV, JSONL and JSON arrays, including gzip-compressed data. Read the source requirements Migration options by source SourceCopyLive sync PostgreSQL Yes Yes MySQL Yes Yes CockroachDB Yes Copy only MariaDB Yes Copy only SQL Server Yes Copy only MongoDB Yes Copy only S3-compatible files Yes Copy only From source to destination A move you can inspect. Make the important decisions before your application depends on the new database. 01 Review the destination Choose the objects to move. Check table names, field types, primary keys and relationship mappings before approving the plan. 02 Check and copy your data Find values that do not fit the plan before the move. Follow copied and set-aside counts, then resolve anything that needs attention. 03 Verify, then switch Review the verification results and test your application. For live migration, pause source writes and complete the documented switchover. A completed copy can still contain set-aside rows. Review the recorded counts and verification results before treating a table as ready. More ways to use the data Prepare for what you want to build. Review additional data shapes as part of your migration plan. Search & relationships Make the connections useful. Review full-text fields and graph mappings during planning. Supported source relationships can become connections your application can query. Explore migration mappings Embeddings Prepare selected text for similarity. Use a tested saved embedder to embed selected rows during migration. Choose text fields, row conditions and a maximum row count for the embedding work. Explore embedding runs Plan your move Know the next step. Review the migration guide, then check how your application will connect and query the destination. Does copying change my source records? A copy reads the selected source data without changing its rows. Live sync also requires source replication access and setup. Review those prerequisites before starting. What happens to rows that cannot be copied? By default, Migrate sets a problematic row aside and continues. You can choose to stop the table instead. A table with set-aside rows is partial; review the reasons, fix the issue and follow the supported retry procedure. Can live sync run as permanent replication? Live sync is a migration workflow for supported PostgreSQL and MySQL sources. Pause source writes for switchover, verify the destination and update your application's connection. It is not permanent bidirectional replication. Where do I begin? Open your dedicated instance, then choose Platform, Migrations and Data migration. The migration guide walks through source selection, planning and verification. Build with OriginChainDB Give your data a new place to grow. Explore dedicated plans Migration guide --- ## Multi-writer - OriginChainDB Canonical source: https://originchaindb.com/product/multi-writer multi-writer early access One machine failing shouldn't be your outage. Multi-writer runs your database across multiple nodes with consensus replication: a write is confirmed only once the cluster has accepted it, and if a machine dies the survivors keep going — measured in fault drills, not just promised. Join early access → The database what it means for your business Resilience you can put in front of a risk committee. Confirmed means confirmed A write isn't acknowledged until the cluster has accepted it. Across our leader-crash, network-partition and split-brain drills: zero acknowledged writes lost, zero divergence. A machine fails, you keep running When a node dies, the remaining nodes elect a new leader and writes keep flowing. A hardware failure becomes a blip in a graph — not an incident channel. Fails safe, not silent A node cut off from the cluster refuses writes rather than quietly forking your data. You'll never merge two versions of the truth on Monday morning. Proven by drills, not adjectives We publish what we test: crashed leaders, partitions, killed majorities, slow nodes. Every claim on this page traces to a drill we ran against real clusters. the moment it earns its keep Hardware fails on a schedule nobody publishes. On a single machine, that's a page, a scramble, and an apology to customers. On a multi-writer cluster, leadership moves to a healthy node and your application keeps writing — we've crashed leaders mid-traffic in drills and watched the cluster carry on without losing an acknowledged write. Multi-writer is in early access: we're running it with design partners today and hardening it in the open. If losing a box can't mean losing your evening, talk to us. from our fault drills 0 acked writes lost across fault drills 0 divergence across partition drills 3 nodes in a typical cluster majority required before a write is confirmed early access Running something that can't afford a bad night? Let's talk. Join early access → How it works --- ## SQL queries for application data | OriginChainDB Canonical source: https://originchaindb.com/product/sql SQL Your records. Ready for real questions. Build application screens, combine related facts and turn activity into useful summaries. Query structured data in the same engine as your vectors, relationships and searchable text. Start free Run your first SQL query Records to resultsSQL app.recordsIllustrative data idtitlestatus 01Getting startedpublished 02Release notesdraft 03API guidepublished WHERE status = $1published Only the records you need Choose the fields. Apply a condition. Use the result in your application. A familiar query, connected to your data. Everyday application queries From a lookup to a bigger picture. Start with the record behind a screen. Add relationships and summaries as the question grows. WHERE · ORDER BY Find the records you need. Filter by the fields that matter, sort the result and return the right records for an application screen. JOIN Bring related facts together. Connect records across tables to answer questions that need more than one part of your data. GROUP BY · COUNT · SUM Turn activity into a summary. Group records and calculate totals for reports, operational views and the decisions behind them. SQL features depend on your configuration and supported query surface. Explore the SQL reference. A query for the task Express what your app needs. Use familiar SQL patterns to read and shape your records. Bind values as parameters and keep the result easy for your application to use. Read supported SQL syntax These examples assume tables named app.records and app.groups. No query runs on this page. 01 Filter and sort Return a bounded set of records with a matching status. SELECT id, title FROM app.records WHERE status = $1 ORDER BY id LIMIT 20; Pass the status in the parameters array, rather than joining user input into the SQL string. 02 Join related tables Add a group's label to the records that belong to it. SELECT r.id, r.title, g.label FROM app.records AS r JOIN app.groups AS g ON r.group_id = g.id; Use explicit aliases so your application can distinguish columns returned from different tables. 03 Summarize records Count the records in each status. SELECT status, COUNT(*) AS total FROM app.records GROUP BY status; Filter input rows with WHERE; use HAVING when the condition applies to an aggregated group. Understand the work A result you can use. A plan you can inspect. See how a query reaches its answer before deciding what to tune. 01 Read the plan Use EXPLAIN to inspect scans, indexes, joins and aggregation stages. 02 Narrow the work Filter the input, return the columns you need and review where an index can help. 03 Measure the change EXPLAIN ANALYZE executes the query and reports measurements so you can compare its work. A small LIMIT can still follow a large sort or join. The plan helps you see what happens first. Explore query plans Build in your workflow Connect with the tools you use. Work through an API, an SDK or a supported PostgreSQL connection. pgAdmin & DBeaver Use the current read-only login from an enabled dedicated PostgreSQL listener. Connect a SQL client Drivers & ORMs Check the SQL your ORM generates. Use HTTPS for writes and schema changes; the current PostgreSQL login is read-only. Review compatibility HTTP API & SDKs Send parameterized SQL from your application and work with the returned rows. Choose an SDK PostgreSQL protocol support has a documented scope. Check your application's SQL and ORM operations against the deployed instance. See the whole database Build with OriginChainDB Start with a table. Build with its answers. Start free Run your first SQL query --- ## Storage & recovery | OriginChainDB Canonical source: https://originchaindb.com/product/storage Storage & recovery Keep your data. Plan its recovery. Choose your storage, review available backups and practice restoring your application. Discuss your requirements Read the backup guide Snapshots preserve an earlier version of your data Three separate decisions Capacity, availability and recovery. Decide how much space you need, how the app stays available and how you restore data. Capacity Dedicated resources Compute and storage are separate from other customers. Allow space for records, indexes and growth. Dedicated instances Availability An optional warm standby Copies changes asynchronously and can lag behind. Keep backups as well as the standby. Understand failover Recovery Daily snapshots Daily snapshots are the dedicated recovery baseline. Check available copies and test a restore. Backup and restore Understand your configuration Compare your backup options. Recovery features depend on your plan and instance settings. Check availability in your instance settings. OptionWhat to expectWhat to check Free configurationShared resources within the current plan quota.Plan for development data; do not assume point-in-time recovery. Dedicated snapshotsDaily snapshots stored for the dedicated instance in its region.Which copies are available, how long they are kept and how to restore them. Archive streamingOpt-in preview for archived changes alongside snapshots.Check archive coverage and supported recovery points. Daily snapshots remain the baseline. Restore time varies. Test it with your data and record how long it takes. A restore you have rehearsed Restore in three steps. Write down who starts the restore, checks the data and reconnects the app. Read about durability 01 Choose a backup Choose an available snapshot or supported recovery point that covers the data you need. 02 Restore a separate copy Restore into a fresh instance while the running application stays separate. 03 Check and reconnect Check records, permissions and queries. Reconnect the app after they pass. Deployment documentation Read the setup guides. Deployment overview Regions, configurations and operational choices. Archive streaming preview Read its scope and limitations before enabling it. Plans and pricing Compare the resources available to your workload. Build with OriginChainDB Plan recovery around your workload. Discuss your requirements Read the backup guide --- ## Vector search for meaning and similarity | OriginChainDB Canonical source: https://originchaindb.com/product/vector Vector search Find the meaning. Keep the context. Find relevant content even when the wording differs. Search embeddings, retrieve similar matches and connect every result to the records your application needs. Start free Vector quickstart Meaning has neighbours Your queryNearby matches MatchesRecord IDsSimilarity scores Illustrative embedding space. Search uses the full vector. More ways to find what matters. Give search and discovery a sense of similarity, alongside the structured data you already use. 01 Search by meaning Help people find relevant documents and passages even when they use different words. 02 Discover similar records Use the similarity captured by your embedding model to surface related content or items. 03 Retrieve useful context Return record IDs with your matches, then bring their source data into an application or AI workflow. Prepare once. Search by similarity. Bring your vectors. Or start with your text. Choose the ingestion route that fits your application and embedding provider. From your application Supply your own embeddings. Generate vectors with your chosen model and store them under your record IDs. Send a query vector to retrieve the nearest matches. Your model·Vectors·Matches Use the vector API From a prepared table Use a saved embedder. Choose the text columns to embed and run a job on a dedicated configuration. Search the prepared table with a plain-text question using the same embedder. Table text·Embedder·Matches Prepare an embedding run How do embeddings stay current? Schedule embedding runs for new rows and, optionally, changed text. Without a schedule, start a run when you want vectors refreshed. When supplying vectors yourself, your application manages their updates. Use a consistent model, dimension and distance metric for stored and query vectors. Saved embedders require your provider endpoint and credentials. Search that fits your workload Balance memory, search effort and recall. Choose an index with measurements from your own dataset and the results your users need. Neighbour graph HNSW A starting point for approximate similarity search. Tune search effort and measure recall on your own data. Partitioned search IVF Organize vectors into cells and choose how many to inspect for each query. Compressed vectors IVF-PQ Evaluate a compressed representation when memory matters. Measure how compression affects your results. Filtering behaviour depends on the index. IVF-PQ does not support metadata filtering; review the index and filter reference before choosing. Dense + sparse vectors Two rankings. One candidate list. Store both representations under matching IDs and combine their rankings with reciprocal rank fusion. Retrieve the original records to add context. Explore hybrid vector retrieval DenseACB SparseBAD CombinedABCD Illustrative ordering Hybrid vector retrieval combines dense and sparse vectors. Full-text BM25 is a separate search path. Put similarity to work. Choose an entry point, then connect the returned IDs to the rest of your data. Your first similarity query Store a vector and retrieve nearby matches. Embedding runs & schedules Prepare table text and keep vectors current. Vector API Review writes, filters and query parameters. Browse SDKs Check feature availability Build with OriginChainDB Make your data easier to discover. Start free Vector quickstart --- ## Vezual: dashboards and live data pages | OriginChainDB Canonical source: https://originchaindb.com/product/vezual Vezual Turn your data into a useful view. Describe what you want to see. Build dashboards, 3D scenes and live data pages from selected tables, with room to refine the view and share it. Open Vezual View Vezual pricing VezualBeta Your data, in viewCanvas Compare Explore Inspect Describe the view you need. Illustrative workspace · charts, records and context One dataset. Several perspectives. Choose the view that helps people understand the data, from a quick comparison to a closer inspection. Dashboards Bring the pattern into view. Combine charts and summaries to compare categories and explore changes in your selected data. Tables & context Keep the detail close. Place records beside the chart, with text and layout that help people understand what they are looking at. 3D scenes Explore another dimension. Connect table rows to positions, sizes and colors, or compose scenes with supported objects and meshes. From question to canvas A conversation with something to show. Keep the question, selected data and resulting page together while you explore. Refine the view as your understanding changes. Start a canvas Vezual is in beta. AI creation and modification use Vezual credits; your database plan is billed separately. Choose the data Select a database and the tables you want to explore. Give the view a focused starting point. Describe what you need Ask for a comparison, a project overview or an experiment view. Vezual creates a layout using supported components. Refine the perspective Request another chart, change the emphasis or adjust the layout. Save separate canvases for different questions. Give the view its own space Open the saved canvas as a standalone page. Choose whether to publish a link with an approved data scope. Bring the files you have Separate spreadsheets. A connected starting point. Bring CSV files and Excel workbooks into one import. Review suggested column types, keys and relationships before creating the tables, then explore the imported data in Vezual. Import your data CSV files Excel sheets Review the structureTypes · keys · relationships Tables ready to explore Illustrative import flow · you approve the structure Keep the view useful Save the canvas. Choose how to share it. Keep a working perspective for yourself or give others a page they can return to. 01 Saved canvases Keep multiple views for a database and return to the layout and conversation you need. 02 Standalone pages Open a saved canvas in its own browser window with room to explore the data and controls. 03 Live public links Publish an approved table and field scope. Data refreshes from the database; you choose when layout changes are published. Anyone with a public link can view its approved data, including future rows in that scope. Choose the fields before publishing and revoke the link when you need to. What data does a canvas summarize? A canvas can use up to four tables, with up to 200 loaded rows and 24 fields per table. Its metrics summarize those loaded rows, rather than every record in a larger database. What uses Vezual credits? Successful AI creation and modification use Vezual credits. Failed generations release reserved credits. Opening saved pages, saving a canvas and manual changes do not use AI credits. View current credit packs and pricing. Can I refine a 3D scene? Yes. Adjust supported objects, positions, materials, lighting and saved camera views. You can map table rows to visual properties. Scenes use Vezual's supported components; external model or texture uploads and custom scripts are not supported. What context is used to generate a page? Your prompt and selected data context are sent to Vezual's generation model to create a page specification. Vezual renders that specification using its supported components. Build with OriginChainDB What would you like your data to show? Open Vezual View Vezual pricing --- ## Cancellation & Refund Policy | OriginChainDB Canonical source: https://originchaindb.com/refund-policy Policies & agreements Cancellation and refunds This policy explains how to cancel and when we refund payments for OriginChainDB, which is operated by Silicoyn Technologies Pvt Ltd, Bengaluru, India. It forms part of our Terms of Service. Billing Paid configurations are monthly subscriptions, billed in US dollars. You pay for the first month when you place your order, then on the same day each month until you cancel. Pooled configurations are paid by card. Dedicated configurations are confirmed by our team before they start, and are billed as set out in your order. Payments are processed by Razorpay. Cancelling You can cancel at any time by deleting the configuration in the console. Deleting stops the service and permanently deletes that database straight away; this cannot be undone, so export any data you need first. Its stored data is erased within 7 days and its backups within 30 days. Deleting also cancels that configuration's subscription, so you won't be charged for it again. Deleting your account Card billing is cancelled straight away, so you won't be charged again. Each pooled configuration keeps running until the end of the period you've already paid for, and is then deleted. You have 30 days to change your mind: sign back in and your account is restored. Card billing is not restarted, so a pooled configuration is still deleted at the end of its paid period; order it again if you need it. During those 30 days a database may be suspended; we email you before that happens. After 30 days, every database left in your account is deleted, and its stored data is erased within 7 days. Refunds Payments are non-refundable, including for a partly used month, except in these cases, which we refund in full: you were charged by mistake, for example twice for the same month; you were charged after you cancelled; your database could not be created and never became available; the law requires a refund. Credits for availability shortfalls are covered by our SLA, as described in the Terms of Service. Requesting a refund Email support@originchaindb.com within 30 days of the charge, with your account email, the configuration name and the payment ID from your receipt. We acknowledge requests within 24 hours and resolve them within 15 days. Approved refunds go back to the card you paid with; your bank usually shows them within 5-10 business days. Missed card payments If a monthly payment fails, it is retried automatically. If it still can't be collected, we email you, and your configuration keeps running for 7 more days before it is suspended. Suspension keeps your data. Once the payment is made, the configuration is restored. Email support@originchaindb.com if you need help paying. Contact Support: support@originchaindb.com · Grievances: grievance@originchaindb.com · Silicoyn Technologies Pvt Ltd, Bengaluru, Karnataka, India --- ## Releases - OriginChainDB Canonical source: https://originchaindb.com/releases Latest published releasePublished 19 October 2026 Covers 11–18 October 2026 Release notes · 11–18 October 2026 Migrate keeps a copy in sync until you switch over, and search by meaning and embedding schedules arrive. Also: team access you can shape, Vezual Beta, graph relationships on existing tables, closer PostgreSQL and steadier free and $29/$49 databases. ConsoleDatabasePlatformVezualMigrateVectors Read the full release ↗ Watch the release73 sec Your browser does not support this video. Download the release video.A 73-second overview of this release. Background music, no narration; every update is described in full on this page. 01MigrateMigrate: keep in sync, then switch over↗ 02VectorsSearch by meaning, and embedding schedules↗ 03MigrateMigrate: graph edges and search on every table↗ A running record Release archive Our weekly notes cover the previous Monday–Sunday, in India time. Versioned archive ↗ December 2025 – July 2026 2026 Oct19 Release notes · 11–18 October 2026 Latest Covers 11–18 October 2026 Migrate keeps a copy in sync until you switch over, and search by meaning and embedding schedules arrive. Also: team access you can shape, Vezual Beta, graph relationships on existing tables, closer PostgreSQL and steadier free and $29/$49 databases. ConsoleDatabasePlatformVezualMigrateVectors 10 highlights → Oct12 Release notes · 4–10 October 2026 Covers 4–10 October 2026 Vector search arrives on dedicated databases, with your own embedder and embedding runs, and Migrate can embed rows as they move. Also: 24 more queries match PostgreSQL, sequences and enum types, JSON like PostgreSQL, and your own request IDs. ConsoleDatabaseDevelopersMigrateVectors 9 highlights → Oct5 Release notes · 27 September – 3 October 2026 Covers 27 September–3 October 2026 Migrate is here: bring a PostgreSQL, MySQL, CockroachDB, SQL Server or MongoDB database, or data files, into a dedicated database, and check your data first. Also: all-or-nothing SQL requests, more PostgreSQL functions, role-aware console controls and public pricing. ConsoleDatabaseBillingMigrate 8 highlights → Sept28 Release notes · 20–26 September 2026 Covers 20–26 September 2026 New $29 and $49 monthly configurations you can buy by card in the console. PostgreSQL apps built with Django, SQLAlchemy and psycopg match on 154 of 165 checks, concurrent updates to a row are all kept, and the Data Explorer shows every table. ConsoleDatabasePlatformDevelopers 6 highlights → Sept21 Release notes · 13–19 September 2026 Covers 13–19 September 2026 The product is now OriginChainDB, at originchaindb.com. Decimal values compare by value, busy databases stay responsive, and the Elasticsearch-compatible API supports index aliases and aggregations over every matching document. DatabasePlatformDevelopers 4 highlights → No matching releases Try another search or choose a different product area. Stay in the loop Follow new releases. Follow the weekly notes for new features, fixes, and improvements. Subscribe with RSS ↗ --- ## Release notes · 13–19 September 2026 - OriginChainDB Canonical source: https://originchaindb.com/releases/2026-09-21 Watch this releaseVideo overview The release in focus47 sec Your browser does not support this video. Download the release video.A 47-second overview of the 4 updates in this release. Background music, no narration; every update shown in the video is described in full on this page. What’s new 4 highlights 01Platform OriginChainDB has a new home Our product is now called OriginChainDB, and its website and docs live at originchaindb.com. Links to the previous web address forward to the new one. Database connection addresses did not change with the rename, so nothing in your application needs updating. Available onEvery configuration 02Database Decimal values compare by value A NUMERIC or DECIMAL column compared with an INTEGER column is now compared by value, in single tables, join keys and filters, on the SQL API and on PostgreSQL connections. A CASE condition over a decimal column compares by value too, as in PostgreSQL. SQL SELECT o.id FROM orders o JOIN credits c ON c.amount = o.total Available onDedicated and Free configurations PostgreSQL compatibility ↗ 03Database Busy databases stay responsive A large table scan no longer holds up other clients of the same database, and bursts of prepared statements from many connections are paced. When heavy work is at its limit, a request waits briefly and then gets a clear “retry shortly” answer. At that limit, PostgreSQL and MySQL clients can get SQLSTATE 53000 (MySQL error 1041) when preparing a statement. The statement did not run: retry it with back-off, and inside a transaction roll back and retry the whole transaction. Available onDedicated and Free configurations Error codes ↗ 04Developers Search API: index aliases and aggregations The Elasticsearch-compatible API supports index aliases, and aggregations now run over every matching document. Available onDedicated configurations Elasticsearch-compatible API ↗ Also in this release New dedicated databases show as provisioning until they answer, so starting up no longer sends “not responding” alert emails. Over a PostgreSQL connection, CREATE TABLE refuses a table name that already exists, as PostgreSQL does. A TIMESTAMP (without time zone) column is now reported to PostgreSQL drivers as timestamp without time zone, so drivers return plain date-times; declare TIMESTAMPTZ for time-zone-aware values. In joins and indexed lookups, NULL never equals NULL, as in PostgreSQL (dedicated and Free configurations). --- ## Release notes · 20–26 September 2026 - OriginChainDB Canonical source: https://originchaindb.com/releases/2026-09-28 Watch this releaseVideo overview The release in focus64 sec Your browser does not support this video. Download the release video.A 64-second overview of the 6 updates in this release. Background music, no narration; every update shown in the video is described in full on this page. What’s new 6 highlights 01Platform New $29 and $49 monthly configurations Start small with a fixed-price configuration: 25 GB for $29 a month or 50 GB for $49 a month. Nothing to size: pick one, pay by card in the console, and connect. The $29 configuration includes 20 GB of data transfer a month, and the $49 configuration includes 50 GB. These configurations run on shared servers as a single node, with no high availability, standby copy or point-in-time restore. Available on$29/$49 configurations, ordered in the console See pricing ↗ 02Database ORM apps match PostgreSQL on 154 of 165 checks Django, SQLAlchemy and psycopg applications now see PostgreSQL-identical results on 154 of our 165 ORM compatibility checks. Joined columns carry the names PostgreSQL gives them, REAL values are true single-precision numbers, and drivers read each column's length and decimal precision from the result metadata. Sums of whole numbers are exact at any size, and AVG returns an exact NUMERIC, as in PostgreSQL. Over PostgreSQL connections a joined column is now named as PostgreSQL names it (d, not t.d), so code that read row["t.d"] must read row["d"]. The HTTP /sql API, MySQL and SQL Server connections are unchanged. 11 of the 165 checks still differ from PostgreSQL. Available onDedicated configurations, PostgreSQL connections PostgreSQL compatibility ↗ 03Database Concurrent updates to a row are all kept When many PostgreSQL connections change the same row at the same moment, every update the server acknowledges is kept. A transaction that would overwrite a newer committed change is refused at COMMIT with PostgreSQL's standard serialization error (SQLSTATE 40001), and nothing from it is written, so your application can retry it. SQL UPDATE accounts SET balance = balance + 10 WHERE id = 1 PostgreSQL connections run at READ COMMITTED, PostgreSQL's default. Reading a value, computing in your app and writing the result back can still lose an update, exactly as in PostgreSQL: use a single UPDATE … SET x = x + n instead. This covers PostgreSQL connections only. Available onDedicated configurations, PostgreSQL connections Transactions ↗ 04Console Data Explorer shows every table Every table now appears in the Data Explorer, including tables with capital letters or other characters in column names, a several-column or missing primary key, more than 50 columns or a TIME column, and search indexes. Tables the editor cannot safely change open read-only with a short reason, and a value the console cannot display no longer breaks the page. A CSV or JSON export imports back exactly: numbers keep every digit, and a number that cannot be stored without losing digits is refused with a clear message instead of being rounded. Tables the editor cannot safely change yet open read-only. Exports leave out columns that the import cannot take. Available onConsole, every configuration Console guide ↗ 05Console Redesigned Integrations and a demo workspace Integrations is redesigned: tools are grouped and searchable, you pick the instance first, and each tool has its own setup dialog. Organization navigation is simpler: the organization-level Alerts, Logs and Performance pages are gone, and each instance keeps its own diagnostics. A public demo workspace, with a sample organization, instances and data, runs entirely in your browser, and the sign-in and sign-up pages link to it. The demo uses sample data and cannot connect to real instances. Old bookmarks to the removed organization pages open Instances. Available onConsole, every configuration Console guide ↗ 06Developers Span queries and URI search in the search API The Elasticsearch-compatible API now answers span queries, such as span_term, span_near, span_or, span_not and span_containing, and URI search with q, df, default_operator and lenient on _search and _count. It also adds typed_keys, more _cat views, and index maintenance calls such as _flush, _cache/clear and _open. URI search works on _search and _count only. Available onDedicated configurations Elasticsearch-compatible API ↗ Also in this release Comma-separated joins of three or more tables (FROM a, b, c WHERE …) are answered on every connection type; a shape that cannot yet be answered correctly is refused with a message suggesting JOIN … ON (dedicated configurations). A newly created key or token stays on screen until you confirm you have stored it. Members can now leave an organization, unless they are its last owner. --- ## Release notes · 27 September – 3 October 2026 - OriginChainDB Canonical source: https://originchaindb.com/releases/2026-10-05 Watch this releaseVideo overview The release in focus64 sec Your browser does not support this video. Download the release video.A 64-second overview of this release. Background music, no narration; every update is described in full on this page. What’s new 8 highlights 01Migrate Migrate: bring your database to OriginChainDB On dedicated configurations, Migrate moves an existing database or data files into OriginChainDB from the console. Sources: PostgreSQL, MySQL and MariaDB, CockroachDB, SQL Server, MongoDB, and CSV, TSV or JSON files in cloud object storage. Migrate proposes the plan for you: exact column types, keys kept, foreign keys turned into graph links and full-text search suggested on long text. Every value arrives exactly or is refused with its row and column named, and each move shows live progress, can be resumed or cancelled, and is verified with row counts and sampled values per table. Dedicated configurations only. Each move is a one-time copy, and your source's data is never changed. Available onDedicated configurations Migrate documentation ↗ 02Migrate Check your data before you move it Check data reads every planned table before a move, writes nothing, and lists every value that would be refused, all at once. During a move, a row that cannot be moved is set aside with its reason while the rest of the table moves. Once you have fixed those rows at the source, one click moves them again; it adds rows and never overwrites them. Set-aside rows move again only when you press the button; nothing retries by itself. Available onDedicated configurations Migrate documentation ↗ 03Database Multi-statement SQL requests are all-or-nothing A request with several SQL statements now runs as one transaction, as PostgreSQL runs a multi-statement query: if every statement succeeds they are committed together, and if one fails nothing the request wrote is committed. A BEGIN … COMMIT or ROLLBACK inside a request now works as one transaction, and a BEGIN partway through includes the statements before it. Inside a SQL transaction, every statement sees the transaction's own earlier writes, including subqueries, upserts and MERGE. Cancelling a request stops its remaining statements, and a SHOW no longer swallows the statements after it. SQL BEGIN; DELETE FROM t; ROLLBACK Schema changes still apply at once: a CREATE, ALTER, DROP, TRUNCATE, GRANT or REVOKE after a write first commits the request's earlier writes, and the answer says which statements were committed. An application that sent BEGIN without a session and relied on its writes being committed anyway now needs a COMMIT. Multi-server databases keep running a request's statements one at a time. Available onSQL API, every configuration Transactions ↗ 04Database NULLs, upserts and READ ONLY match PostgreSQL UPDATE … SET column = NULL now stores NULL, also on a column that has a default value. INSERT … ON CONFLICT into a table whose primary key is generated or defaulted, such as DEFAULT gen_random_uuid(), gives each row its own key, and repeating a key in one upsert behaves as in PostgreSQL. Foreign keys are checked against the row as it will be stored, after defaults and type conversion. On PostgreSQL connections, a write inside a READ ONLY transaction is refused with PostgreSQL's error, and COMMIT AND CHAIN and ROLLBACK AND CHAIN open the next transaction as PostgreSQL does. SQL UPDATE t SET updated_at = NULL In a READ ONLY transaction, nextval() and functions that write, called from a SELECT, still write; PostgreSQL refuses them. An ON CONFLICT DO UPDATE that changes a column a generated primary key is computed from is refused with a clear message. On the SQL API, COMMIT AND CHAIN and ROLLBACK AND CHAIN are refused. Available onEvery configuration PostgreSQL compatibility ↗ 05Database More PostgreSQL functions and commands New functions: format(), to_char() and to_number(), pg_input_is_valid(), regexp_like, regexp_count, regexp_instr, regexp_substr and regexp_replace, and width_bucket(). VACUUM and ANALYZE are accepted and check that the table exists, so scripts and tools that run them no longer fail; OriginChainDB manages storage itself. LIKE and ILIKE accept an ESCAPE clause, EXTRACT supports century, millennium, decade, isoyear, week, isodow and julian for dates, and ON DELETE SET NULL and SET DEFAULT behave as in PostgreSQL. ORDER BY … LIMIT on a table too large for one query's memory now answers instead of failing with "result too large". SQL 'a_c' LIKE 'a!_c' ESCAPE '!' LIKE now treats a backslash as its default escape character, as PostgreSQL does: a stored pattern that relied on a backslash matching itself must double it or add ESCAPE ''. The ORDER BY … LIMIT change does not yet apply inside an explicit transaction, to SELECT DISTINCT … ORDER BY … LIMIT, or when the select list computes a value. Available onEvery configuration PostgreSQL compatibility ↗ 06Console Console controls follow your role Buttons you are not allowed to use are now disabled, with the reason, including for custom roles, deleting tables, importing and indexes. A database that is waking up shows as waking, and the Data Explorer and the Workbench wait for it instead of failing. States are clearer: a declined order reads "Declined", an expired approval request ends the wait, and a stalled database change offers Resume. An account with no organization yet gets a clear next step instead of an error. Rotating a key while the instance is stopping or being resized is refused with a clear message; rotate it once the instance is running. Available onConsole, every configuration Console ↗ 07Database Date ranges written the PostgreSQL way Filters such as DATE '1995-01-01' + INTERVAL '1 year' now work, and months and years are added as PostgreSQL adds them: January 31 plus one month is February 29 in a leap year. INTERVAL '3' MONTH, INTERVAL '1 year 2 months' and - INTERVAL '90' DAY work wherever a date is compared: filters, CASE WHEN conditions and join filters. Comparing a DATE column with ADD_MONTHS(), date_trunc(), LAST_DAY(), DATEADD() or another date minus an interval now returns the same rows as PostgreSQL. SQL SELECT COUNT(*) FROM orders WHERE o_orderdate >= DATE '1995-01-01' AND o_orderdate < DATE '1995-01-01' + INTERVAL '1 year'; Calendar intervals work in comparisons only for now: SELECT d + INTERVAL '1 month' as an output column returns a clear "not supported" message. Aggregates over joins that compare a DATE with ADD_MONTHS() and similar functions are not covered yet. Available onEvery configuration SQL ↗ 08Billing Public pricing and a refund policy The pricing page now shows the two configurations you can buy in the console today, at $29 and $49 a month, with buttons that lead straight to the console. A new Cancellation & Refund Policy page, linked from the site footer, explains billing, cancelling, refunds and missed card payments. You can cancel at any time by deleting the database in the console, which also cancels its subscription; deleting is permanent, so export any data you need first. The $29 and $49 configurations share compute on a single node, with no high availability, replicas or point-in-time recovery. Available onWebsite; $29/$49 and Dedicated configurations Pricing ↗ Also in this release Migrate: add your own full-text search fields and graph relationships to the plan before you move (dedicated configurations). Team invitations: every invitation link now opens the console’s invitation page. Demo workspace: try the demo, then sign in to your own workspace in one click. Website: a redesigned Newsroom for OriginChainDB announcements and product updates, and a new Careers page where you can register interest. Webhooks into tables with foreign keys: a delivery whose row points to a parent that does not exist yet is refused with a retryable 503 and Retry-After, and nothing from it is stored. --- ## Release notes · 4–10 October 2026 - OriginChainDB Canonical source: https://originchaindb.com/releases/2026-10-12 Watch this releaseVideo overview The release in focus64 sec Your browser does not support this video. Download the release video.A 64-second overview of this release. Background music, no narration; every update is described in full on this page. What’s new 9 highlights 01Vectors Vector search on dedicated databases The vector record API is on for dedicated configurations: create vector indexes and namespaces, write records with dense vectors, sparse vectors and metadata, and query them with metadata filters. A table's vector column reads back its vectors in SQL, and deleting a row deletes its vector. A key reaches an index only through a grant. Dedicated configurations only. You bring the embeddings or your own embedder; OriginChainDB does not run an embedding service. Available onDedicated configurations Vector documentation ↗ 02Vectors Bring your own embedder and embed your tables Save your own embedding provider, its key and model in the console, and test it. Then embed the rows of a table you already have with an embedding run: pick the columns, which rows and how many, and later runs can embed only new or changed rows. Your provider bills you directly. Available onDedicated configurations Embeddings ↗ 03Migrate Migrate: embed rows while you move When you migrate a database, you can embed rows on the way in: pick the text columns, which rows and a maximum number of rows, and Migrate fills the vectors with your own saved embedder. Available onDedicated configurations Migrate documentation ↗ 04Database 24 more queries match PostgreSQL 24 more query shapes now return exactly what PostgreSQL returns, on the PostgreSQL connection and the SQL API. Numbers are compared by value in grouping, joins and subqueries, so GROUP BY and DISTINCT treat 10 and 10.0 as one value. uuid and date/time literals are read exactly, a malformed uuid gets PostgreSQL's 22P02 error, and jsonb values are compared by value too. Not every jsonb query matches PostgreSQL yet. Available onEvery configuration PostgreSQL compatibility ↗ 05Developers Sequences and enum types for ORMs On the PostgreSQL connection, sequences work (nextval, currval, setval, lastval and DEFAULT nextval('seq')), SERIAL columns are integer, and CREATE TYPE … AS ENUM gives enum columns that compare and sort in the order their labels were declared. Four more queries now match PostgreSQL exactly: for example, RETURNING a jsonb column returns the stored document, and =, <> and IN compare numbers by value. More mistakes get PostgreSQL's own error codes, such as 42P01 for a table that does not exist. Prisma, TypeORM and GORM match PostgreSQL on many more of their getting-started steps. This is not full ORM compatibility: some of each ORM's steps still differ from PostgreSQL. Renaming a table (ALTER TABLE … RENAME TO) is refused. Available onDedicated configurations PostgreSQL compatibility ↗ 06Developers Versioned index names in the search API In the Elasticsearch-compatible API, an index named like logs_v2 is now its own index. You can create the new version, reindex into it, move the alias to it and delete the old one, without the names colliding. Available onDedicated configurations Elasticsearch-compatible API ↗ 07Console Table editor lists your column types The console's table editor, where you create a table and change its columns, now lists the column types your database offers: from text, UUID and decimal to date, time of day (new to the picker), interval, JSON, IP address and geographic point. Bytes columns, column defaults and unique indexes are not in the editor yet; use SQL for them. A table keyed by a floating-point, JSON, list or geographic-point column can't be edited there. Available onConsole, dedicated and Free configurations Console guide ↗ 08Database JSON compares and prints like PostgreSQL Comparing a JSON field with a literal now compares JSON values, as PostgreSQL does: doc -> 'age' = '25' matches 25 and 25.0 and no longer matches the string "25", also over CTEs, derived tables and views. Converting a JSON number to numeric keeps every digit. On the PostgreSQL connection, jsonb columns are reported as jsonb and print with PostgreSQL's spacing and key order, and JSON literals are typed json or jsonb. SQL WITH c AS (SELECT id, j FROM t) SELECT id FROM c WHERE j -> 'age' = '25' Not every JSON form matches PostgreSQL yet. Apps that relied on the old compact JSON text, or on 'null'::jsonb arriving as SQL NULL, may notice the change. Available onDedicated configurations PostgreSQL compatibility ↗ 09Developers Trace any request with your own ID Send your own request ID with the x-oc-logical-request-id header, and OriginChainDB records it and echoes it back, so you can match any error to our record of the request. Browser code can now read request IDs too. The TypeScript 0.5.0, Python 0.8.0 and Go v0.5.0 SDKs attach request IDs to every error and add a diagnostics option that is off by default and sends only metadata, never queries, data or error text. A request ID that is not a UUID is ignored, never refused. Using the TypeScript SDK in a browser worker? Use 0.5.1 or later. Available onEvery configuration API reference ↗ Also in this release PostgreSQL connections apply settings given at connect time (options=-c …, search_path, application_name) exactly like SET, and DISCARD ALL fully resets a session for connection poolers; open cursors are not dropped yet (dedicated configurations). PostgreSQL’s name column type works, with its 63-byte limit, and an extremely deeply nested CHECK, generated-column or index-filter expression gets a clear 54001 “statement too complex” error (every configuration). Graph and full-text searches, aggregations and suggestions honour X-OC-Statement-Timeout-Ms, show in GET /v1/queries and can be cancelled by id (every configuration). Free and $29/$49 databases: creating a per-user token now answers with a clear message pointing to the instance key, the only credential these databases use. Dedicated databases are unchanged. --- ## Release notes · 11–18 October 2026 - OriginChainDB Canonical source: https://originchaindb.com/releases/2026-10-19 Watch this releaseVideo overview The release in focus73 sec Your browser does not support this video. Download the release video.A 73-second overview of this release. Background music, no narration; every update is described in full on this page. What’s new 10 highlights 01Migrate Migrate: keep in sync, then switch over For PostgreSQL and MySQL sources, Migrate can now keep your OriginChainDB copy in sync with the source until you switch over, right from the console, which shows how far behind the copy is. PostgreSQL and MySQL sources only. Your source's data is never changed; a PostgreSQL source gains a replication slot and a publication until syncing ends. Very busy MySQL sources can fall behind while syncing. Available onDedicated configurations Migrate documentation ↗ 02Vectors Search by meaning, and embedding schedules Search a table's vectors with plain text: the database embeds your question with the same embedder that filled the table and returns the nearest rows, in the console and the API. Embedding schedules keep a table's vectors current automatically, and you can add a vector column to a table you already have. SQL ALTER TABLE docs ADD COLUMN embedding VECTOR(1536) Search by text needs a table filled by an embedding run or a migration with a saved embedder. Schedules embed new rows, and optionally changed rows. Available onDedicated configurations Vector documentation ↗ 03Migrate Migrate: graph edges and search on every table Tell Migrate which two columns a table links, and every row, such as each transfer or follow, becomes its own graph edge. Foreign keys that point at an email, a code or any other unique column become graph links too, and full-text search is set up on every table you bring over, including tables keyed by several columns. Links through unique columns: PostgreSQL, CockroachDB, MySQL and SQL Server sources, and the referenced table must be keyed by one column. Available onDedicated configurations Migrate documentation ↗ 04Console Team access you can shape Organize teammates into groups that grant roles, edit custom roles, give a role on chosen databases only, and add deny rules that take one permission away whatever the roles grant. An access review shows every permission a member has and where it comes from, and members see only the databases they can access. Available onConsole, every configuration Using the console ↗ 05Console Measured usage for each dedicated database The Usage page now shows measured API requests and data sent out for each dedicated database, alongside storage and compute. Available onDedicated configurations Using the console ↗ 06Vezual Vezual Beta, now under Plugins Vezual, for turning your data into dashboards, 3D scenes and shareable live pages, now lives under Plugins in the console and is labelled Beta. If a change fails, your canvas stays as it was; unsaved layouts can be restored after a reload; and a revoked share link stays revoked. Available onConsole, Beta About Vezual ↗ 07Database Add graph relationships to existing tables Declare a graph relationship on a table that already holds rows. Existing rows are linked at once, and later inserts, updates and deletes keep the links current. A statement that cannot work is refused with a clear error and changes nothing. SQL ALTER TABLE shop.orders ADD RELATIONSHIP placed_by (user_id) REFERENCES shop.users A relationship cannot be removed yet, and the target table must be keyed by a single column. Available onEvery configuration Graph documentation ↗ 08Database Full-text and geo indexes follow every write Full-text and geo indexes now follow every insert, update and delete, through every way of writing, and schema changes keep a table's search setup. An index created before 18 October 2026 must be created once more to get this behaviour. Available onEvery configuration Full-text documentation ↗ 09Database Closer to PostgreSQL More SQL results now match PostgreSQL exactly. Over PostgreSQL connections, psql's \d describes tables as PostgreSQL does, and foreign keys inside a transaction are checked at COMMIT, so rows that point at a missing parent are no longer stored. Available onSQL results: every configuration. psql and PostgreSQL-protocol behaviour: wherever PostgreSQL connections are available. PostgreSQL compatibility ↗ 10Platform Steadier free and $29/$49 databases A database that is busy, moving or just restarted now answers 503 with a Retry-After header and a short message instead of a raw error, so clients can retry safely. Each free database gets a fair share of its server, so one busy database cannot slow its neighbours, and right after a server is replaced a database quickly says to retry shortly instead of failing slowly. Available onFree and $29/$49 configurations Errors and retries ↗ Also in this release A redesigned Connect dialog in the console, with a Tokens section and copy-ready SDK examples. A tidier Data Explorer for databases with large catalogs. An email when your free database is ready, with a link to the quickstart. Safer sign-up and a sturdier $29/$49 checkout. Migrate: live sync keeps up with much busier MySQL sources. --- ## Developer resources, guides & learning | OriginChainDB Canonical source: https://originchaindb.com/resources Resources A clear place to start. A useful next step. Find the guide, reference or example you need. From your first connection to a closer look at the engine, keep the next step within reach. Open documentation Browse resources Your developer workspace LEARNUnderstand the building blocks. Concepts · guides · tutorials BUILDPut an idea into code. SDKs · APIs · implementation patterns EVALUATECheck what matters to your app. Architecture · benchmarks · security A path through the resources, at your own pace. Resource directory What do you want to do next? 01 Get your bearings Understand the database and make a first connection. Guides Documentation Explore concepts, connections and supported operations. Start here Quickstart Connect, add a record and run your first query. Practice Tutorials Work through a task with a guided example. 02 Build your application Choose an interface and find a useful implementation pattern. Clients SDK directory Find a GitHub SDK, its installation steps and API coverage. Reference API reference Look up endpoints, request shapes and responses. Try it Keyword and vector retrieval example Run a small example that combines search rankings and returns source passages. Connect Integrations Connect database tools, SDKs and AI clients. Applications Solution patterns Explore search, recommendations and operational workflows. Scenarios Industry guides Connect an industry problem to a practical data workflow. 03 Look beneath the surface Review the design, check the scope and test your workload. Design Architecture Understand the engine, query interfaces and data boundaries. Evidence Benchmarks Read the workload and methodology behind each result. Trust Security Review access controls, assessment information and policies. Answers Frequently asked questions Find answers about using and operating the database. 04 Keep learning Follow the product and learn with the community. Insights Engineering blog Read implementation notes, ideas and technical walkthroughs. Product updates Release notes See what changed and review relevant update details. Community Community forum Ask questions and discuss what you are building. Bring your question A specific workload deserves a specific answer. Share the data you work with, the question you need to answer and the tools you use. We can help you find the relevant interface and documentation. Talk to our team Visit the community Build with OriginChainDB Ready to try it with your data? Open documentation Browse resources --- ## Security & compliance | OriginChainDB Canonical source: https://originchaindb.com/security Security Security you can review. Controls you can verify. Understand how your applications connect, how access is scoped, and what protects your chosen deployment. Give your team a clear path from security review to production. Request security information Explore the controls Designed for review Know the boundary. Review the controls for your deployment. 01Identity & access 02Deployment isolation 03Evidence & policies A clear view of the controls around your data. Security & compliance Security programs. Current status. ISO 27001 certification and SOC 2 Type II attestation are in progress. Neither assessment has been completed. In progress ISO/IEC 27001 Working toward certification of our information security management system. In progress SOC 2 Type II Working toward an independent assessment of controls over a defined period. Contact us for progress updates and the planned assessment scope. Request security information Compliance roadmap Planned compliance work. Planned programs for privacy, healthcare and payment-data workloads. Follow what’s coming next. Coming soon Data privacy GDPR readiness Supporting European data protection requirements, processing agreements and data-subject requests. Coming soon Healthcare HIPAA readiness Preparing safeguards and business associate agreements for workloads that handle protected health information. Coming soon Payment data PCI DSS readiness Preparing the controls and assessment scope for environments that handle payment-card data. Coming soon Privacy management ISO/IEC 27701 Building a privacy information management program with defined responsibilities and review processes. These programs are planned, not current compliance claims. Scope and availability will be shared as each is ready. Discuss your requirements Identity & access Make access intentional. Connect with the right credential, apply the appropriate controls, and keep changes visible to your team. 01 Credentials with a purpose Use separate instance tokens for your applications. Keep organization management keys and database-user identities distinct, and replace or revoke credentials as your team changes. Credential lifecycle 02 Access close to the data Apply table grants, row policies and column masking on supported database-user read paths. Verify both allowed and denied operations using the identity your application actually sends. Authentication & access 03 A record of permission changes Inspect the engine’s hash-linked authorization history for user, role, grant and policy changes. Use the available verification and export controls in the connected console. Review access history Application to database Keep the identity clear at every step. 01 Your application Authenticate users and enforce your application’s access rules. 02 Your server Keep secrets server-side and pass the intended database identity. 03 OriginChainDB Authenticate the request and apply the configured, supported query controls. Console membership and database-user permissions are separate. An administrative bearer does not demonstrate the access of a restricted database user. Infrastructure & recovery Choose the boundary your workload needs. Shared hosting and dedicated resources have different isolation and recovery properties. Match the configuration to your requirements. Shared configurations Separate database access. Free and shared configurations use shared infrastructure. Each database has its own hostname and bearer credential. Public database endpoints use HTTPS. Database credentials are scoped to the instance and tenant. Shared resources do not provide dedicated compute isolation. Compare configurations Dedicated configurations Compute for one customer. Dedicated virtual machines and database storage serve one customer, with region and recovery choices reviewed for the deployment. Encrypted nightly snapshots are included. Optional standby replication is asynchronous. Confirm recovery, retention and network requirements before launch. Explore enterprise options Private connectivity and recovery capabilities depend on your configuration. Review the applied network settings and documented recovery limitations. Read the architecture For your security review The right information. The right conversation. Share your questionnaire, deployment requirements and evidence needs. We’ll help your team review the controls and documents relevant to your application. Talk to our team Useful details to bring Your intended region and configuration Access, network and retention requirements Required assessment documents and review timeline Privacy policy How customer information is collected and used. Data processing agreement Processing responsibilities and contractual terms. Terms of service The terms that govern your use of OriginChainDB. Service levels Review the commitments that apply to your configuration. Responsible disclosure Found a security issue? Let’s address it. Send a minimal reproduction, the affected version and your assessment of the impact. Leave credentials and customer data out of the report. security@originchaindb.com Need to share sensitive details? Request a PGP key by email before sending an encrypted disclosure. Keep the report focused. Include the relevant endpoint, instance details, timestamps and request IDs where available. Never include tokens or private keys. Choose how you’re credited. Reporters are credited in release notes unless they prefer to remain anonymous. Build with OriginChainDB Bring your security requirements. Request security information Explore the controls --- ## Service levels | OriginChainDB Canonical source: https://originchaindb.com/sla Service levels Service levels Availability targets, backups and support for your configuration. Contact us Read the Terms On this page + Availability This page is a summary. The Terms of Service govern. Monthly uptime targets and remedies by configuration Configuration Topology Monthly uptime Remedy Single-zone One dedicated instance in one zone best-effort — HA Two zones · writer + cross-zone standby · automatic failover 99.9% pro-rata service credit against the next invoice HA+ Multi-zone · writer + two standbys · higher-capacity configuration 99.95% pro-rata service credit against the next invoice Enterprise As HA+, under an annual agreement with negotiated quotas 99.99% pro-rata service credit against the next invoice Uptime is measured per instance per calendar month. Scheduled maintenance, force-majeure events and outages caused by your own configuration are excluded from the calculation, as defined in the Terms. Credits are the sole remedy for availability shortfalls. Backups and recovery Backups Encrypted nightly snapshots are included, integrity-checked daily and kept in the instance’s region. Point-in-time recovery Opt-in. Restore lands on a 5 s roll-up boundary; 500 ms with the Intra-Segment PITR add-on. Retention window 7 or 30 days self-serve, up to 35 days. Longer windows are agreed per deployment on Enterprise. Restore path From the console or the HTTP API. Support Email support@originchaindb.com for support. Enterprise agreements include a named support engineer. Response-time commitments are written into the agreement. Custom service terms Custom availability, retention and support terms are agreed on Enterprise contracts. Contact us Read the Terms Build with OriginChainDB Put your data to work. Contact us Read the Terms --- ## Solutions: build with a multimodal database | OriginChainDB Canonical source: https://originchaindb.com/solutions Solutions More from your data. More for your users. Build better search, useful recommendations and a clearer view of your operations. Bring records, meaning and relationships into the workflows your application needs. Find your use case Explore the database Application patterns Build search, recommendations and operational tools around your data. Illustrative application Explore the possibilities Start with what you want to make possible. Six practical starting points. Each one connects a user need with the data and queries behind it. 01 Find & assist Put useful context within reach. Search & RAG Give your application relevant passages, exact matches and the source records behind them. Build answers people can trace back to the original information. VectorFull-textSQL AI agents Keep run state, useful memories and tool outcomes in one database. Retrieve the context your agent needs and inspect the records behind its work. SQLVectorGraphFull-text 02 Discover & adapt Make the next interaction more relevant. Recommendations Combine similar items, related records and current business facts. Give your application the candidates it needs to recommend something relevant and available. VectorGraphSQL Personalization Connect expressed preferences, session context and searchable content. Build an experience around what someone needs, with eligibility and ranking controlled by your application. SQLVectorFull-text 03 Understand & act Give your team evidence to work with. Fraud investigation Query transactions and trace related accounts, devices and beneficiaries. Give investigators a clearer view of the records behind a signal. GraphSQL Operational analytics Filter, group and inspect the records your application already writes. Turn activity into focused summaries your team can use to understand the work. SQL One data layer. Your application. Choose the models. Own the experience. Use structured queries, similarity, exact terms and declared relationships where they help. Connect the results through record IDs and shape them into the experience you want to deliver. Look inside the architecture OriginChainDB Store and retrieve the context. Keep records, embeddings, search indexes and relationships in the same database. Use the query interfaces appropriate to each part of your workflow. Your application Make the result useful. Coordinate writes and queries, combine candidates, apply business rules and decide what to show or do next. Model calls and application ranking remain in your control. Shared record IDs keep the source within reach. Make it your own Start with one workflow. Learn from real data. Choose a question your users already ask. A focused first version makes it easier to judge the result and understand what to build next. Follow the quickstart Discuss your application Define a useful outcome. Describe what a good answer, suggestion or operational view should contain. Keep a small set of examples to evaluate it against. Connect the relevant data. Choose the records, indexes and relationships the workflow needs. Retain stable identifiers so every retrieved result can lead back to its source. Evaluate the whole experience. Check relevance, permissions, freshness and query behavior using representative data. Include the application’s ranking, fallback and refresh decisions. Build with OriginChainDB Choose the outcome. Start building. Find your use case Explore the database --- ## AI agents with OriginChainDB Canonical source: https://originchaindb.com/solutions/agents AI agents Give the next step something to remember. Keep run state, useful memories and tool outcomes in one database. Retrieve the context your agent needs and inspect the records behind its work. Start free Build agent memory Context across steps Keep task history and source records within reach of your agent. Illustrative application What you can build Make the next turn better informed. 01 Pick up the work. Store checkpoints, current status and run identifiers so the runtime can load the state it needs for its next step. 02 Recall useful context. Retrieve related memories by meaning, or find a specific observation by its words and structured fields. 03 Inspect what happened. Connect observations and tool events to their originating run and source records using stable identifiers. The application workflow Recall. Act. Record. Your runtime controls the agent loop. The database holds the state and evidence the runtime reads and writes along the way. Suggested record structure An application-owned memory memory_id agent_id session_id observation source_id Your schema, built around your application. Load the current context Read run state and retrieve relevant memories. Resolve the returned IDs to source records before preparing the next prompt. Let the runtime choose the action The application calls models and tools, checks permissions and obtains approval where the workflow requires it. Save the outcome Write tool events, new observations and the updated run state. Track separate vector or text-index writes before treating a memory as ready for retrieval. How it fits together The data in one place. The workflow in your hands. Explore the architecture OriginChainDB Store and retrieve. Stores runs, memories, events and declared relationships. Provides structured lookup, similarity and keyword retrieval for the context your runtime needs. Your application Coordinate and decide. Chooses tools, calls models, manages retries and decides when to act. Carries agent and session scope into every request. ASK can serve as a scoped query tool that returns database rows and an executed plan. It does not orchestrate an agent or approve external actions. Build for real use Start with a workflow. Check the whole result. Build the memory schema A concrete example of state, memories and writes. Give the agent a query tool Table scope, returned rows and Ask AI plans. Connect through MCP Use the documented MCP integration. How will repeated tool calls be handled? Use stable run, memory and tool-call IDs. Make retries explicit so retrying storage work does not repeat an external action. What happens when a memory expires? Coordinate removal of the source row and application-managed vector or text entries. Define which representations exist and track each removal. Can one session retrieve another's context? Apply database access controls and validate agent/session scope in the service. Retrieval metadata filters help narrow results but do not replace authorization. Build with OriginChainDB Build on context you can inspect. Start free Build agent memory --- ## Fraud investigation with OriginChainDB Canonical source: https://originchaindb.com/solutions/fraud-detection Fraud investigation Follow the connection. Inspect the evidence. Query transactions and trace related accounts, devices and beneficiaries. Give investigators a clearer view of the records behind a signal. Start free Build your first traversal Evidence for review Find shared connections. Give an investigator the records to review. Illustrative application What you can build Give the investigation more context. 01 Choose where to look. Group transaction activity and apply your review criteria to identify accounts that need closer inspection. 02 Find the shared reference. Follow declared relationships between accounts, devices and beneficiaries to explore connected activity. 03 Keep the evidence attached. Retain record IDs, timestamps and query context so an analyst can examine the reason a connection was surfaced. The application workflow From a signal to a reviewable case. A shared identifier is a starting point. Query the context and inspect its source before deciding what it means. Suggested record structure Facts an analyst can trace account_id device_id transfer_id beneficiary_id timestamp Your schema, built around your application. Select a candidate Use SQL to examine transaction counts and amounts within a chosen window. Your application defines the thresholds for review. Expand the context Follow declared graph relations with bounded depth and result limits. Keep the source record behind each link. Assemble the case Present the evidence, timing and query parameters to an analyst. Route review and escalation through your case-management workflow. How it fits together The data in one place. The workflow in your hands. Explore the architecture OriginChainDB Store and retrieve. Retrieves transaction records, aggregates and declared connections. Helps identify neighbors and bounded paths worth investigating. Your application Coordinate and decide. Defines review rules, assembles cases and routes decisions. Analysts or application policies determine whether further action is appropriate. A shared device or beneficiary does not establish fraud. Check timing, identity and source quality. Graph capability must be enabled, and traversal needs to stay within its documented query limits. Build for real use Start with a workflow. Check the whole result. Explore graph queries Neighbors, paths and declared relationships. Group transaction records Structured selection and aggregation with SQL. Review traversal limits Plan the depth and scope of an investigation. Could the connection have an ordinary explanation? Review shared households, expected merchants and other legitimate relationships. A graph pattern describes recorded facts, not intent. Is the investigation bounded? Start with a narrow candidate set and explicit depth and result limits. Handle query-budget failures before expanding the search. Can the case be reviewed later? Save the identifiers, parameters, timestamps and supporting records that were used. Keep review outcomes in your application-owned case data. Build with OriginChainDB Build an investigation you can explain. Start free Build your first traversal --- ## Personalization with OriginChainDB Canonical source: https://originchaindb.com/solutions/personalization Personalization Start with their choice. Make the content relevant. Connect expressed preferences, session context and searchable content. Build an experience around what someone needs, with eligibility and ranking controlled by your application. Start free Start the integration User-led preferences Use the topics and formats someone chooses to find relevant content. Illustrative application What you can build Give context a useful role. 01 Respect explicit preferences. Store selected topics, language and experience level as clear fields that people can change. 02 Find relevant content. Retrieve by meaning or words, then resolve candidates to the records your application needs to evaluate. 03 Make the selection explainable. Keep the preference, eligibility rules and ordering recipe behind each experience available for review. The application workflow Context first. Eligibility always. The same content can support different experiences. Make the visitor's choice and the application's rules explicit. Suggested record structure A focused session profile session_id selected_topics language profile_version personalization_enabled Your schema, built around your application. Read the chosen context Load the expressed interests and settings that are relevant to this session. Respect whether personalization is enabled. Retrieve eligible candidates Find related content and load its current rows. Apply access controls, publication state, language and audience requirements. Assemble the experience Order candidates using your application recipe. Offer a useful curated selection when context is missing or disabled. How it fits together The data in one place. The workflow in your hands. Explore the architecture OriginChainDB Store and retrieve. Stores preferences and content records. Retrieves candidate IDs by structured fields, semantic similarity and exact terms. Your application Coordinate and decide. Handles consent, session policy, eligibility and ranking. Decides how interactions influence future experiences and when a fallback is appropriate. Retrieval filters do not replace authorization. If your design embeds preferences, coordinate profile changes with separate embedding updates and track the version used for each result. Build for real use Start with a workflow. Check the whole result. Model preferences and content Define structured fields for your application. Review access controls Credentials, scope and supported read policies. Build recommendations Add related items and business eligibility rules. Can the visitor change the starting point? Keep explicit choices distinct from inferred interests. Give the application a clear path to update, disable or reset its personalization context. Does the experience work without a profile? Keep an eligible curated fallback for new sessions, disabled personalization or a representation awaiting refresh. Which context produced this result? Record the profile version and ranking recipe needed to explain a selection. Measure relevance and coverage without retaining unrelated session data. Build with OriginChainDB Make the experience fit the context. Start free Start the integration --- ## Build document search & RAG with source references | OriginChainDB Canonical source: https://originchaindb.com/solutions/rag Search & RAG Find the right passage. Show where it came from. Build search for your docs, policies or knowledge base. Use keywords and meaning to find useful passages, then give your application the sources behind each result. Try the retrieval example Plan a search pilot Search & RAG Find relevant passages. Give your application the sources for its answer. Illustrative application Three parts of a useful search Words. Meaning. The original source. RAG gives a language model retrieved information before it writes an answer. Start by getting that information right. Full-text Find the words that matter. Match a product name, an error code or a phrase in your documents. Explore Full-text Vector Find the meaning behind them. Retrieve related passages when a question uses different wording. Explore Vector SQL Keep the source close. Store passage text, document versions and references alongside your application records. Explore SQL Follow one question How do I get access to a project? The workspace guide gives the context. The access guide gives the steps. In this example, the result found in both lists ranks first when your app combines them. Illustrative results. No database or AI request runs in this preview. Run this example locally Keyword results Workspace guide Project access Meaning results Project access Contractor access ↓ Your app combines the rankings First combined result · Access guide, page 2 Project access Ask the project owner to approve access. After approval, an administrator adds you to the project. project-accessSource ID stays attached An explicit workflow The database retrieves. Your app builds the answer. Keyword and vector searches are separate requests. Your app combines their results and decides which passages a person may see. See the retrieval steps Prepare your passages Save the text and source reference. Add text-index entries and compatible embeddings using the same passage IDs. Retrieve and check access Combine ranked IDs, remove duplicates and load permitted source rows. Keep updates and deletions in sync across the stored representations. Answer with evidence Pass useful context to your chosen model. Keep citations visible, and say when the sources cannot answer the question. Start with one collection Try it. Measure it. Then choose your next step. Use real questions and known source passages to compare keyword, vector and combined retrieval. Run a small example A single JavaScript file shows ranking and source lookup. Start offline, then connect a prepared database collection. Open the example Evaluate your own documents Agree on useful results, access checks, response time and cost before expanding the workload. Plan a guided pilot Build with OriginChainDB Test search with the questions your users ask. Try the retrieval example Plan a search pilot --- ## Operational analytics with OriginChainDB Canonical source: https://originchaindb.com/solutions/real-time-analytics Operational analytics Your operational data. A more useful view. Filter, group and inspect the records your application already writes. Turn activity into focused summaries your team can use to understand the work. Start free Run an operational query Operational summaries Group your records to see what is waiting, in progress or complete. Illustrative application What you can build Answer the questions behind the dashboard. 01 See what is waiting. Filter open work and group it by status, team or queue to understand where attention is needed. 02 Understand the totals. Define the rows and conditions that belong in each metric before calculating counts, sums or grouped results. 03 Inspect the underlying records. Move from an aggregate to the rows behind it, keeping the dashboard connected to the operational question. The application workflow Define. Query. Refresh. A useful dashboard starts with the meaning of its metrics and ends with an honest indication of how current they are. Suggested record structure Operational events event_id status team amount created_at Your schema, built around your application. Define the metric Choose the relevant rows, time window and grouping key. Separate pending work from completed work before counting or summing. Inspect and run the query Use EXPLAIN to review the plan, then run a focused aggregation. Check schema indexes and predicates for frequently refreshed queries. Present the latest result Render the returned rows and show the last successful refresh. Handle failures and cached results deliberately in your application. How it fits together The data in one place. The workflow in your hands. Explore the architecture OriginChainDB Store and retrieve. Filters records, joins supported data and computes aggregates. Returns rows and query plans for your application to inspect. Your application Coordinate and decide. Defines metric semantics, refresh intervals, caching and alerts. Renders results and makes stale or failed refreshes visible. This pattern uses application-driven refreshes, not an implied push-update guarantee. Evaluate large historical scans separately; sorts, joins and windows can buffer inputs even when the query includes LIMIT. Build for real use Start with a workflow. Check the whole result. Build grouped queries Filters, grouping and aggregate results. Inspect a query plan Review operators before running the workload. Explore Vezual Create views from selected database tables. Does the number mean what its label says? For example, paid value should include only paid records. Verify the chosen statuses, grouping keys and time boundaries against known cases. How current is the displayed result? Choose a refresh policy and show when the last query succeeded. Account for the deployment's transaction and replica behavior. Can the workload stay within its budget? Inspect plans and narrow inputs before expensive operations. Evaluate query limits, refresh frequency and retry behavior with representative data. Build with OriginChainDB Start with the question your team asks daily. Start free Run an operational query --- ## Recommendations with OriginChainDB Canonical source: https://originchaindb.com/solutions/recommendations Recommendations Find a good match. Make it a useful choice. Combine similar items, related records and current business facts. Give your application the candidates it needs to recommend something relevant and available. Start free Retrieve your first candidates Relevant suggestions Find related choices and check which ones are available to recommend. Illustrative application What you can build Build a more considered shortlist. 01 Discover similar choices. Use embeddings to retrieve items with related meaning or characteristics, beyond an exact category match. 02 Include what belongs together. Follow declared relationships to retrieve compatible, complementary or otherwise connected items. 03 Check what can be offered. Load current records and apply availability, market and budget rules before showing a recommendation. The application workflow Discover. Qualify. Order. Each signal contributes candidates. Your application turns those candidates into a shortlist with a reason for every choice. Suggested record structure An item with business context item_id description availability category related_item_id Your schema, built around your application. Find candidate IDs Query vector similarity for related items and graph relations for connected choices. Keep the source of each candidate. Check the current facts Fetch the candidate rows, deduplicate IDs and apply your eligibility rules. Remove unavailable items before ranking. Choose the ordering Combine relevance, relationships and merchandising priorities in your application. Recheck availability at the point of action. How it fits together The data in one place. The workflow in your hands. Explore the architecture OriginChainDB Store and retrieve. Holds item records, embeddings and declared relationships. Retrieves matching IDs and the current fields needed to check candidates. Your application Coordinate and decide. Coordinates queries, applies business rules and ranks eligible items. Owns the recommendation recipe and the final availability check. These are coordinated requests, not a single cross-model query or a shared-snapshot guarantee. Vector metadata-filter support varies by index; check the selected index contract. Build for real use Start with a workflow. Check the whole result. Configure similarity search Embedding dimensions, distance and retrieval. Model item relationships Declare links using record references. Evaluate the workload Published benchmark conditions and methodology. Are enough eligible results returned? Measure the shortlist after availability and business rules have been applied. Keep a curated fallback when too few candidates remain. What changes when an item is updated? Refresh the affected embedding and any application-managed search entries when source content changes. Track partial progress and retry failed stages. How will you compare recommendation recipes? Use a representative set of starting items. Review result relevance, coverage and latency across the entire application flow. Build with OriginChainDB Make the next suggestion useful. Start free Retrieve your first candidates --- ## Website response checks | OriginChainDB Canonical source: https://originchaindb.com/status Website status Check this website. See the latest response. Check the website from your browser and view its build information. This page does not monitor database instances. View website checks Database operations guide A browser checks this website From this browser Website responses. Not database uptime. These checks run from your browser. Use instance monitoring to investigate a database issue. Waiting for the first website check Successful checks in this tab—Up to the last 10 checks. Not an uptime percentage. Average response time—For successful checks from this browser connection. Last checked—Checks every 30 seconds while this page is visible. Recent checks · oldest to newest This requests the website’s /_build.json file. A missing response can mean a network issue or missing metadata; it does not establish that a database instance is unavailable. Enable JavaScript to run a website check. You can still read the scope of these checks and the operational documentation below. Published build metadata Published build information. These details come from the website’s published metadata. A local preview may show the captured build instead of current local changes. Build information has not been loaded. Build ID— Git revision— Branch— Pages in published metadata— Published history Deployment history. Published website deployments appear here when a history is available. Loading published deployment history… Build with OriginChainDB Keep website checks in context. View website checks Database operations guide --- ## Terms of service - OriginChain managed cloud Canonical source: https://originchaindb.com/terms terms Terms of service The rules for using OriginChainDB, including service levels, your data and your responsibilities. Scope of these terms These terms cover two things: the marketing website at originchain.ai, and the managed cloud service ("the Service") operated by Silicoyn Technologies Pvt Ltd, an Indian private limited company with its registered office in Bengaluru, Karnataka. Different clauses apply to each - they are called out where they diverge. Silicoyn Technologies Pvt Ltd is the operating company behind the OriginChain product brand. References below to "we", "us", and "our" mean Silicoyn Technologies Pvt Ltd. Eligibility To enter into these terms you must be at least 18 years old, have legal capacity to contract under the Indian Contract Act 1872, and not be barred from receiving services under the laws of India. If you sign up on behalf of an organization, you represent that you have authority to bind that organization, and "you" then means both you and the organization. The managed cloud service OriginChain Cloud is a subscription service. By signing up you authorize us to provision resources in the region you pick and to bill you monthly at the list price of the configuration you choose. Upgrades take effect immediately; downgrades take effect at the next billing cycle. A valid payment method is captured at instance creation and billing begins from day 1 on the configuration you select. You may cancel at any time by deleting the configuration in the console. Deleting it stops the service and deletes the database straight away; this cannot be undone. Its stored data is erased within 7 days and its backups within 30 days. See our Cancellation & Refund Policy. Your card stays on file as long as you have one or more provisioned instances. To remove the card you must first delete every instance and let the 30-day data retention window expire. This is a deliberate constraint of the subscription model: an active subscription requires a card on file to retry failed charges and to remit overage usage. Payments are processed by Razorpay Software Pvt Ltd (an RBI-licensed payment aggregator) under their own terms. We never receive your card number, CVV, or expiry - only a tokenised reference. You are responsible for how you use the Service - the rows you put in, the questions you ask, the people you give the bearer token to. Do not use it to store unlawful content or to attack third parties. We reserve the right to suspend accounts for flagrant abuse, fraud, or activity that violates Indian law. Either party may terminate the subscription at any time. On termination, every row and backup of your database is deleted within 30 days. Billing records are kept for the period required by Indian tax law (currently 7 years under the Income Tax Act 1961). Acceptable use You will not use the Service to: (a) store, transmit, or process content that is unlawful under Indian law (Information Technology Act 2000 Sections 67, 67A, 67B and the IT Rules 2021); (b) infringe any intellectual-property right; (c) impersonate another person; (d) probe, scan, or test the vulnerability of any system without our prior written consent; (e) attempt to bypass any rate limit, quota, or isolation boundary; or (f) use automated means to scrape data not belonging to you. You agree to promptly remove any content that we, in good faith, identify as violating this section after notifying you. This is consistent with our role as an intermediary under the IT Rules 2021. Service levels The Service targets best-effort uptime on Single-zone, 99.9% monthly uptime on HA, 99.95% on HA+, and 99.99% on Enterprise. If we miss the target on a paid configuration, you receive a pro-rata service credit against your next invoice per the SLA published at /docs#sla. Credits are the sole and exclusive remedy for availability shortfalls. Scheduled maintenance, force-majeure events, and outages caused by your own configuration or by your own account-level state (billing holds, access mis-configurations) are excluded from the SLA calculation. Your data You own every byte you put into an OriginChain instance. We do not claim any license over it. We process it solely to provide the Service to you, in the region you picked, under the Data Processing Addendum at /dpa. We will not sell, share, or train models on your data. Period. Personal data is processed in accordance with the Digital Personal Data Protection Act 2023 ("DPDP Act") and our Privacy Notice at /privacy. You retain all rights of a Data Principal under that statute and may exercise them by writing to Silicoyn Technologies Pvt Ltd at the contact in the Privacy Notice. No warranty (beyond the SLA) Except for the SLA above, the Service is provided "as is," without warranty of any kind, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, and non-infringement. To the extent the Consumer Protection Act 2019 applies, nothing in this clause limits a statutory right that cannot be excluded by contract. You are responsible for evaluating whether OriginChain fits your workload and for benchmarking it on your data. We will help you do that - but the decision and the outcome are yours. This website The content of originchain.ai is provided for informational purposes. Benchmarks, latency figures, and architecture claims describe our reference deployment; your results will depend on your hardware, data, and workload. We reserve the right to update any page on this site without notice. Material changes will be reflected in our changelog. The name and mark "OriginChain" and the OriginChain wordmark are trademarks of Silicoyn Technologies Pvt Ltd. You may use them to describe or refer to the Service ("running on OriginChain", "built on OriginChain"). You may not use them to imply endorsement of a competing hosted service or a derivative product without our written permission. Other names used on this site belong to their owners. Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries. PostgreSQL is a trademark of the PostgreSQL Community Association of Canada. MySQL is a registered trademark of Oracle Corporation and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Microsoft and SQL Server are registered trademarks of Microsoft Corporation in the United States and/or other countries. Apache Lucene is a trademark of the Apache Software Foundation. We refer to them only to describe compatibility with those interfaces, which our software implements independently. We are not affiliated with, endorsed by, or sponsored by any of them, and we do not distribute their software. Limitation of liability To the maximum extent permitted by law, Silicoyn Technologies Pvt Ltd will not be liable for any indirect, incidental, special, consequential, or punitive damages arising out of your use of the Service or this website - even if advised of the possibility of such damages. For direct damages arising out of the Service, our aggregate liability is capped at the fees you paid to us in the twelve months preceding the claim. Nothing in this clause limits liability for fraud, gross negligence, or any other liability that cannot be excluded under Indian law. Indemnity You agree to indemnify and hold us harmless against third-party claims arising from your content stored on or processed by the Service, your breach of the Acceptable Use clause, or your violation of any law applicable to your use of the Service. Grievance officer In compliance with the Information Technology (Intermediary Guidelines and Digital Media Ethics Code) Rules 2021 and Section 7 of the DPDP Act 2023, the Grievance Officer / Data Protection Officer for Silicoyn Technologies Pvt Ltd is reachable at grievance@originchaindb.com. Complaints are acknowledged within 24 hours and resolved within 15 days. Governing law and jurisdiction These terms are governed by the laws of India. The parties submit to the exclusive jurisdiction of the courts at Bengaluru, Karnataka, India for any dispute arising out of or in connection with these terms. Notwithstanding the above, either party may seek interim or injunctive relief in any court of competent jurisdiction to protect its intellectual property or confidential information. Changes to these terms We may update these terms from time to time. Material changes - anything that meaningfully reduces your rights or increases your obligations - will be announced at least 30 days in advance via email to the address on file and via our changelog at /changelog. Non-material changes (clarifications, typo fixes, references to new sub-pages) take effect on posting. Continued use of the Service after a change constitutes acceptance of the updated terms. Need something clarified? Volume contracts, data residency, a BAA, an unusual deployment scenario - we'll give you a straight answer, not a lawyer one. support@originchaindb.com→ --- ## Published test reports | OriginChainDB Canonical source: https://originchaindb.com/tests Test reports Published test reports. Inspect the results. Browse recorded test runs and raw results. Check the setup before comparing the numbers. View the reports Read the methodology Read the report behind a number Published measurements Available test reports. A dash means a measurement was not recorded. It does not mean zero. Loading the published report directory… Latest published report Tests recorded— Failures recorded— Recorded p99 latency— Results apply to this test run and its recorded setup. Comparison recorded in the latest report Check the hardware, setup and test method in the raw report. Reported comparisonOther p99OriginChainDB p99Throughput as reported Enable JavaScript to load the report directory. You can read the benchmark methodology below without it. Before using a result How to read a test result. Reports contain measurements. The benchmark guide explains the test setup and comparison method. Read the benchmark methodology 01 Check the setup Check hardware, software, data size, indexes and the number of simultaneous requests. 02 Check failures too Read failures alongside speed. A missing measurement does not mean a test passed. 03 Try your own data Repeat the test with the data and queries your application needs. Plan your evaluation Build with OriginChainDB Review the results and test method. View the reports Read the methodology --- ## Trust center & security documents | OriginChainDB Canonical source: https://originchaindb.com/trust Trust center Security documents. Ready for your review. Find our security status, policies and processing terms. Request the evidence your team needs. Request security information Browse the documents Documents for a security review Security programs Our current security status. Both programs are in progress. Completed certification and attestation are not yet available. In progress ISO 27001 We are working toward certification of our information security management system. Ask about progress In progress SOC 2 Type II We are working toward an independent assessment of controls over a defined period. Ask about progress Coming soon: GDPR readiness, HIPAA readiness, PCI DSS readiness and ISO/IEC 27701. These are planned, not completed. View the security roadmap Evidence and terms Policies and agreements. Read the terms that apply to your data and chosen plan. Read the service levels Security & compliance Current controls, certification status and the compliance roadmap. Data processing agreement How customer data is processed under the agreement. Privacy policy How information is collected, used and handled. Terms & service levels The terms for your account and chosen configuration. Check your implementation Check your application setup. Test permissions and recovery with the identities and settings your app uses. Identity and access Test access Check who can read or change data. Verify both allowed and denied actions. Access controls Recovery Test recovery Check available backups, restore a copy and verify its data. Storage and recovery Website checks Check the website Website checks show browser responses, not database uptime. Website status Responsible disclosure Report a security issue. Describe the issue and how to reproduce it. Leave passwords, keys and customer records out of the message. security@originchaindb.com Disclosure guidance Build with OriginChainDB Talk through your security requirements. Request security information Browse the documents --- ## Tutorials | Learn the OriginChainDB console Canonical source: https://originchaindb.com/tutorials Tutorials Learn OriginChainDB. Watch a tutorial, try the steps and check your result. Browse tutorials ↓Choose a guided task → Learn in the console. SQL, search and graph walkthroughs. Watch on YouTubeVideo library Select a tutorial below to watch here. This video cannot play here. Use its “Watch on YouTube” link below. Watch. Try. Check. Pick a task. Each task links to a video, a practice guide and a result to check. New to OriginChainDB? Set up your console account first. The practice guides use a Bash-compatible terminal and cURL. Use a fresh practice table or index, and keep your credentials and database permissions private. 01Start with SQL Run your first SQL query. Create a table, add a record and filter the result. Watch and try the steps+ WatchWatch schema creation and verification ↗ on YouTube TryCreate your first table and query → Check Find product-001, Trail mug, at 1,990 cents in the result for products priced below 2,000 cents. Connect the result to your app → 02Choose a search contract Search for words. Index text and compare boolean, phrase and BM25 search. Watch and try the steps+ WatchWatch boolean, phrase and BM25 search ↗ on YouTube TryIndex text and run the search examples → Check In the guide's phrase example, check that carbon plate matches sku-9281. Keep the table and field names identical when indexing and searching. Inspect the Elasticsearch-compatible API → 03Follow a relationship Follow connected records. Add a relationship. Check its direction and number of hops. Watch and try the steps+ WatchWatch graph direction and depth ↗ on YouTube TryRun your first graph traversal → Check Starting at u1, check that u2 is one hop away and u3 is two hops away. Compare the returned IDs with the relation you declared. Explore graph query examples → The documentation examples use different datasets from the videos. Follow each guide's setup and prerequisites together. Need help with a result? Use the troubleshooting reference. The tutorial library Video tutorials Pick a topic. Find a guide. Follow along at your own pace. Browse topics TopicAll tutorials (6)Getting started (2)Data explorer (1)Schema design (0)Workbench (1)SQL (0)Vector search (0)Full-text search (0)Graph (0)Migration (1)Access control (1)Operations (0)More tutorials (0) Search tutorialsSort tutorialsLatest uploadsTitle: A–Z Showing 1–6 of 6 tutorials This is a saved selection. Visit our YouTube channel for every tutorial, or enable JavaScript to search and browse the latest uploads. Data explorer OriginChainDB Data Explorer Tutorial | Browse, Inspect & Query Data Watch on YouTube ↗ (opens in a new tab) Getting started Launch an OriginChainDB Instance | Configuration & Connection Guide Watch on YouTube ↗ (opens in a new tab) Access control Plan RBAC Roles & Row Policies in OriginChainDB | Access Control Guide Watch on YouTube ↗ (opens in a new tab) Migration How to Migrate Data in OriginChainDB | Source, Mapping & Verification Watch on YouTube ↗ (opens in a new tab) Workbench OriginChainDB Workbench Tutorial | SQL, Vector, Full-Text & Graph Watch on YouTube ↗ (opens in a new tab) Getting started Introducing the New OriginChainDB Console | SQL, Vector, Full-Text & Graph Watch on YouTube ↗ (opens in a new tab) No tutorials found Try a different search or choose another topic. Checking for new uploads… Keep learning on YouTube. Explore the channel or follow the Console playlist. YouTube channel ↗ (opens in a new tab)Console playlist ↗ (opens in a new tab) Console preview walkthroughs use sample data. Follow the documentation for live setup and verification. --- ## OriginChainDB vs Aerospike | Compare the basics Canonical source: https://originchaindb.com/vs/aerospike OriginChainDB vs Aerospike Aerospike or OriginChainDB? Aerospike offers a distributed record store and a graph service. OriginChainDB offers SQL, vector, graph and full-text queries. Compare how each fits your app. Compare the basics Talk to our team A task to try Find accounts linked to the same device. Start here Which fits your app? Our view: choose based on what your app needs to do. Consider Aerospike when Your app relies on Aerospike clients, record lookups or Gremlin graph queries. Read the docs Consider OriginChainDB when You need SQL, search and relationships in one database, using separate calls. Explore the database Side by side Compare the basics. Features from the linked docs. Test speed and cost with your own data. Scroll sideways to compare both databases. Aerospike and OriginChainDB capabilities What to compareAerospikeOriginChainDB Stored data Records have unique keys and named fields, grouped into sets and namespaces. Source: Aerospike database architecture Store structured records and use their IDs to link search results and relationships. Relationships Aerospike Graph uses Gremlin queries over data stored in Aerospike Database. Source: Aerospike Graph architecture Follow relationships through the graph API. SQL and search use separate calls. Connecting your app Aerospike clients find the cluster nodes that hold each record. Source: Aerospike database architecture Use HTTP APIs, SDKs or supported PostgreSQL-compatible operations. i One database. Separate calls. OriginChainDB uses separate calls for SQL, vector, graph and full-text. Your app keeps the writes in step and links results by ID. A SQL transaction does not automatically cover the other calls. See a write example Try it with your data Find accounts that share a device. Try the same task in both systems. Use the same data and judge the full result. The question Which accounts used this device? 01 Find the event Load the account and event. Use the same data in both tests. 02 Follow the links Find the linked accounts. Include devices used by many accounts. 03 Show the evidence Return the related records and their IDs. Check who is allowed to see them. What to check Response time Measure the whole request, from lookup to final result. Data changes Add and remove links while the app is running. Recovery Test retries, maintenance and restoring data. Before you move data Plan your move. Copy the data. Then check your queries, access rules and updates before switching. Explore Migrate Check compatibility Map your data Match records, fields and expiry rules to the new schema. Preserve IDs. Update your queries Review Aerospike client code and Gremlin queries. The APIs are different. Try a small sample Compare records and links before switching. Keep a way to switch back. Common questions. Is Aerospike just a key-value database? No. Aerospike also supports document data and a graph service. Compare the services your app needs. Does OriginChainDB replace an Aerospike client directly? No. You will need to review your schema, queries and client code. OriginChainDB does not implement Aerospike or Gremlin protocols. Sources Check the details. Reviewed 4 November 2026 Aerospike Aerospike database architecture Aerospike Graph architecture OriginChainDB OriginChainDB: separate record, vector and text writes OriginChainDB: PostgreSQL compatibility OriginChainDB: transaction boundaries OriginChainDB: deployment and recovery Features vary by version and setup. Check the docs for the version you plan to use. Build with OriginChainDB Let's look at what your app needs. Compare the basics Talk to our team --- ## OriginChainDB vs Milvus | Compare the basics Canonical source: https://originchaindb.com/vs/milvus OriginChainDB vs Milvus Milvus or OriginChainDB? Milvus supports vector search, filters and full-text search. OriginChainDB also provides SQL and graph queries. Test the full job your app needs to do. Compare the basics Talk to our team A task to try Find similar images, then open the original file. Start here Which fits your app? Our view: choose based on what your app needs to do. Consider Milvus when Search is your main job, and you want to run Milvus locally, on a server or across a cluster. Read the docs Consider OriginChainDB when Your app needs SQL records and relationships as well as search, using separate calls. Explore the database Side by side Compare the basics. Features from the linked docs. Test speed and cost with your own data. Scroll sideways to compare both databases. Milvus and OriginChainDB capabilities What to compareMilvusOriginChainDB Search Supports vector similarity, field filters, multiple vector fields and BM25 text search. Source: Milvus overview and deployment options Search by meaning or words, then use IDs to find the source records. Other queries Fetch records by key or use filter expressions alongside vector search. Source: Milvus overview and deployment options Use SQL for records and the graph API for relationships. Combine results in your app. Where it runs Choose Lite in Python, Standalone on one machine or Distributed on Kubernetes. Source: Milvus overview and deployment options Choose a shared or dedicated setup and check its recovery options. i One database. Separate calls. OriginChainDB uses separate calls for SQL, vector, graph and full-text. Your app keeps the writes in step and links results by ID. A SQL transaction does not automatically cover the other calls. See a write example Try it with your data Find an image you can use. Try the same task in both systems. Use the same data and judge the full result. The question Which similar images are licensed for this campaign? 01 Use the same images Keep the same embeddings, image IDs and licence details in both tests. 02 Apply the filters Search only images the campaign can use. Include cases with very few allowed images. 03 Open the result Find the source file. Check that its licence is still valid and the file still exists. What to check Useful results Check the matches against a set your team has reviewed. Filtered results Check quality when most images are filtered out. Total cost Include embeddings, storage, indexing and record reads. Before you move data Plan your move. Copy the data. Then check your queries, access rules and updates before switching. Explore Migrate Check compatibility Keep vector settings Record the embedding model, dimensions and distance metric. A new model may require new embeddings. Map fields and IDs Decide where records, search fields and relationships belong. Preserve the IDs that connect them. Compare the results Replay real searches and updates. Check rankings and filters before switching. Common questions. Does Milvus support text search as well as vectors? Yes. Milvus documents BM25 full-text search and hybrid search across vector fields. Include these in your test. Is a vector benchmark enough? Only if vector search is the whole job. Otherwise, include record reads, permissions, relationships and operating costs. Sources Check the details. Reviewed 4 November 2026 Milvus Milvus overview and deployment options OriginChainDB OriginChainDB: separate record, vector and text writes OriginChainDB: PostgreSQL compatibility OriginChainDB: transaction boundaries OriginChainDB: deployment and recovery Features vary by version and setup. Check the docs for the version you plan to use. Build with OriginChainDB Let's look at what your app needs. Compare the basics Talk to our team --- ## OriginChainDB vs MongoDB | Compare the basics Canonical source: https://originchaindb.com/vs/mongodb OriginChainDB vs MongoDB MongoDB or OriginChainDB? MongoDB stores documents and supports vector and text search. OriginChainDB provides SQL records, graph relationships and separate search APIs. Compare the way your app stores and finds data. Compare the basics Talk to our team A task to try Find a passage and check the document it came from. Start here Which fits your app? Our view: choose based on what your app needs to do. Consider MongoDB when Your app already uses MongoDB documents, drivers and aggregation queries. Read the docs Consider OriginChainDB when You want SQL records and explicit relationships alongside search in one database. Explore the database Side by side Compare the basics. Features from the linked docs. Test speed and cost with your own data. Scroll sideways to compare both databases. MongoDB and OriginChainDB capabilities What to compareMongoDBOriginChainDB Stored data Store data as documents. Embed related data or link it with references. Source: MongoDB data modelling Store records and connect them to relationships and search entries by ID. Vector search Search embedding fields in documents using exact or approximate matches. Source: MongoDB Vector Search Write embeddings through the vector API and use IDs to fetch source records. How queries work Vector search runs through aggregation stages and uses a separate search index. Source: MongoDB Vector Search SQL, vector, graph and full-text use separate calls. Your app keeps their results connected. i One database. Separate calls. OriginChainDB uses separate calls for SQL, vector, graph and full-text. Your app keeps the writes in step and links results by ID. A SQL transaction does not automatically cover the other calls. See a write example Try it with your data Find the policy that applies now. Try the same task in both systems. Use the same data and judge the full result. The question Which current policy covers this request? 01 Load the policies Use the same text, dates and IDs. Include old versions in the test. 02 Find a passage Search by words and meaning. Apply the same rules for which policies can be used. 03 Check the source Return the original passage and policy version. Exclude old or restricted material. What to check Right answer Check the passage and policy version against real questions. Fresh results Update or delete a policy and check when search catches up. App effort Count the calls and code needed for a complete answer. Before you move data Plan your move. Copy the data. Then check your queries, access rules and updates before switching. Explore Migrate Check compatibility Map your documents Review nested fields, arrays, references and BSON types before copying data. Update the queries Translate the aggregation stages your app uses. Rebuild and test search indexes. Check the copy Migrate supports MongoDB copies. Check field mappings, row counts and sample records before switching. Common questions. Can MongoDB store documents and embeddings together? Yes. An embedding can be a document field. Vector Search uses a separate index, so also check when updates appear in search. Can I keep using the MongoDB driver? Do not assume so. Copying data does not reproduce MongoDB’s protocol or query API. Review the database calls in your app. Sources Check the details. Reviewed 4 November 2026 MongoDB MongoDB data modelling MongoDB Vector Search OriginChainDB OriginChainDB: separate record, vector and text writes OriginChainDB: PostgreSQL compatibility OriginChainDB: transaction boundaries OriginChainDB: deployment and recovery Features vary by version and setup. Check the docs for the version you plan to use. Build with OriginChainDB Let's look at what your app needs. Compare the basics Talk to our team --- ## OriginChainDB vs Neon | Compare the basics Canonical source: https://originchaindb.com/vs/neon OriginChainDB vs Neon Neon or OriginChainDB? Neon is built on PostgreSQL and offers isolated database branches. OriginChainDB is a different engine with SQL, vector, graph and full-text APIs. Check which database features your app depends on. Compare the basics Talk to our team A task to try Test a database change away from production. Start here Which fits your app? Our view: choose based on what your app needs to do. Consider Neon when You need PostgreSQL behaviour and separate database branches for development and testing. Read the docs Consider OriginChainDB when You want to try SQL, search and graph APIs together, and can check compatibility with your app. Explore the database Side by side Compare the basics. Features from the linked docs. Test speed and cost with your own data. Scroll sideways to compare both databases. Neon and OriginChainDB capabilities What to compareNeonOriginChainDB Database Built on serverless PostgreSQL, with vector, full-text and hybrid search features. Source: Neon platform documentation A different engine. Some PostgreSQL operations are supported; full compatibility is not implied. Testing changes Branches give you isolated data copies from a current or saved historical state. Source: Neon database branching Use a separate test dataset and check the queries and schema changes your app needs. Other services Also documents auth, file storage, functions and other services around the database branch. Source: Neon platform documentation Offers database tools including Migrate, Ask AI, Vezual and integrations. Check each service you need. i One database. Separate calls. OriginChainDB uses separate calls for SQL, vector, graph and full-text. Your app keeps the writes in step and links results by ID. A SQL transaction does not automatically cover the other calls. See a write example Try it with your data Test a change before you release it. Try the same task in both systems. Use the same data and judge the full result. The question Will the new schema and queries work with our app? 01 Prepare a test copy Include realistic records, constraints and the queries your app runs. 02 Run the change Apply the migration. Test your tools’ generated SQL and the new search feature. 03 Try recovery Test restoring data or undoing the change. Check that the app reconnects correctly. What to check Correct results Check query results, transactions and errors. Testing effort Measure the work to create and remove test environments. Total cost Include compute, stored history and any extra services. Before you move data Plan your move. Copy the data. Then check your queries, access rules and updates before switching. Explore Migrate Check compatibility List PostgreSQL features Check your extensions, types, functions, constraints and tool-generated queries against the compatibility guide. List other services Plan for auth, functions, storage and branching separately. A database copy does not move them. Rehearse the switch Check copied data and app results. Test the final sync and a way to switch back. Common questions. Is OriginChainDB another hosted PostgreSQL service? No. It is a different engine with support for some PostgreSQL operations. Check your SQL, extensions and tools before moving. Is database branching the same as a backup? No. Neon branches are isolated copies for separate work. Recovery from older data depends on the configured history window. Sources Check the details. Reviewed 4 November 2026 Neon Neon platform documentation Neon database branching OriginChainDB OriginChainDB: separate record, vector and text writes OriginChainDB: PostgreSQL compatibility OriginChainDB: transaction boundaries OriginChainDB: deployment and recovery Features vary by version and setup. Check the docs for the version you plan to use. Build with OriginChainDB Let's look at what your app needs. Compare the basics Talk to our team --- ## OriginChainDB vs Pinecone | Compare the basics Canonical source: https://originchaindb.com/vs/pinecone OriginChainDB vs Pinecone Pinecone or OriginChainDB? Pinecone offers vector, full-text and hybrid search. OriginChainDB also has SQL and graph APIs. Compare how each helps your app find a result and return its source. Compare the basics Talk to our team A task to try Find matching passages and show their sources. Start here Which fits your app? Our view: choose based on what your app needs to do. Consider Pinecone when You want managed search with filters, namespaces, embedding and reranking options. Read the docs Consider OriginChainDB when Your search workflow also needs SQL records and relationships in the same database. Explore the database Side by side Compare the basics. Features from the linked docs. Test speed and cost with your own data. Scroll sideways to compare both databases. Pinecone and OriginChainDB capabilities What to comparePineconeOriginChainDB Search An index can support full-text, dense-vector, sparse-vector and hybrid search. Source: Pinecone Database overview Use vector and full-text APIs. Your app combines results and fetches source records. Search controls Offers metadata filters, namespaces, integrated embeddings and reranking. Source: Pinecone Database overview Choose your embedding workflow, preserve record IDs and apply your app’s access rules. Other queries Its database workflow centres on indexes, records and search. Source: Pinecone Database overview Use SQL for structured questions and the graph API to follow relationships. i One database. Separate calls. OriginChainDB uses separate calls for SQL, vector, graph and full-text. Your app keeps the writes in step and links results by ID. A SQL transaction does not automatically cover the other calls. See a write example Try it with your data Find an answer and its source. Try the same task in both systems. Use the same data and judge the full result. The question What is this account’s return policy, and where is it written? 01 Load the same content Use the same passages, account rules and document versions. Keep a source ID for each passage. 02 Search within the rules Use the same embeddings and result count. Return only content the account can access. 03 Show the source Link each passage to its document. If you use an AI model, keep its model and prompt fixed. What to check Right passage Check whether the expected passage is in the results. Right source Check account access, document version and source ID. Cost per answer Include search, embeddings, reranking, record reads and AI model calls. Before you move data Plan your move. Copy the data. Then check your queries, access rules and updates before switching. Explore Migrate Check compatibility Keep IDs and access rules Preserve document links and namespace boundaries. Decide how the new app will enforce them. Map search settings Check vector dimensions, distance metrics, text fields and filters. Review embedding and reranking dependencies. Compare real questions Run both systems on the same questions. Check relevance, updates and complete response times. Common questions. Is Pinecone limited to dense vectors? No. Pinecone also documents full-text, sparse-vector and hybrid search. Test the search method your app needs. Does one database remove the need to manage updates? No. Your app still prepares embeddings, writes records and indexes, and handles updates and deletes. Separate calls do not form one automatic transaction. Sources Check the details. Reviewed 4 November 2026 Pinecone Pinecone Database overview OriginChainDB OriginChainDB: separate record, vector and text writes OriginChainDB: PostgreSQL compatibility OriginChainDB: transaction boundaries OriginChainDB: deployment and recovery Features vary by version and setup. Check the docs for the version you plan to use. Build with OriginChainDB Let's look at what your app needs. Compare the basics Talk to our team --- ## OriginChainDB vs PostgreSQL | Compare the basics Canonical source: https://originchaindb.com/vs/postgres OriginChainDB vs PostgreSQL PostgreSQL or OriginChainDB? PostgreSQL offers SQL and transactions, with vector search through pgvector. OriginChainDB offers separate SQL, vector, graph and full-text APIs. Compare the queries your app needs. Compare the basics Talk to our team A task to try Connect similar items to their current stock records. Start here Which fits your app? Our view: choose based on what your app needs to do. Consider PostgreSQL when You depend on PostgreSQL’s SQL, transactions, extensions and existing tools. Read the docs Consider OriginChainDB when You want graph and search APIs alongside SQL, and can test the different engine’s behaviour. Explore the database Side by side Compare the basics. Features from the linked docs. Test speed and cost with your own data. Scroll sideways to compare both databases. PostgreSQL and OriginChainDB capabilities What to comparePostgreSQLOriginChainDB SQL queries Supports complex queries, foreign keys, triggers, views, transactions and extensions. Source: PostgreSQL overview Supports documented SQL operations. Check the exact queries and tools you need. Vector search pgvector stores embeddings in PostgreSQL and supports exact and approximate searches. Source: pgvector documentation Use the vector API and connect results to records by ID. Your app coordinates the writes. Transactions pgvector works with PostgreSQL joins and transactions. Vectors can live in ordinary tables. Source: pgvector documentation A SQL transaction does not automatically include calls to vector, graph or full-text APIs. i One database. Separate calls. OriginChainDB uses separate calls for SQL, vector, graph and full-text. Your app keeps the writes in step and links results by ID. A SQL transaction does not automatically cover the other calls. See a write example Try it with your data Recommend an item that is in stock. Try the same task in both systems. Use the same data and judge the full result. The question Which similar items can this customer buy? 01 Use the same records Load the same products, stock, regions and embeddings. Keep their IDs connected. 02 Find available matches Search for similar items and apply stock and region rules. 03 Change the stock Update availability during the test. Check that the final results meet your freshness needs. What to check Correct matches Check similarity, stock and region together. Transaction needs Identify which reads and writes must succeed or fail together. App effort Compare query code, retries and work needed to keep data in step. Before you move data Plan your move. Copy the data. Then check your queries, access rules and updates before switching. Explore Migrate Check compatibility List database features Check the types, extensions, functions and constraints your app uses. A working connection is not enough. Test your SQL Replay real queries and tool-generated migrations. Include errors, rollbacks and simultaneous updates. Plan search updates Map embeddings and text indexes to the target APIs. Check completeness and retry behaviour. Common questions. Do I need a separate vector database to use PostgreSQL? No. The pgvector extension stores and searches vectors inside PostgreSQL. Test whether it meets your app’s needs. Does PostgreSQL wire compatibility mean every extension works? No. A compatible connection does not reproduce PostgreSQL’s engine or extensions. Test the features your app uses. Sources Check the details. Reviewed 4 November 2026 PostgreSQL PostgreSQL overview pgvector documentation OriginChainDB OriginChainDB: separate record, vector and text writes OriginChainDB: PostgreSQL compatibility OriginChainDB: transaction boundaries OriginChainDB: deployment and recovery Features vary by version and setup. Check the docs for the version you plan to use. Build with OriginChainDB Let's look at what your app needs. Compare the basics Talk to our team --- ## OriginChainDB vs Qdrant | Compare the basics Canonical source: https://originchaindb.com/vs/qdrant OriginChainDB vs Qdrant Qdrant or OriginChainDB? Qdrant offers vector, text and hybrid search with filters. OriginChainDB also provides SQL and graph queries. Compare the filters, records and relationships needed for a complete result. Compare the basics Talk to our team A task to try Find useful matches within the user’s allowed documents. Start here Which fits your app? Our view: choose based on what your app needs to do. Consider Qdrant when Your main job is vector or hybrid search with filters and search-specific settings. Read the docs Consider OriginChainDB when Your app also needs SQL records and graph relationships, linked to search results by ID. Explore the database Side by side Compare the basics. Features from the linked docs. Test speed and cost with your own data. Scroll sideways to compare both databases. Qdrant and OriginChainDB capabilities What to compareQdrantOriginChainDB Stored data Collections hold points with IDs, vectors and optional JSON fields. A point can have multiple named vectors. Source: Qdrant data model Store records, vectors and relationships. Use IDs to connect them across separate APIs. Text search Supports BM25 full-text search, text filters, sparse vectors and hybrid search. Source: Qdrant search and compatibility FAQ Use vector and full-text APIs. Combine their results in your app. Relationships Its FAQ says built-in knowledge graphs and ontologies are not planned. Source: Qdrant search and compatibility FAQ Store explicit links and follow them through the graph API. i One database. Separate calls. OriginChainDB uses separate calls for SQL, vector, graph and full-text. Your app keeps the writes in step and links results by ID. A SQL transaction does not automatically cover the other calls. See a write example Try it with your data Search the right workspace. Try the same task in both systems. Use the same data and judge the full result. The question Which matching documents can this user access? 01 Define access Load document IDs, workspace details and access fields. Include small and large workspaces. 02 Search with filters Use the same vectors and access rules. Test both broad and narrow filters. 03 Check the final result Read the source record and confirm access. Test permission changes and deleted documents. What to check Access checks Confirm that restricted documents never reach the user. Useful matches Check relevance with real workspace and field filters. Update effort Include search-field updates, source reads and relationship changes. Before you move data Plan your move. Copy the data. Then check your queries, access rules and updates before switching. Explore Migrate Check compatibility Map data and vectors Keep IDs, named-vector settings and filter fields. Decide which fields belong in source records. Preserve access rules Recreate workspace boundaries. Test that users cannot reach another workspace’s data. Compare rankings Check filtered results and updates. Identical embeddings can rank differently under different search settings. Common questions. Does Qdrant support keyword and hybrid search? Yes. Qdrant documents full-text search, text filters and hybrid search. Include these when testing your app. Is a search index graph the same as a knowledge graph? No. A search index may use a graph to find nearby vectors. A knowledge graph stores the real relationships your app needs to query. Sources Check the details. Reviewed 4 November 2026 Qdrant Qdrant data model Qdrant search and compatibility FAQ OriginChainDB OriginChainDB: separate record, vector and text writes OriginChainDB: PostgreSQL compatibility OriginChainDB: transaction boundaries OriginChainDB: deployment and recovery Features vary by version and setup. Check the docs for the version you plan to use. Build with OriginChainDB Let's look at what your app needs. Compare the basics Talk to our team --- ## OriginChainDB vs Supabase | Compare the basics Canonical source: https://originchaindb.com/vs/supabase OriginChainDB vs Supabase Supabase or OriginChainDB? Supabase combines PostgreSQL with auth, storage, realtime and functions. OriginChainDB focuses on the database and its tools. Compare all the services your app needs, not only its tables. Compare the basics Talk to our team A task to try Your app needs identity, a database and file storage. Start here Which fits your app? Our view: choose based on what your app needs to do. Consider Supabase when You want PostgreSQL and application services together, with vector search through pgvector. Read the docs Consider OriginChainDB when You need SQL, graph and search APIs, and will choose the other app services separately. Explore the database Side by side Compare the basics. Features from the linked docs. Test speed and cost with your own data. Scroll sideways to compare both databases. Supabase and OriginChainDB capabilities What to compareSupabaseOriginChainDB What is included A full PostgreSQL database, plus Auth, Storage, Realtime and Edge Functions. Source: Supabase database and platform Database APIs and tools. It does not replace every service in a Supabase project. Vectors pgvector adds vector columns to PostgreSQL tables, alongside other row data. Source: Supabase vector columns Write embeddings through the vector API and link them to source records by ID. Working with data Use PostgreSQL, dashboard editors or APIs. Supports joins, functions and row-level security. Source: Supabase database and platform Use SQL, graph and search APIs. Check tool compatibility and the access controls your app needs. i One database. Separate calls. OriginChainDB uses separate calls for SQL, vector, graph and full-text. Your app keeps the writes in step and links results by ID. A SQL transaction does not automatically cover the other calls. See a write example Try it with your data Build a searchable document workspace. Try the same task in both systems. Use the same data and judge the full result. The question Can a user sign in, find a document and safely open it? 01 List every service Include sign-in, permissions, files, app code and database operations. 02 Prepare the documents Store file links, embeddings and searchable text. Keep owner and workspace IDs. 03 Test the whole journey Sign in, search and open a file. Also test expired sessions and removed access. What to check Services included List what comes with the platform and what you must add. Access checks Test document ownership, workspace separation and removed access. Total cost Include auth, files, functions, search and the database. Before you move data Plan your move. Copy the data. Then check your queries, access rules and updates before switching. Explore Migrate Check compatibility List more than tables Plan for auth users, files, subscriptions and functions. Each may need a different migration path. Review queries and rules Check SQL, extensions, access policies and generated APIs against the new setup. Test a user journey Check sign-in, search, file access, updates and account deletion before switching. Common questions. Is Supabase a database or a backend platform? It is a backend platform built around PostgreSQL. Include its other services when deciding what your app needs. Can copying tables replace a Supabase project? No. Tables do not include the behaviour of auth, storage, functions, realtime or access policies. Plan those separately. Sources Check the details. Reviewed 4 November 2026 Supabase Supabase database and platform Supabase vector columns OriginChainDB OriginChainDB: separate record, vector and text writes OriginChainDB: PostgreSQL compatibility OriginChainDB: transaction boundaries OriginChainDB: deployment and recovery Features vary by version and setup. Check the docs for the version you plan to use. Build with OriginChainDB Let's look at what your app needs. Compare the basics Talk to our team --- ## OriginChainDB vs Weaviate | Compare the basics Canonical source: https://originchaindb.com/vs/weaviate OriginChainDB vs Weaviate Weaviate or OriginChainDB? Weaviate stores objects and embeddings for keyword and vector search. OriginChainDB also offers SQL records and graph queries. Compare how each returns the full result your app needs. Compare the basics Talk to our team A task to try Bring keyword and meaning-based matches into one result list. Start here Which fits your app? Our view: choose based on what your app needs to do. Consider Weaviate when Your app centres on object search, hybrid ranking and model integrations. Read the docs Consider OriginChainDB when Your app also needs SQL queries and relationships, with results connected through separate APIs. Explore the database Side by side Compare the basics. Features from the linked docs. Test speed and cost with your own data. Scroll sideways to compare both databases. Weaviate and OriginChainDB capabilities What to compareWeaviateOriginChainDB Stored data Stores objects and their embeddings. Offers cloud and self-hosted deployments. Source: Weaviate database overview Stores records, vectors, text and explicit relationships in one database product. Hybrid search Combines keyword and vector matches, with controls for weighting and merging results. Source: Weaviate hybrid search Call vector and full-text APIs, then combine results and fetch source records in your app. Connecting your app Provides client APIs and model integrations. Check support for your client version. Source: Weaviate database overview Use documented SQL, graph and search operations. Test the behaviour your app needs. i One database. Separate calls. OriginChainDB uses separate calls for SQL, vector, graph and full-text. Your app keeps the writes in step and links results by ID. A SQL transaction does not automatically cover the other calls. See a write example Try it with your data Find a note without knowing its title. Try the same task in both systems. Use the same data and judge the full result. The question Can users find the right troubleshooting note in their own words? 01 Choose real questions Include exact error codes, different wording and misleading keyword matches. 02 Compare the search Use the same text and embeddings. Tune word and meaning scores on a separate test set. 03 Open the source Return the current note and related system. Check access and show the matching passage. What to check Useful results Check exact-word and reworded questions separately. Ranking changes Test how different weights change the result order. Response time Include search, record reads and relationship queries. Before you move data Plan your move. Copy the data. Then check your queries, access rules and updates before switching. Explore Migrate Check compatibility Map objects and links Preserve IDs, fields, references and vector settings. Decide how links become relationships. Keep search settings clear Review embedding generation, text processing and ranking. Moving vectors alone does not recreate the search. Test the new calls Use supported client APIs. Compare results, updates and deletes before switching. Common questions. Is hybrid search exclusive to OriginChainDB? No. Weaviate also combines keyword and vector search. Compare quality, filters and source-record handling on the same data. Should I use old GraphQL examples? Check current Weaviate guidance first. GraphQL is now deprecated. Use the supported API for your client and deployment. Sources Check the details. Reviewed 4 November 2026 Weaviate Weaviate database overview Weaviate hybrid search OriginChainDB OriginChainDB: separate record, vector and text writes OriginChainDB: PostgreSQL compatibility OriginChainDB: transaction boundaries OriginChainDB: deployment and recovery Features vary by version and setup. Check the docs for the version you plan to use. Build with OriginChainDB Let's look at what your app needs. Compare the basics Talk to our team