feat: add AutoGen integration for Hindsight#719
Conversation
Adds hindsight-autogen package providing FunctionTool instances that give AutoGen agents persistent long-term memory via retain/recall/reflect APIs. - Package: hindsight_autogen with create_hindsight_tools() factory - 31 unit tests covering tool creation, invocation, config fallback, errors - Docs page and integrations.json entry - README with quickstart and configuration reference Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix install instructions to include autogen-agentchat and autogen-ext[openai] - Add autogen.svg icon to prevent broken image in integrations grid - Change icon reference from .png to .svg in integrations.json Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a653149 to
c2bf3c7
Compare
- Add time.sleep(3) between retain and recall to wait for async processing - Close Hindsight client and model client to avoid unclosed session warnings Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
time.sleep blocks the event loop; asyncio.sleep yields control. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
nicoloboschi
left a comment
There was a problem hiding this comment.
Review
Overall: Clean, well-structured integration with good test coverage. A few issues worth addressing before merge:
Must Fix
1. release-integration.sh needs updating
The release script must be made aware of this new integration so it gets published alongside the others.
2. verbose config field is unused
HindsightAutoGenConfig.verbose is declared but never read by any tool function. Either wire it into the tool logging or remove it.
3. Hardcoded defaults scattered across multiple locations
"mid", 4096, "any" appear as fallback defaults in both config.py and tools.py. If the defaults drift, behavior becomes inconsistent. Centralize them as constants or always require config.
4. No validation on enum-like fields
budget accepts any string — no check that it's low/mid/high. Same for recall_tags_match (any/all/any_strict/all_strict). A typo like "medium" would silently pass through and fail at the API level.
5. asyncio.sleep(3) in docs/README
The Quick Start shows await asyncio.sleep(3) after retain with the comment "Wait for Hindsight to finish processing." This is a fragile magic number — it'll confuse users and fail for larger documents. Either document this limitation clearly or provide a polling helper.
6. Missing ruff config in pyproject.toml
The other Python packages in the repo use ruff with line-length = 120. This package has no [tool.ruff] section, so it'll use ruff defaults (88 chars). Should align with the rest of the monorepo.
Minor / Nits
Optionalfromtypingis used alongside nativelist[str]syntax — pick one style. Sincerequires-python = ">=3.10", nativestr | Noneis fine everywhere.errors.pydefinesHindsightErrorbut tool functions catch broadExceptionand re-wrap — consider catchinghttpx/ client-specific errors instead so programming errors (e.g.,TypeError) aren't swallowed._client.pyhardcodestimeout=30.0— should this be configurable or at least match the default inhindsight-client?- No
py.typedmarker for PEP 561 type checking support.
Looks Good
- Async-native design matches AutoGen's runtime correctly
FunctionToolusage is idiomatic for AutoGen- Test coverage is thorough (31 tests covering tools, config fallbacks, error paths)
- Tool descriptions are clear and will guide LLM tool selection well
- Selective tool inclusion (
include_retain/recall/reflect) is a nice touch - Docs page and
integrations.jsonentry included
- Add autogen to VALID_INTEGRATIONS in release-integration.sh - Remove unused verbose config field - Extract DEFAULT_BUDGET/MAX_TOKENS/RECALL_TAGS_MATCH constants in config.py, import from tools.py to eliminate default duplication - Add Literal types for budget and recall_tags_match validation - Modernize type hints to X | None with from __future__ import annotations - Add [tool.ruff] line-length = 120 to match monorepo convention - Add py.typed PEP 561 marker - Re-raise HindsightError before broad Exception catch - Expand asyncio.sleep(3) comment explaining when/why it's needed - Remove verbose from docs configure() reference table Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
autogen.md (PR vectorize-io#719) was added after the SEO check (PR vectorize-io#787) without required title and description frontmatter, causing verify-generated-files CI to fail on all branches.
The autogen integration was added to current docs (via PR vectorize-io#719) but not to the versioned v0.4 docs, causing a broken link from the /integrations page to /sdks/integrations/autogen during docusaurus build.
Summary
hindsight-autogenpackage providing AutoGenFunctionToolinstances for persistent long-term memorycreate_hindsight_tools()returns retain/recall/reflect tools compatible withAssistantAgent(tools=[...])aretain/arecall/areflectdirectly in AutoGen's async runtimeconfigure()with per-call overridesTest plan
uv run pytest tests/ -v)🤖 Generated with Claude Code