Compare commits

...
Author SHA1 Message Date
Ben a5d6b7cc90 docs(superagent): default the quick start to Hindsight Cloud
Drop the explicit localhost URL so the example uses the package's
default Cloud endpoint (https://api.hindsight.vectorize.io), add
HINDSIGHT_API_KEY to the prerequisites, and show self-hosting as the
opt-in alternative.
2026-06-11 09:38:17 -04:00
Ben 32e421d3a5 docs(superagent): add prerequisites to integration quick start
The quick-start example calls Superagent guard/redact on the first
retain (both on by default), so it fails immediately without the
required keys. The page documented none of them. Add a Prerequisites
section covering SUPERAGENT_API_KEY and OPENAI_API_KEY, clarify the
hindsight_api_url endpoint (self-hosted vs Cloud), and note that
Superagent's hosted guard-model endpoints are currently unreliable.
2026-06-11 09:25:31 -04:00
+23 -2
View File
@@ -17,13 +17,30 @@ Safety middleware for [Hindsight](https://vectorize.io/hindsight) memory operati
pip install hindsight-superagent
```
### Prerequisites
Guard and Redact run on every `retain` by default, so the example below calls Superagent (and the LLM behind your guard/redact models) before anything is stored. Set these keys as environment variables first:
| Variable | Purpose |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `HINDSIGHT_API_KEY` | Authenticates your Hindsight Cloud workspace. [Sign up free](https://ui.hindsight.vectorize.io/signup) to grab one. |
| `SUPERAGENT_API_KEY` | Authenticates Superagent's guard/redact calls. [Get one at superagent.sh](https://www.superagent.sh). |
| `OPENAI_API_KEY` | Backs the `guard_model` / `redact_model` (e.g. `openai/gpt-4.1-nano`). Any [supported LLM provider](https://docs.superagent.sh/sdk) works. |
```bash
export HINDSIGHT_API_KEY=hs-...
export SUPERAGENT_API_KEY=sa-...
export OPENAI_API_KEY=sk-...
```
`SafeHindsight` connects to [Hindsight Cloud](https://ui.hindsight.vectorize.io/signup) (`https://api.hindsight.vectorize.io`) by default, using `HINDSIGHT_API_KEY`. To target a [self-hosted server](https://hindsight.vectorize.io/developer/installation) instead, pass `hindsight_api_url="http://localhost:8888"`.
```python
import asyncio
from hindsight_superagent import SafeHindsight
safe = SafeHindsight(
bank_id="user-123",
hindsight_api_url="http://localhost:8888",
bank_id="user-123", # connects to Hindsight Cloud by default
guard_model="openai/gpt-4.1-nano",
redact_model="openai/gpt-4.1-nano",
)
@@ -36,6 +53,10 @@ async def main():
asyncio.run(main())
```
:::note Hosted guard models
Superagent's hosted endpoints for its guard models are currently unreliable. The guard models are open-weight (`superagent/guard-0.6b`, `guard-1.7b`, `guard-4b`) and can be [self-hosted](https://docs.superagent.sh/sdk/models) via Ollama or vLLM.
:::
## Features
- **Guard on Retain** — blocks prompt injection attacks before content is stored in memory