Skip to main content

OpenHands integration for Hindsight - persistent long-term memory via MCP

Project description

hindsight-openhands

Long-term memory for OpenHands (formerly OpenDevin), powered by Hindsight.

hindsight-openhands init wires the Hindsight MCP server into OpenHands' config.toml and adds a recall/retain rule to your project's AGENTS.md. The agent then has recall / retain / reflect tools and — guided by the rule — recalls relevant memory at the start of a task and retains durable facts as it works.

How it works

OpenHands has native Streamable-HTTP MCP support, so the Hindsight MCP endpoint connects directly (no bridge):

[mcp]
shttp_servers = [
    {url = "https://api.hindsight.vectorize.io/mcp/my-project/", api_key = "hsk_..."}
]

OpenHands also loads AGENTS.md (and repo microagents) into the agent's context on every task — that's where the recall/retain rule lives.

Install

pip install hindsight-openhands
cd your-project
hindsight-openhands init --api-token YOUR_HINDSIGHT_API_KEY --bank-id my-project

init merges the [mcp] entry into ./config.toml and writes the rule into ./AGENTS.md. Use Hindsight Cloud, or a self-hosted server with --api-url http://localhost:8888 (no token needed for an open local server).

If config.toml can't be parsed safely, init prints the exact [mcp] snippet to paste instead of touching the file. hindsight-openhands init --print-only shows the snippet + rule anytime.

Running the OpenHands Docker app?

The containerized OpenHands app loads MCP servers from its UI settings, not from a project config.toml. So add the server in Settings → MCP as a Streamable HTTP server (not SSE — Hindsight's endpoint is streamable HTTP):

  • URL: http://host.docker.internal:8888/mcp/<bank>/ (use host.docker.internal, not localhost, so the container can reach a Hindsight server on your host; launch the app with --add-host host.docker.internal:host-gateway)
  • API key: your hsk_... for Cloud, or none for an open local server

The MCP tools load when a conversation starts. The AGENTS.md rule still applies when you open the project as a repository.

Commands

Command Description
hindsight-openhands init Add the MCP server + recall/retain rule
hindsight-openhands status Show whether the server + rule are configured
hindsight-openhands uninstall Remove the server + rule

Configuration

Setting Env var Default
API URL HINDSIGHT_API_URL https://api.hindsight.vectorize.io
API token HINDSIGHT_API_TOKEN (none; required for Cloud)
Bank id HINDSIGHT_OPENHANDS_BANK_ID openhands

Development

uv sync
uv run pytest tests -v -m 'not requires_real_llm'   # deterministic suite
uv run pytest tests -v -m requires_real_llm          # gated MCP-endpoint check

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hindsight_openhands-0.1.1.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hindsight_openhands-0.1.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file hindsight_openhands-0.1.1.tar.gz.

File metadata

  • Download URL: hindsight_openhands-0.1.1.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hindsight_openhands-0.1.1.tar.gz
Algorithm Hash digest
SHA256 682436c6f985f82849b6d40cd16985b08ea375155b99410831657d385e48dfc3
MD5 a9c9ad2d9001342b4ad86d46eba8b869
BLAKE2b-256 7a8af23cddd019c2ac3bcd78c249785ae45e4bc6bdecd13b5bd3e35702d3bb36

See more details on using hashes here.

Provenance

The following attestation bundles were made for hindsight_openhands-0.1.1.tar.gz:

Publisher: release-integration.yml on vectorize-io/hindsight

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hindsight_openhands-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for hindsight_openhands-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3185e2a31f18145810933934afe809cb9f9d844bf40ebd2a69b5024d1fdf3e26
MD5 e357fcabfbb7a9b87fd6067c4c569b6e
BLAKE2b-256 c0fbcaf262c6473d6096402f7176682edf5e5c15370ec79df4e8803591689a4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for hindsight_openhands-0.1.1-py3-none-any.whl:

Publisher: release-integration.yml on vectorize-io/hindsight

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page