Skip to main content

LlamaIndex integration for Hindsight - persistent memory for AI agents

Project description

hindsight-llamaindex

LlamaIndex integration for Hindsight — persistent long-term memory for AI agents.

Provides two complementary patterns:

  • Tools (HindsightToolSpec) — Agent-driven memory via LlamaIndex's BaseToolSpec. The agent decides when to retain/recall/reflect.
  • Memory (HindsightMemory) — Automatic memory via LlamaIndex's BaseMemory interface. 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.0
  • hindsight-client >= 0.4.0

Documentation

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_llamaindex-0.1.4.tar.gz (184.0 kB view details)

Uploaded Source

Built Distribution

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

hindsight_llamaindex-0.1.4-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file hindsight_llamaindex-0.1.4.tar.gz.

File metadata

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

File hashes

Hashes for hindsight_llamaindex-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5bc1ae7909c38151599feb19cc48108a0fcd102976d06fe53fc4289bc2a5b197
MD5 e6ca83449ed9b397e3dcbbd54d9cca3e
BLAKE2b-256 0eed67abc77f9d76e5019847f25bd51c5d3ef1685442a02058aa17c63ee110b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for hindsight_llamaindex-0.1.4.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_llamaindex-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for hindsight_llamaindex-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a8251839771b16dd0f364c20d78e2e0a17c2a330c822dfad730e35159418236b
MD5 3b934902a1446f400274ad4e4a136f9b
BLAKE2b-256 be706d67c61cdc26374dd8bcc24ffc1edc2d81ad7f31e5bf58357d3e455c8ae6

See more details on using hashes here.

Provenance

The following attestation bundles were made for hindsight_llamaindex-0.1.4-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