Skip to content

[Integration]: Governance-aware agent memory with Hindsight #320

Description

@nagasatish007

Summary

Hindsight provides agent memory that works like human memory — with importance-based retention, forgetting curves, and contextual recall. TealTiger governance decisions are a natural fit for Hindsight's memory system: governance events have varying importance, should decay over time, and need to be recallable during future decisions.

Why this integration?

Currently, TealTiger governance decisions are either in-memory (lost on restart) or persisted in flat storage. Hindsight adds intelligence to governance memory:

  • Importance-based retention — DENY decisions (high risk) persist longer than routine ALLOWs
  • Contextual recall — "What governance decisions were made for this agent in similar contexts?"
  • Forgetting curves — Old, low-importance approvals naturally age out
  • Pattern detection — Recall clusters of denials to detect systematic policy violations

Proposed approach

  1. HindsightGovernanceMemory — stores TealTiger decisions in Hindsight with importance scoring
  2. Decision importance mapping: DENY=0.95, ALLOW=0.60, MONITOR=0.70 (mirrors Dakera pattern)
  3. Contextual governance recall — before making a new decision, recall similar past decisions
  4. Anomaly detection — flag when an agent's denial rate spikes vs. historical baseline

Example usage

from hindsight import HindsightClient
from tealtiger.integrations.hindsight import HindsightGovernanceMemory

hindsight = HindsightClient(api_key="your-key")

governance_memory = HindsightGovernanceMemory(
    client=hindsight,
    importance_map={
        "deny": 0.95,
        "allow": 0.60,
        "monitor": 0.70,
    },
)

# Every governance decision is stored with importance-weighted retention
client = TealOpenAI(
    api_key=os.getenv("OPENAI_API_KEY"),
    guardrails={"pii_detection": True},
    on_decision=governance_memory.store,
)

# Later: recall governance history for context
history = governance_memory.recall(
    agent_id="research-agent",
    context="tool call to web_search",
    limit=5,
)

Deliverables

  • tealtiger.integrations.hindsight module
  • HindsightGovernanceMemory class implementing importance-weighted storage
  • Contextual recall for governance-aware decision making
  • Example: agent that learns from past governance denials
  • PR to Hindsight cookbook showing TealTiger integration

Links

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Backlog
Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions