Skip to Content

Getting Started

Overview

One package for Python and TypeScript, with Dock to write and Lynk to read.

The Docklee SDK wraps the REST API so you never build requests by hand. It reads your settings from the environment, retries failed requests, buffers writes in the background, and returns typed results.

Packages

LanguagePackageInstallRequires
Pythondocklee on PyPIpip install dockleePython 3.9+
TypeScriptdocklee on npmnpm install dockleeNode.js 18+

Both packages are at version 2.0.0. The Python package ships type hints, and its results are typed models. The TypeScript package ships ES module and CommonJS builds with TypeScript definitions.

Two classes

ClassDirectionReaches
DockWrites data into DockleeVector and OKF containers, and memory spaces
LynkReads data backEngines and memory spaces
from docklee import Dock, Lynk

dock = Dock()
dock.capture("Maya prefers email over phone calls.", type="preference")
dock.flush_sync()

records = Lynk().recall_sync("How does Maya like to be contacted?")

This example reads DOCKLEE_API_KEY and DOCKLEE_MEMORY_SPACE_ID from the environment. See Configuration.

Every method

MethodPythonTypeScriptCalls
CapturecapturecaptureBuffers an event
Flushflush, flush_syncflushPOST /v1/dock/ingest
CloseclosecloseFlushes and stops
Instrument an appinstrumentinstrumentCaptures write requests
Watch a databasewatchnoneCaptures new and changed rows
Listen for webhookslistennoneCaptures incoming webhooks
Queryquery, query_syncqueryPOST /v1/engine/query or /v1/engine/query/stream
Retrieveretrieve, retrieve_syncretrievePOST /v1/engine/retrieve
Recallrecall, recall_syncrecallPOST /v1/dum/search

What the SDK does for you

You getDetail
Settings from the environmentKey, memory space, engine, end user, container, and dimension.
Buffered writescapture returns at once, and batches are sent in the background.
Duplicate protectionIdentical content within 60 seconds is captured once.
RetriesTimeouts, connection errors, and retryable statuses are retried with backoff.
Typed errorsEach HTTP status maps to its own error class.
Typed resultsEvery call returns a typed object.

Next steps

You know what's in the package. Pick your language and make your first calls.

On this page