Skip to content

Commit 4a69a42

Browse files
committed
doc: fix build
1 parent 26472df commit 4a69a42

17 files changed

Lines changed: 754 additions & 219 deletions

File tree

hindsight-docs/docs/developer/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,5 +246,5 @@ See the [Python SDK](../sdks/python.md) for the full API reference.
246246
## Next Steps
247247

248248
- [Configuration](./configuration.md) — Environment variables and settings
249-
- [Models](./models.md) — ML models and providers
249+
- [Models](./models.mdx) — ML models and providers
250250
- [Monitoring](./monitoring.md) — Metrics and observability

hindsight-docs/versioned_docs/version-0.4/developer/api/quickstart.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@ Get up and running with Hindsight in 60 seconds.
99
import Tabs from '@theme/Tabs';
1010
import TabItem from '@theme/TabItem';
1111
import CodeSnippet from '@site/src/components/CodeSnippet';
12+
import {ClientsGrid, IntegrationsGrid} from '@site/src/components/SupportedGrids';
1213

1314
{/* Import raw source files */}
1415
import quickstartPy from '!!raw-loader!@site/examples/api/quickstart.py';
1516
import quickstartMjs from '!!raw-loader!@site/examples/api/quickstart.mjs';
1617
import quickstartSh from '!!raw-loader!@site/examples/api/quickstart.sh';
1718

19+
## Clients
20+
21+
<ClientsGrid />
22+
1823
## Start the API Server
1924

2025
<Tabs>
@@ -100,6 +105,10 @@ curl -fsSL https://hindsight.vectorize.io/get-cli | bash
100105

101106
---
102107

108+
## Integrations
109+
110+
<IntegrationsGrid />
111+
103112
## Next Steps
104113

105114
- [**Retain**](./retain) — Advanced options for storing memories

hindsight-docs/versioned_docs/version-0.4/developer/api/recall.mdx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,66 @@ Use this for strict scope enforcement where a memory must explicitly belong to *
184184
A memory with tags `["user:alice", "team", "project:x"]` will still match a filter of `["user:alice", "team"]` under `all_strict` — extra tags on the memory are not a problem. The filter only requires the memory to contain **at least** the specified tags.
185185
:::
186186

187+
### tag_groups
188+
189+
`tag_groups` is a list of compound boolean tag filters. The groups in the list are AND-ed together at the top level. Each group is a recursive boolean expression: a **leaf** node `{tags, match}`, or a **compound** node `{and: [...]}`, `{or: [...]}`, or `{not: ...}`.
190+
191+
`tag_groups` and `tags` / `tags_match` can be used simultaneously — they are AND-ed together.
192+
193+
#### Leaf node
194+
195+
```json
196+
{ "tags": ["step:5", "step:8"], "match": "any_strict" }
197+
```
198+
199+
`match` accepts the same values as `tags_match`: `any`, `all`, `any_strict`, `all_strict`. Defaults to `any_strict`.
200+
201+
#### Compound nodes
202+
203+
```json
204+
{ "and": [ <TagGroup>, <TagGroup>, ... ] }
205+
{ "or": [ <TagGroup>, <TagGroup>, ... ] }
206+
{ "not": <TagGroup> }
207+
```
208+
209+
#### Examples
210+
211+
**Step filter AND user scope** — two top-level groups AND-ed:
212+
213+
```json
214+
{
215+
"tag_groups": [
216+
{ "tags": ["step:5", "step:8", "step:12"], "match": "any_strict" },
217+
{ "tags": ["user:ep_42"], "match": "all_strict" }
218+
]
219+
}
220+
```
221+
222+
**Nested OR inside AND** — user must match, plus either step OR priority:
223+
224+
```json
225+
{
226+
"tag_groups": [
227+
{ "tags": ["user:alice"], "match": "all_strict" },
228+
{ "or": [
229+
{ "tags": ["step:5"], "match": "any_strict" },
230+
{ "tags": ["priority:high"], "match": "all_strict" }
231+
]}
232+
]
233+
}
234+
```
235+
236+
**Exclusion** — user must match, but archived memories are excluded:
237+
238+
```json
239+
{
240+
"tag_groups": [
241+
{ "tags": ["user:alice"], "match": "all_strict" },
242+
{ "not": { "tags": ["archived"], "match": "any_strict" } }
243+
]
244+
}
245+
```
246+
187247
### trace
188248

189249
When set to `true`, the response includes a detailed debug trace covering the query embedding, entry points, per-strategy retrieval results, RRF fusion candidates, reranked results, temporal constraints detected, and per-phase timings. Has no effect on the retrieval logic itself. Useful for understanding why specific memories were or were not returned.

hindsight-docs/versioned_docs/version-0.4/developer/configuration.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ To switch between backends:
160160

161161
| Variable | Description | Default |
162162
|----------|-------------|---------|
163-
| `HINDSIGHT_API_LLM_PROVIDER` | Provider: `openai`, `openai-codex`, `claude-code`, `anthropic`, `gemini`, `groq`, `ollama`, `lmstudio`, `vertexai` | `openai` |
163+
| `HINDSIGHT_API_LLM_PROVIDER` | Provider: `openai`, `openai-codex`, `claude-code`, `anthropic`, `gemini`, `groq`, `minimax`, `ollama`, `lmstudio`, `vertexai` | `openai` |
164164
| `HINDSIGHT_API_LLM_API_KEY` | API key for LLM provider | - |
165165
| `HINDSIGHT_API_LLM_MODEL` | Model name | `gpt-5-mini` |
166166
| `HINDSIGHT_API_LLM_BASE_URL` | Custom LLM endpoint | Provider default |
@@ -410,7 +410,7 @@ Supported OpenAI embedding dimensions:
410410

411411
| Variable | Description | Default |
412412
|----------|-------------|---------|
413-
| `HINDSIGHT_API_RERANKER_PROVIDER` | Provider: `local`, `tei`, `cohere`, `zeroentropy`, `flashrank`, `litellm`, `litellm-sdk`, or `rrf` | `local` |
413+
| `HINDSIGHT_API_RERANKER_PROVIDER` | Provider: `local`, `tei`, `cohere`, `zeroentropy`, `flashrank`, `litellm`, `litellm-sdk`, `jina-mlx`, or `rrf` | `local` |
414414
| `HINDSIGHT_API_RERANKER_LOCAL_MODEL` | Model for local provider | `cross-encoder/ms-marco-MiniLM-L-6-v2` |
415415
| `HINDSIGHT_API_RERANKER_LOCAL_MAX_CONCURRENT` | Max concurrent local reranking (prevents CPU thrashing under load) | `4` |
416416
| `HINDSIGHT_API_RERANKER_LOCAL_TRUST_REMOTE_CODE` | Allow loading models with custom code (security risk, disabled by default) | `false` |
@@ -426,10 +426,12 @@ Supported OpenAI embedding dimensions:
426426
| `HINDSIGHT_API_RERANKER_LITELLM_SDK_API_KEY` | LiteLLM **SDK** API key for direct reranking (no proxy needed) | - |
427427
| `HINDSIGHT_API_RERANKER_LITELLM_SDK_MODEL` | LiteLLM SDK rerank model (e.g., `deepinfra/Qwen3-reranker-8B`) | `cohere/rerank-english-v3.0` |
428428
| `HINDSIGHT_API_RERANKER_LITELLM_SDK_API_BASE` | Custom API base URL for LiteLLM SDK (optional) | - |
429+
| `HINDSIGHT_API_RERANKER_LITELLM_MAX_TOKENS_PER_DOC` | Truncate documents to this many tokens before sending to the reranker (applies to both `litellm` and `litellm-sdk`). Use for models with small context windows (e.g. set to `900` for a 1024-token limit model). Unset by default (no truncation). | - |
429430
| `HINDSIGHT_API_RERANKER_ZEROENTROPY_API_KEY` | ZeroEntropy API key for reranking | - |
430431
| `HINDSIGHT_API_RERANKER_ZEROENTROPY_MODEL` | ZeroEntropy rerank model (`zerank-2`, `zerank-2-small`) | `zerank-2` |
431432
| `HINDSIGHT_API_RERANKER_FLASHRANK_MODEL` | FlashRank model for fast CPU-based reranking | `ms-marco-MiniLM-L-12-v2` |
432433
| `HINDSIGHT_API_RERANKER_FLASHRANK_CACHE_DIR` | Cache directory for FlashRank models | System default |
434+
| `HINDSIGHT_API_RERANKER_JINA_MLX_MODEL_PATH` | Local path to downloaded `jina-reranker-v3-mlx` model (auto-downloads from HuggingFace if unset) | - |
433435

434436
```bash
435437
# Local (default) - uses SentenceTransformers CrossEncoder
@@ -472,6 +474,10 @@ export HINDSIGHT_API_RERANKER_LITELLM_MODEL=cohere/rerank-english-v3.0 # or voy
472474
export HINDSIGHT_API_RERANKER_PROVIDER=litellm-sdk
473475
export HINDSIGHT_API_RERANKER_LITELLM_SDK_API_KEY=your-deepinfra-api-key
474476
export HINDSIGHT_API_RERANKER_LITELLM_SDK_MODEL=deepinfra/Qwen3-reranker-8B # or cohere/rerank-english-v3.0, etc.
477+
478+
# Jina MLX - Apple Silicon native reranking (no GPU/cloud required)
479+
# Model (~1.2 GB) is downloaded automatically from HuggingFace Hub on first use.
480+
export HINDSIGHT_API_RERANKER_PROVIDER=jina-mlx
475481
```
476482

477483
#### LiteLLM Proxy vs SDK
@@ -488,6 +494,14 @@ Both support the same providers:
488494
- **Jina AI** (`jina_ai/jina-reranker-v2`)
489495
- **AWS Bedrock** (`bedrock/...`)
490496

497+
#### Jina MLX (Apple Silicon)
498+
499+
The `jina-mlx` provider uses [`jinaai/jina-reranker-v3-mlx`](https://huggingface.co/jinaai/jina-reranker-v3-mlx), optimized for Apple Silicon. The model (~1.2 GB) is downloaded from HuggingFace Hub automatically on first startup and cached locally.
500+
501+
:::note License
502+
`jina-reranker-v3-mlx` is licensed under CC BY-NC 4.0. Contact Jina AI for commercial usage.
503+
:::
504+
491505
### Authentication
492506

493507
By default, Hindsight runs without authentication. For production deployments, enable API key authentication using the built-in tenant extension:
@@ -530,6 +544,7 @@ For advanced authentication (JWT, OAuth, multi-tenant schemas), implement a cust
530544
| `HINDSIGHT_API_GRAPH_RETRIEVER` | Graph retrieval algorithm: `link_expansion`, `mpfp`, or `bfs` | `link_expansion` |
531545
| `HINDSIGHT_API_RECALL_MAX_CONCURRENT` | Max concurrent recall operations per worker (backpressure) | `32` |
532546
| `HINDSIGHT_API_RECALL_CONNECTION_BUDGET` | Max concurrent DB connections per recall operation | `4` |
547+
| `HINDSIGHT_API_RECALL_MAX_QUERY_TOKENS` | Maximum token length of a recall query; requests exceeding this limit are rejected with HTTP 400 | `500` |
533548
| `HINDSIGHT_API_RERANKER_MAX_CANDIDATES` | Max candidates to rerank per recall (RRF pre-filters the rest) | `300` |
534549
| `HINDSIGHT_API_MPFP_TOP_K_NEIGHBORS` | Fan-out limit per node in MPFP graph traversal | `20` |
535550
| `HINDSIGHT_API_MENTAL_MODEL_REFRESH_CONCURRENCY` | Max concurrent mental model refreshes | `8` |

hindsight-docs/versioned_docs/version-0.4/developer/index.md renamed to hindsight-docs/versioned_docs/version-0.4/developer/index.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ sidebar_position: 1
33
slug: /
44
---
55

6+
import {ClientsGrid, IntegrationsGrid} from '@site/src/components/SupportedGrids';
7+
68
# Overview
79

810
## Why Hindsight?
@@ -114,6 +116,14 @@ The **mission** tells Hindsight what knowledge to prioritize and provides contex
114116

115117
These settings only affect the `reflect` operation, not `recall`.
116118

119+
## Clients & Languages
120+
121+
<ClientsGrid />
122+
123+
## Integrations
124+
125+
<IntegrationsGrid />
126+
117127
## Next Steps
118128

119129
### Getting Started

hindsight-docs/versioned_docs/version-0.4/developer/installation.md

Lines changed: 60 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ Hindsight can be deployed in several ways depending on your infrastructure and r
88

99
## Prerequisites
1010

11-
### PostgreSQL with pgvector
11+
### PostgreSQL
1212

13-
Hindsight requires PostgreSQL with the **pgvector** extension for vector similarity search.
13+
Hindsight requires PostgreSQL 14+ with a vector extension for similarity search. The supported extensions are:
14+
15+
- **pgvector** (default)
16+
- **pgvectorscale**
17+
- **vchord**
18+
19+
Configure which one to use with `HINDSIGHT_API_VECTOR_EXTENSION`. See [Configuration](./configuration) for details.
1420

1521
**By default**, Hindsight uses **pg0** — an embedded PostgreSQL that runs locally on your machine. This is convenient for development but **not recommended for production**.
1622

17-
**For production**, use an external PostgreSQL with pgvector:
23+
**For production**, use an external PostgreSQL with one of the supported vector extensions:
1824
- **Supabase** — Managed PostgreSQL with pgvector built-in
1925
- **Neon** — Serverless PostgreSQL with pgvector
20-
- **Azure Database for PostgreSQL** — With pgvector and pg_diskann (DiskANN) support
26+
- **Azure Database for PostgreSQL** — With pgvector and pgvectorscale support
2127
- **AWS RDS** / **Cloud SQL** — With pgvector extension enabled
22-
- **Self-hosted** — PostgreSQL 14+ with pgvector installed
28+
- **Self-hosted** — PostgreSQL 14+ with your preferred vector extension
2329

2430
### LLM Provider
2531

26-
You need an LLM API key for fact extraction, entity resolution, and answer generation:
27-
28-
- **Groq** (recommended): Fast inference with `gpt-oss-20b`
29-
- **OpenAI**: GPT-4o, GPT-4o-mini
30-
- **Ollama**: Run models locally
31-
32-
See [Models](./models) for detailed comparison and configuration.
32+
You need an LLM API key for fact extraction, entity resolution, and answer generation. See [Models](./models) for supported providers, model recommendations, and configuration.
3333

3434
---
3535

@@ -53,61 +53,12 @@ docker run --rm -it --pull always -p 8888:8888 -p 9999:9999 \
5353

5454
### Docker Image Variants
5555

56-
Hindsight provides two image variants with different size/capability tradeoffs:
56+
| Variant | Size (AMD64) | Size (ARM64) | When to use |
57+
|---------|--------------|--------------|-------------|
58+
| **Full** (`latest`) | ~9 GB | ~3.7 GB | Default. Works out of the box with no external services except the LLM. |
59+
| **Slim** (`slim`) | ~500 MB | ~500 MB | Use when you already rely on external services for embeddings and reranking (OpenAI, Cohere, TEI). Significantly smaller image, faster deploys. Requires [external providers](./configuration#embeddings). |
5760

58-
| Variant | Size (AMD64) | Size (ARM64) | Use Case |
59-
|---------|--------------|--------------|----------|
60-
| **Full** (`latest`) | ~9 GB | ~3.7 GB | Includes local ML models (embeddings, reranking) |
61-
| **Slim** (`slim`) | ~500 MB | ~500 MB | Requires external embedding/reranking providers |
62-
63-
**Full image** (default):
64-
```bash
65-
docker run --rm -it -p 8888:8888 \
66-
-e HINDSIGHT_API_LLM_API_KEY=$OPENAI_API_KEY \
67-
ghcr.io/vectorize-io/hindsight:latest
68-
```
69-
- ✅ Works out of the box with local ML models
70-
- ✅ No additional services needed
71-
- ❌ Larger image size (AMD64 includes CUDA libraries for GPU support)
72-
73-
**Slim image**:
74-
```bash
75-
docker run --rm -it -p 8888:8888 \
76-
-e HINDSIGHT_API_LLM_API_KEY=$OPENAI_API_KEY \
77-
-e HINDSIGHT_API_EMBEDDINGS_PROVIDER=openai \
78-
-e HINDSIGHT_API_RERANKER_PROVIDER=cohere \
79-
-e HINDSIGHT_API_COHERE_API_KEY=$COHERE_API_KEY \
80-
ghcr.io/vectorize-io/hindsight:latest-slim
81-
```
82-
- ✅ Dramatically smaller image (~95% reduction on AMD64)
83-
- ✅ Faster pull/deploy times
84-
- ✅ Lower memory footprint
85-
- ❌ Requires external embedding/reranking services (OpenAI, Cohere, TEI)
86-
87-
**When to use slim:**
88-
- Cloud deployments where image size matters
89-
- Using managed embedding services (OpenAI, Cohere)
90-
- Running on Text Embeddings Inference (TEI) infrastructure
91-
- Kubernetes environments with fast pull requirements
92-
93-
:::warning Slim Image Requires External Providers
94-
If you run the slim image **without** setting external embedding providers, you'll see this error:
95-
96-
```
97-
ImportError: sentence-transformers is required for LocalSTEmbeddings.
98-
Install it with: pip install sentence-transformers
99-
```
100-
101-
**Fix:** Always set embedding and reranking providers when using slim images:
102-
```bash
103-
-e HINDSIGHT_API_EMBEDDINGS_PROVIDER=openai
104-
-e HINDSIGHT_API_EMBEDDINGS_OPENAI_API_KEY=sk-xxx
105-
-e HINDSIGHT_API_RERANKER_PROVIDER=cohere
106-
-e HINDSIGHT_API_COHERE_API_KEY=xxx
107-
```
108-
:::
109-
110-
See [Configuration](./configuration#embeddings) for all embedding provider options.
61+
The slim image corresponds to the [`hindsight-api-slim`](#bare-metal-pip) pip package. See [Configuration](./configuration#embeddings) for external provider options.
11162

11263
### Available Tags
11364

@@ -120,7 +71,7 @@ ghcr.io/vectorize-io/hindsight:0.4.9-slim # Slim, specific version
12071

12172
# API only
12273
ghcr.io/vectorize-io/hindsight-api:latest
123-
ghcr.io/vectorize-io/hindsight-api:slim
74+
ghcr.io/vectorize-io/hindsight-api:latest-slim
12475

12576
# Control Plane only
12677
ghcr.io/vectorize-io/hindsight-control-plane:latest
@@ -175,14 +126,17 @@ See the [Helm chart values.yaml](https://github.com/vectorize-io/hindsight/tree/
175126

176127
## Bare Metal (pip)
177128

178-
**Best for**: Custom deployments, integration into existing Python applications
129+
**Best for**: Running Hindsight as a standalone service on a host machine.
179130

180131
### Install
181132

182133
```bash
183-
pip install hindsight-all
134+
pip install hindsight-api # Full — works out of the box
135+
pip install hindsight-api-slim # Slim — requires external services for embeddings, reranking, and the database
184136
```
185137

138+
When using `hindsight-api-slim`, you must configure external providers for all model operations. See [Configuration](./configuration#embeddings) for details.
139+
186140
### Run with Embedded Database
187141

188142
For development and testing, Hindsight can run with an embedded PostgreSQL (pg0):
@@ -253,8 +207,44 @@ PORT=80 HINDSIGHT_CP_DATAPLANE_API_URL=https://api.hindsight.io npx @vectorize-i
253207

254208
---
255209

210+
## Embedded in a Python Application
211+
212+
**Best for**: Using Hindsight programmatically from Python without running a separate server process.
213+
214+
```bash
215+
pip install hindsight-all # Full — works out of the box
216+
pip install hindsight-all-slim # Slim — requires external services for embeddings, reranking, and the database
217+
```
218+
219+
`hindsight-all` supports two modes of embedding:
220+
221+
**In-process** (`HindsightServer`): the server runs in a background thread inside your application. Best when you want the tightest integration and are already managing your own process lifecycle.
222+
223+
```python
224+
from hindsight import HindsightServer, HindsightClient
225+
226+
with HindsightServer(llm_provider="openai", llm_api_key="sk-xxx") as server:
227+
client = HindsightClient(base_url=server.url)
228+
client.retain(bank_id="alice", content="Alice prefers concise answers.")
229+
results = client.recall(bank_id="alice", query="How should I respond to Alice?")
230+
```
231+
232+
**Managed subprocess** (`HindsightEmbedded`): the server runs as a background daemon process, shared across multiple Python processes or sessions. The daemon starts on first use and shuts down automatically after an idle timeout.
233+
234+
```python
235+
from hindsight import HindsightEmbedded
236+
237+
client = HindsightEmbedded(llm_provider="openai", llm_api_key="sk-xxx")
238+
client.retain(bank_id="alice", content="Alice prefers concise answers.")
239+
results = client.recall(bank_id="alice", query="How should I respond to Alice?")
240+
```
241+
242+
See the [Python SDK](../sdks/python.md) for the full API reference.
243+
244+
---
245+
256246
## Next Steps
257247

258248
- [Configuration](./configuration.md) — Environment variables and settings
259-
- [Models](./models.md) — ML models and providers
249+
- [Models](./models.mdx) — ML models and providers
260250
- [Monitoring](./monitoring.md) — Metrics and observability

0 commit comments

Comments
 (0)