* fix: add PEP 561 py.typed marker to all Python packages Add empty py.typed marker files to all 13 Python packages that were missing them. Only hindsight-integrations/autogen already had one. Per PEP 561, packages that wish to support type checking must include a py.typed marker file. Without it, type checkers (mypy, pyright) treat the package as untyped and skip all inline type annotations. Fixes #965 * fix: ensure py.typed markers survive client regeneration Add touch commands in generate-clients.sh to recreate PEP 561 py.typed marker files after the OpenAPI generator runs, since the script deletes and regenerates the hindsight_client_api directory. --------- Co-authored-by: r266-tech <r266-tech@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| hindsight_llamaindex | ||
| tests | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
hindsight-llamaindex
LlamaIndex integration for Hindsight — persistent long-term memory for AI agents.
Provides two complementary patterns:
- Tools (
HindsightToolSpec) — Agent-driven memory via LlamaIndex'sBaseToolSpec. The agent decides when to retain/recall/reflect. - Memory (
HindsightMemory) — Automatic memory via LlamaIndex'sBaseMemoryinterface. Messages are stored on every turn and recalled as context.
Installation
pip install hindsight-llamaindex
Quick Start: Agent Tools
import asyncio
from hindsight_client import Hindsight
from hindsight_llamaindex import HindsightToolSpec
from llama_index.llms.openai import OpenAI
from llama_index.core.agent import ReActAgent
async def main():
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"))
response = await agent.run("Remember that I prefer dark mode")
print(response)
asyncio.run(main())
Quick Start: Automatic Memory
from hindsight_client import Hindsight
from hindsight_llamaindex import HindsightMemory
client = Hindsight(base_url="http://localhost:8888")
memory = HindsightMemory.from_client(
client=client,
bank_id="user-123",
mission="Track user preferences",
)
agent = ReActAgent(tools=tools, llm=llm, memory=memory)
Configuration
from hindsight_llamaindex import configure
configure(
hindsight_api_url="http://localhost:8888",
api_key="your-api-key",
budget="mid",
tags=["source:llamaindex"],
context="my-app",
mission="Track user preferences",
)
Requirements
- Python 3.10+
llama-index-core >= 0.11.0hindsight-client >= 0.4.0