Skip to content

Add REST API server, Rust client SDK, and point lookup#66

Merged
beinan merged 1 commit into
lance-format:mainfrom
beinan:feat/async-api
Jun 10, 2026
Merged

Add REST API server, Rust client SDK, and point lookup#66
beinan merged 1 commit into
lance-format:mainfrom
beinan:feat/async-api

Conversation

@beinan

@beinan beinan commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Introduces three new crates to enable lance-context as a remote service:
    • lance-context-api: Shared request/response DTOs (serde-only, no heavy deps)
    • lance-context-server: Multi-context axum HTTP server with 13 REST endpoints under /api/v1/
    • lance-context-client: Typed Rust HTTP client SDK (no arrow/lance transitive deps)
  • Adds point lookup (get by ID) across all layers: core Rust, PyO3 bindings, Python sync/async API, and REST endpoint

REST API Endpoints

Method Path Purpose
POST /contexts Create a named context
GET /contexts List all contexts
GET /contexts/{name} Get context info
DELETE /contexts/{name} Delete context
POST /contexts/{name}/records Add records (batch)
GET /contexts/{name}/records List records (paginated)
GET /contexts/{name}/records/{id} Get record by ID
POST /contexts/{name}/search Vector similarity search
GET /contexts/{name}/version Current version
POST /contexts/{name}/checkout Time-travel to version
POST /contexts/{name}/compact Trigger compaction
GET /contexts/{name}/compact/stats Compaction stats
GET /health Health check

Crate Architecture

lance-context-api (shared DTOs: serde, chrono, base64)
       /                          \
lance-context-server          lance-context-client
(axum, lance-context-core)    (reqwest only — no arrow/lance)

Test plan

  • All 19 existing lance-context-core tests pass
  • cargo build succeeds for all three new crates with zero warnings
  • cargo check succeeds for PyO3 bindings with new get() method
  • Manual testing of server endpoints with curl
  • Integration test: client SDK against running server

🤖 Generated with Claude Code

@beinan beinan marked this pull request as ready for review June 10, 2026 02:50
@beinan beinan force-pushed the feat/async-api branch 4 times, most recently from 73bbae8 to 40b029c Compare June 10, 2026 03:15
Introduces three new crates to enable lance-context as a remote service:

- lance-context-api: Shared request/response DTOs (serde-only, no heavy deps)
- lance-context-server: Multi-context axum HTTP server with 13 REST endpoints
- lance-context-client: Typed Rust HTTP client (no arrow/lance transitive deps)

Also adds point lookup (get by ID) across all layers:
- ContextStore::get() in core (filtered scan with limit 1, uses scalar index)
- PyO3 binding with GIL release
- Python Context.get() and AsyncContext.get()
- GET /api/v1/contexts/{name}/records/{id} endpoint

Co-Authored-By: Beinan Wang <beinanwang@microsoft.com>
@beinan beinan merged commit bb16abf into lance-format:main Jun 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants