fleet-memory/hindsight-docs/docs/developer/index.md
Nicolò Boschi 3e72984cd2 chunks
2025-11-29 16:34:13 +01:00

4.3 KiB

sidebar_position slug
1 /

Overview

Why Hindsight?

AI assistants forget everything between sessions. Every conversation starts from zero—no context about who you are, what you've discussed, or what the memory bank has learned. This isn't just inconvenient; it fundamentally limits what AI memory banks can do.

The problem is harder than it looks:

  • Simple vector search isn't enough — "What did Alice do last spring?" requires temporal reasoning, not just semantic similarity
  • Facts get disconnected — Knowing "Alice works at Google" and "Google is in Mountain View" should let you answer "Where does Alice work?" even if you never stored that directly
  • Memory banks need opinions — A coding assistant that remembers "the user prefers functional programming" should weigh that when making recommendations
  • Context matters — The same information means different things to different memory banks with different personalities

Hindsight solves these problems with a memory system designed specifically for AI memory banks.

What Hindsight Does

graph TB
    subgraph Your Application
        Agent[AI Agent]
    end

    subgraph Hindsight
        API[Hindsight API]

        subgraph Memory Bank
            Documents[Documents]
            Memories[Memories]
            Entities[Entities]
        end
    end

    Agent -->|retain| API
    Agent -->|recall| API
    Agent -->|reflect| API

    API --> Documents
    API --> Memories
    API --> Entities

Your AI agent stores information via retain(), searches with recall(), and reasons with reflect() — all interactions with its dedicated memory bank

Key Components

Three Memory Types

Hindsight separates memories by type for epistemic clarity:

Type What it stores Example
World Objective facts received "Alice works at Google"
Bank Bank's own actions "I recommended Python to Bob"
Opinion Formed beliefs + confidence "Python is best for ML" (0.85)

Multi-Strategy Retrieval (TEMPR)

Four search strategies run in parallel:

graph LR
    Q[Query] --> S[Semantic]
    Q --> K[Keyword]
    Q --> G[Graph]
    Q --> T[Temporal]

    S --> RRF[RRF Fusion]
    K --> RRF
    G --> RRF
    T --> RRF

    RRF --> CE[Cross-Encoder]
    CE --> R[Results]
Strategy Best for
Semantic Conceptual similarity, paraphrasing
Keyword (BM25) Names, technical terms, exact matches
Graph Related entities, indirect connections
Temporal "last spring", "in June", time ranges

Personality Framework (CARA)

Memory banks have Big Five personality traits that influence opinion formation:

Trait Low High
Openness Prefers proven methods Embraces new ideas
Conscientiousness Flexible, spontaneous Systematic, organized
Extraversion Independent Collaborative
Agreeableness Direct, analytical Diplomatic, harmonious
Neuroticism Calm, optimistic Risk-aware, cautious

The bias_strength parameter (0-1) controls how much personality influences opinions.

Next Steps

Getting Started

Core Concepts

  • Retain — How memories are stored with multi-dimensional facts
  • Recall — How TEMPR's 4-way search retrieves memories
  • Reflect — How personality influences reasoning and opinion formation

API Methods

  • Retain — Store information in memory banks
  • Recall — Search and retrieve memories
  • Reflect — Reason with personality
  • Memory Banks — Configure personality and background
  • Entities — Track people, places, and concepts
  • Documents — Manage document sources
  • Operations — Monitor async tasks

Deployment