Skip to content

QQL runnable examples

The repository examples are executable applications, not duplicated snippets inside the documentation site.

ExampleLanguage / backendWhat it demonstrates
examples/pythonPython (pyqql)Python basics through advanced retrieval: basic_to_medium.py (parse → is_validexplaincompile_queryinject_filter → shard key) and medium_to_expert.py. Offline — no Qdrant needed.
examples/nodejsNode.js (@veristamp/nqql)Node.js parser and runtime APIs: basic_to_medium.mjs and medium_to_expert.mjs.
examples/rustRust (qql-core)basic_to_medium (Parser::parse + inject_filter + set_shard_key) and medium_to_expert (fail-closed multi-tenant gateway with a per-user tenant_id plus a status predicate).
examples/wasmWebAssembly (qql-wasm)WASM parse / isValid / analyze / compile / explain, Stmt.injectFilter + shardKey, hybrid analysis, Client execute (multi-tenant gateway).
examples/edge-demoqql CLI --edgeIn-process edge execution with the qql CLI. Requires an edge-enabled build (--features edge).
examples/airbnb-demoPython (pyqql) + Qdrant + OllamaBerlin geo search: GEO_RADIUS / GEO_BBOX / GEO_POLYGON, hybrid search, turbo binary quantization with rescore.
examples/medical-retrieval-opsqql CLI + QdrantProvisions the ChatMED RAGCare-QA benchmark and runs retrieval checks.
examples/medical-showcaseqql CLI + Qdrant12-record end-to-end: hybrid, filters, ACORN, timeout/consistency, grouped retrieval, recommend, context, discover, CTE prefetch DAGs, mutations, DELETE PAYLOAD, SCROLL WITH VECTOR, COUNT exact.
examples/sec10k-qqlPython (pyqql) + Qdrant + Ollama/LM StudioFlagship multi-tenant hybrid RAG over SEC 10-K filings: CREATE SHARD KEY, is_tenant index, SHARD + WHERE tenant_id, fail-closed inject_filter, agent tool-use.

Browse the examples directory on GitHub.

QQLRepresentative geo queryTry in playground
QUERY 'quiet apartment near transit'
FROM listings
USING dense
WHERE location GEO_RADIUS {center: {lat: 52.52, lon: 13.405}, radius: 5000.0}
WITH PAYLOAD INCLUDE (name, neighbourhood, price)
LIMIT 10;

These statements require a Qdrant 1.19+ server for full semantics. Prefix and slice filters, IDF params, and memory placement parse on every backend; quotas are REST-only.

QQLPrefix filter, slice, and sparse IDFTry in playground
CREATE INDEX ON COLLECTION docs FOR title TYPE keyword WITH (prefix = true);
QUERY 'search'
FROM docs
WHERE title MATCH PREFIX 'Comp' AND SLICE (4, 1)
LIMIT 10;
QUERY 'search'
FROM docs
USING sparse
PARAMS (idf = 'global')
LIMIT 10;
QUERY 'search'
FROM docs
USING sparse
WHERE tenant_id = 'acme'
SHARD 'acme'
PARAMS (idf = WHERE tenant_id = 'acme')
LIMIT 10;
QQLMemory placement and cluster quotas (REST)Try in playground
CREATE COLLECTION docs (
dense VECTOR(384, COSINE) WITH VECTOR (memory = 'cached', datatype = 'turbo4')
)
WITH HNSW (memory = 'cold')
WITH PARAMS (payload_memory = 'cold');
SHOW QUOTAS;
SET QUOTA (enabled = true, max_resident_memory_percent = 80) WAIT true;

When adding an example, keep its QQL compatible with language/v1, document the required backend and models, and provide a deterministic setup path.