Query data
OriginChain answers five query shapes against the same hash-keyed substrate: SQL, vector search, BM25 full-text, graph traversal, and natural language. A row written once is visible to all five the moment the WAL fsyncs.
Pick a shape below for the request body, mode flags, and response shape. The HTTP API reference has every endpoint in one place; the Python SDK wraps each one.
POST /v1/tenants/:t/sql. SELECT, INSERT, DELETE, GROUP BY, HAVING, INNER / LEFT / RIGHT / FULL OUTER joins on up to 5 tables. Left-deep tree, p99 < 8 ms on indexed reads.
HNSW with metadata filters and two modes. Default high_recall hits recall@10 = 0.96 at 100k with p99 109 ms; fast mode runs p99 37 ms at recall 0.69.
Boolean AND, BM25 (k1=1.2, b=0.75), phrase queries. UAX #29 Unicode tokenizer, 18-language stemming, optional stop-word elimination.
Direction-tagged relation keys back one-hop neighbors, BFS, reachability, weighted shortest path. Self-relations supported.
POST /v1/ask. An English sentence becomes a Plan tree. First call compiles, every repeat is a cache hit at p50 < 2 ms.
Shared mechanics.
Every shape compiles to a JSON-serialisable Plan tree, cached by question hash, replayable. ?explain=true on any read endpoint returns the executed plan annotated with per-node row counts and µs timings. Cancel an in-flight plan with the ULID handed back in X-OC-Query-Id.
For the operator catalog (Scan, IndexScan, Filter, HashJoin, OuterJoin, Aggregate, Sort, Limit, RelationHop), see core concepts → plan tree.