The published package is surrealdb-spectron — a client generated from Spectron’s OpenAPI specification, wrapped with an ergonomic façade. Types such as MemoryCategory and graph edge kinds stay aligned with the server because both sides share the same spec.
Installation
Python 3.10+ recommended. Regenerate from the repo spec with clients/python/generate.sh when developing Spectron itself.
Configuration
Authentication uses the API-KEY header on every request (handled by the client). Do not prefix the key with Bearer.
| Setting | Environment variable | Example |
|---|---|---|
| Server URL | SPECTRON_URL | http://localhost:9090 |
| Context key | SPECTRON_API_KEY | from spectrond bootstrap |
| Context id | SPECTRON_CONTEXT_ID | dev |
Remember (facts)
Bulk conversation ingest:
Recall
Documents
Chat
Harness adapter (zero prompt change)
For LangChain-style apps that should auto-record every turn:
See LangChain. The adapter posts to /facts/batch with platform-derived idempotency keys.
CLI alternative
The spectron binary exposes the same operations without installing the SDK:
See CLI reference and REST API.
Method names on the generated client follow OpenAPI operation ids and may differ slightly from the examples above. When in doubt, run
spectron-gen-specand inspectdoc/spec/or use the CLI as the contract reference.