Skip to content

fix(hindsight): correct client constructor args and add configurable api_url - #4997

Closed
nils010485 wants to merge 1 commit into
NousResearch:mainfrom
nils010485:fix/hindsight-selfhost-base-url
Closed

fix(hindsight): correct client constructor args and add configurable api_url#4997
nils010485 wants to merge 1 commit into
NousResearch:mainfrom
nils010485:fix/hindsight-selfhost-base-url

Conversation

@nils010485

Copy link
Copy Markdown
Contributor

Summary

Fixes the Hindsight cloud client constructor and adds support for self-hosted instances.

Bug: broken constructor arguments

_make_client() passed api_key as the first positional argument to Hindsight(), but the constructor signature is Hindsight(base_url, api_key=None, timeout=300.0). Cloud mode never worked.

# Before (broken) — api_key lands in base_url parameter
return Hindsight(api_key=self._api_key, timeout=30.0)

# After (fixed) — named parameters, correct order
return Hindsight(base_url=base_url, api_key=self._api_key, timeout=120.0)

Feature: configurable api_url for self-hosted instances

Adds api_url configuration field so users running Hindsight via self-hosted Docker can point to their local instance instead of the default cloud endpoint.

Resolution order: config.jsonHINDSIGHT_API_URL env var → default (https://api.hindsight.vectorize.io)

Changes

plugins/memory/hindsight/__init__.py (9 insertions, 1 deletion):

  • _load_config(): add apiUrl from HINDSIGHT_API_URL env var
  • get_config_schema(): add api_url field with env var hint and default
  • _make_client(): resolve base_url from config → env → default; pass as named arg; timeout 120s

Context

Related to PR #4762 (closed by maintainer). The sequential dispatch fix from that PR was already merged separately as PR #4803. This PR covers the remaining fix: the constructor argument order and self-hosted URL support.

Testing

  • ✅ 124 memory-related tests pass (0 failures)
  • ✅ File compiles without errors
  • ✅ Tested locally with self-hosted Docker Hindsight (localhost:8888) — retain/recall/reflect all functional

…api_url

The Hindsight() constructor expects base_url as the first positional
argument, but _make_client() passed api_key in that position. This made
cloud mode completely non-functional.

Also adds configurable api_url (via config, HINDSIGHT_API_URL env var,
or setup wizard) so self-hosted Docker instances can be used instead of
the default cloud endpoint. Timeout increased from 30s to 120s.

Fixes the remaining issue from PR NousResearch#4762 (sequential dispatch was
already fixed by PR NousResearch#4803).
@nils010485

Copy link
Copy Markdown
Contributor Author

Reviewing with external agents before finalizing

@nils010485 nils010485 closed this Apr 4, 2026
@nils010485
nils010485 deleted the fix/hindsight-selfhost-base-url branch April 27, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant