---
title: "What's new in Hindsight 0.4.21"
description: New features and improvements in Hindsight 0.4.21
authors: [nicoloboschi]
date: 2026-03-30
hide_table_of_contents: true
image: /img/blog/release0421.png
---

Hindsight 0.4.21 adds three new framework integrations (LlamaIndex, AG2, Strands), a Codex CLI integration, delta retain to skip unchanged content, a LiteLLM provider for 100+ LLM backends, native Windows support, audit logging, and a batch of reliability fixes across the board.

<!-- truncate -->

- [**LlamaIndex Integration**](#llamaindex-integration): Persistent memory via BaseToolSpec and BaseMemory.
- [**AG2 Integration**](#ag2-integration): Long-term memory for AG2 multi-agent workflows.
- [**Strands Integration**](#strands-integration): Retain, recall, and reflect tools for Strands agents.
- [**Codex CLI Integration**](#codex-cli-integration): Automatic memory for OpenAI's Codex CLI.
- [**Delta Retain**](#delta-retain): Skip LLM processing for unchanged chunks on upsert.
- [**LiteLLM Provider**](#litellm-provider): Access Bedrock, Azure, and 100+ providers via LiteLLM.
- [**Native Windows Support**](#native-windows-support): Run Hindsight on Windows without Docker.
- [**Audit Logging**](#audit-logging): Track feature usage with built-in audit logs.
- [**MCP Improvements**](#mcp-improvements): Per-user tool filtering and retain strategy selection.

## LlamaIndex Integration

`hindsight-llamaindex` adds persistent memory to [LlamaIndex](https://docs.llamaindex.ai/) agents with two complementary patterns in a single package.

```bash
pip install hindsight-llamaindex
```

**Agent-driven tools** — expose retain/recall/reflect as tools the agent decides when to call:

```python
from hindsight_client import Hindsight
from hindsight_llamaindex import HindsightToolSpec

client = Hindsight(base_url="http://localhost:8888")
spec = HindsightToolSpec(
    client=client,
    bank_id="user-123",
    mission="Track user preferences",
)
tools = spec.to_tool_list()

agent = ReActAgent(tools=tools, llm=OpenAI(model="gpt-4o"))
```

**Automatic memory** — messages are stored on every turn and recalled as context automatically:

```python
from hindsight_llamaindex import HindsightMemory

memory = HindsightMemory.from_client(
    client=client,
    bank_id="user-123",
    mission="Track user preferences and project context",
)

agent = ReActAgent(tools=tools, llm=llm, memory=memory)
```

Both patterns support bank auto-creation via `mission=`, tag-based memory scoping, and both sync and async agents. See the [LlamaIndex integration documentation](/sdks/integrations/llamaindex) for the full API reference.

## AG2 Integration

`hindsight-ag2` brings persistent memory to [AG2](https://ag2.ai/) multi-agent workflows.

```bash
pip install hindsight-ag2
```

```python
from autogen import AssistantAgent, UserProxyAgent, LLMConfig
from hindsight_ag2 import register_hindsight_tools

llm_config = LLMConfig(api_type="openai", model="gpt-4o-mini")

with llm_config:
    assistant = AssistantAgent(
        name="assistant",
        system_message="You are a helpful assistant with long-term memory.",
    )
    user_proxy = UserProxyAgent(
        name="user",
        human_input_mode="NEVER",
    )

# Register Hindsight memory tools on both agents
register_hindsight_tools(
    assistant, user_proxy,
    bank_id="my-bank",
    hindsight_api_url="http://localhost:8888",
)

result = user_proxy.initiate_chat(
    assistant,
    message="Remember that I prefer Python over JavaScript.",
)
```

See the [AG2 integration documentation](/sdks/integrations/ag2) for details.

## Strands Integration

`hindsight-strands` adds retain, recall, and reflect tools to [Strands Agents SDK](https://github.com/strands-agents/sdk-python) agents.

```bash
pip install hindsight-strands
```

```python
from strands import Agent
from hindsight_strands import create_hindsight_tools

tools = create_hindsight_tools(
    bank_id="user-123",
    hindsight_api_url="http://localhost:8888",
)

agent = Agent(tools=tools)
agent("Remember that I prefer dark mode")
agent("What are my preferences?")
```

See the [Strands integration documentation](/sdks/integrations/strands) for the full setup guide.

## Codex CLI Integration

Hindsight now integrates with [OpenAI's Codex CLI](https://github.com/openai/codex). Three Python hook scripts automatically recall relevant context before each prompt and retain conversations after each turn — no changes to your Codex workflow required.

```bash
curl -fsSL https://hindsight.vectorize.io/get-codex | bash
```

The installer guides you through local or cloud mode. Once installed, start a new Codex session and memory is live. See the [Codex integration documentation](/sdks/integrations/codex) for configuration details.

## Delta Retain

Retain now supports **delta mode** — when upserting a document, Hindsight computes content hashes per chunk and skips LLM fact extraction for chunks that haven't changed. Only new or modified chunks go through the extraction pipeline, significantly reducing LLM costs and processing time.

This is particularly impactful for the most common use case: **conversations that get updated in real time**. When an integration retains the full conversation transcript on every turn (as Claude Code, Codex, and most chat integrations do), delta retain means only the new messages trigger fact extraction — previous turns are skipped entirely. The same applies to documents that change incrementally, like codebase files or evolving notes.

Delta mode activates automatically when you retain with a `document_id` that already exists. To force full reingestion of a document, delete it first and retain again.

## LiteLLM Provider

A new `litellm` LLM provider gives Hindsight access to **100+ LLM backends** through [LiteLLM](https://github.com/BerriAI/litellm), including AWS Bedrock, Azure OpenAI, Cohere, Together AI, and many more.

```bash
# Azure OpenAI via LiteLLM
export HINDSIGHT_API_LLM_PROVIDER=litellm
export HINDSIGHT_API_LLM_API_KEY=your-azure-api-key
export HINDSIGHT_API_LLM_MODEL=azure/gpt-4o

# Together AI via LiteLLM
export HINDSIGHT_API_LLM_PROVIDER=litellm
export HINDSIGHT_API_LLM_API_KEY=your-together-api-key
export HINDSIGHT_API_LLM_MODEL=together_ai/meta-llama/Llama-3-70b-chat-hf
```

This complements the existing native providers (OpenAI, Anthropic, Gemini, Groq, etc.) for cases where you need a backend that isn't directly supported. LiteLLM is also available for [embeddings and reranking](/developer/configuration#embeddings). Also new in this release: **Ark and Volcano Engine** providers for ByteDance's Doubao models.

## Native Windows Support

Hindsight now runs natively on Windows without Docker. Install via pip and start the server directly:

```bash
pip install hindsight-all
hindsight-api
```

This uses the embedded PostgreSQL (`pg0`) and local models, same as on macOS and Linux. See the [Windows installation guide](/developer/installation#windows) for details.

## Audit Logging

A new audit log tracks feature usage across your Hindsight deployment. Every retain, recall, and reflect operation is logged with request duration, bank ID, and operation metadata. Query audit logs via the API to understand usage patterns, identify slow operations, and track adoption across teams.

## MCP Improvements

Two additions to the MCP server:

- **Per-user tool filtering** — the new `filter_mcp_tools` hook lets extensions control which MCP tools are visible to each user. Useful for multi-tenant deployments where different users should see different capabilities.
- **Retain strategy selection** — the MCP retain tool now accepts a `strategy` parameter so clients can choose the retain strategy (e.g., `verbose`, `fast`) per call.
- **Stateless HTTP mode** — the MCP server can now be configured for stateless HTTP operation, improving compatibility with Claude Code and other clients that probe the server with GET requests.

## Other Updates

**Improvements**
- OpenClaw logging is now configurable and supports structured output.
- Source fact inclusion in observation search results is now configurable.
- Integrations no longer use hardcoded default models, relying on configured defaults instead.
- Claude Code integration now retains full sessions with document upsert and configurable tags, and records tool calls as structured JSON.
- Per-bank observation limits are now configurable via `max_observations_per_scope`.

**Bug Fixes**
- Per-bank vector index creation now respects the configured vector extension setting.
- Verbose retain extraction now correctly includes the retain mission context.
- Codex integration no longer crashes on startup when the API quota is exhausted (HTTP 429).
- OpenAI embeddings client now correctly parses query parameters included in `base_url`.
- Fixed `tool_choice` handling for Codex and Claude Code when forcing specific tool calls.
- Control plane UI fixes for recall and data viewing.
- Recall responses now include associated metadata.
- Python client `update_bank_config()` now exposes all configurable fields.
- JSON-string tags are now coerced to lists for MemoryItem and MCP tools.
- Docker containers now handle graceful shutdown properly to prevent pg0 data loss on restart.
- Migration runner can now bypass PgBouncer for advisory locks via `MIGRATION_DATABASE_URL`.

## Feedback and Community

Hindsight 0.4.21 is a drop-in replacement for 0.4.x with no breaking changes.

Share your feedback:

- [GitHub Discussions](https://github.com/vectorize-io/hindsight/discussions)
- [GitHub Issues](https://github.com/vectorize-io/hindsight/issues)

For detailed changes, see the [full changelog](/changelog).
