Installation
Quick Start
Constructor
| Parameter | Type | Default | Description |
|---|---|---|---|
base_url | str | https://api.9dlabs.xyz | Server URL |
api_key | str | "" | API key for X-API-Key header |
timeout | int | 30 | HTTP timeout in seconds |
Methods
ingest()
Store a single artifact in workspace memory.
| Parameter | Type | Required | Description |
|---|---|---|---|
workspace_id | str | Yes | Workspace identifier |
actor_id | str | Yes | Creator identifier |
artifact_type | str | Yes | One of 9 types (see artifact types) |
raw_payload | dict | str | list | No | Content to store |
blob_pointer | str | No | Pointer to external blob |
permissions | dict | No | Access control |
idempotency_key | str | No | Deduplication key |
session_id | str | No | Session grouping |
thread_id | str | No | Thread grouping |
timestamp | str | No | ISO 8601 datetime |
callback_url | str | No | Webhook for async indexing completion |
context_pack()
Retrieve a deterministic context pack for a query.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | str | Yes | — | Query to retrieve evidence for |
workspace_id | str | Yes | — | Workspace scope |
max_tokens | int | No | 4096 | Token budget |
actor_id | str | No | — | Actor’s permission scope |
mode | str | No | — | relevance or coverage |
max_latency_ms | int | No | — | Latency constraint |
max_cost_usd | float | No | — | Cost constraint |
min_evidence_tokens | int | No | — | Minimum evidence required |
min_confidence | float | No | — | Minimum confidence threshold |
max_spans_per_artifact | int | No | — | Cap spans per artifact |
diversity_decay | float | No | — | Diversity enforcement factor |
redundancy_jaccard_threshold | float | No | — | Jaccard threshold for dedup |
temporal_half_life_hours | float | No | — | Temporal decay half-life |