@timeplus/dsh-session-query
v0.0.1
Published
Timeplus session query for DeepSeek Harness: fleet-scale full-text and trace search over the session-event stream
Maintainers
Readme
@timeplus/dsh-session-query
A SessionQueryEngine (ctx.sessionQuery) for DeepSeek Harness
(dsh) that answers cross-session full-text search as push-down streaming SQL
over a Timeplus / Proton index — the query companion to
@timeplus/dsh-session-persistence.
Where the persistence provider makes a Timeplus stream the durable session log,
this engine derives a searchable index from it (and from live sessions) and runs
searchSessions / searchEvents against the whole fleet in one store — no
per-node full-text index to build and reconcile, unlike the SQLite engine.
How it works
- Semantic documents, extracted in TS. Searchable text comes from the shared
buildSessionEventSearchDocuments(surface-aware, event-type-specific), so raw chunks and structural events contribute nothing and assistant reasoning is excluded — identical to the first-party engines. - A derived index in Timeplus. Two
versioned_kvstreams (<index>_state,<index>_docs) hold one row per session and per searchable event, upserted by primary key with a soft-delete flag. On each search the engine reconciles them fromctx.sessionPersistence(by revision) and livectx.sessions(by content fingerprint), waits for read-your-writes visibility, then queries. - Push-down matching and ranking. The query is treated as a literal
case-insensitive token phrase and compiled to a RE2 pattern; Proton's
match()filters andcount_matches()ranks. Snippets are built in-process. Results are live-preferred (a live session hides its persisted copy) and cursor-paginated.
Only searchSessions and searchEvents are backend-specific; the exact reads,
filters, traces, and titles are inherited from the base SessionQueryEngine.
Install & configure
Requires the dsh CLI, a reachable Timeplus/Proton, and (recommended) the Timeplus
persistence provider so search covers persisted sessions.
dsh plugin --profile <name> add @timeplus/dsh-session-queryIn $DSH_HOME/profiles/<name>/cordis.patch.yml, insert it alongside the persistence
provider (both point at the same Timeplus):
- insert:
- id: session-query-timeplus
name: '@timeplus/dsh-session-query'
config:
url: http://localhost:8123
database: default
indexStream: dsh_session_search # <index>_state / <index>_docs are createdConfig
| Key | Default | Meaning |
|---|---|---|
| url | — (required) | Timeplus/Proton HTTP endpoint. |
| database | default | Database holding the index streams. |
| indexStream | dsh_session_search | Base name; _state / _docs are appended. |
| username / password / apiKey | — | Auth. |
| bootstrapSchema | true | Create the index streams at init. |
| flushThresholdMs | 200 | Index-write visibility bound. |
| defaultLimit / maxLimit | 20 / 100 | Page sizes. |
| snippetChars | 240 | Snippet length in code points. |
Status
dsh is a developer preview. Verified against @deepseek-ai/[email protected] and Proton
3.0.29. Single live writer per session id is a v1 deployment contract (shared with the
persistence provider). Source and tests:
github.com/timeplus-io/dsh-timeplus.
License
Apache-2.0
