How varshith4611c/hindsight works
Hindsight is a long-term memory system for AI agents, exposing retain, recall, and reflect operations through an API and client libraries. The documented main workflow sends agent information to retain, searches it with recall, and generates disposition-aware responses with reflect. Internally, retention extracts facts and persists memory; recall retrieves relevant memories; reflection builds on memory for a response. The README also documents banks, knowledge pages, mental models, integrations, and multiple LLM providers. Several subsystem links are documented rather than verified from sampled implementation, so those edges are marked dashed.
Main entry points: http.py HTTP API · orchestrator.py Retain Orchestrator · writes.py Memory Store · fact_storage.py Fact & Chunk Storage
Components 19
Agent Interfaces
- Client Libraries
hindsight-clients/python/hindsight_client/hindsight_client.py - Agent Integrations
hindsight-integrations - CLI
hindsight-cli/src/main.rs
API Operations
- HTTP API
hindsight-api-slim/hindsight_api/api/http.py - Memory Banks
hindsight-api-slim/hindsight_api/models.py - Webhooks
hindsight-api-slim/hindsight_api/webhooks/manager.py
Memory Engine
- Retain Orchestrator
hindsight-api-slim/hindsight_api/engine/retain/orchestrator.py - Fact Extraction
hindsight-api-slim/hindsight_api/engine/retain/fact_extraction.py - Fact & Chunk Storage
hindsight-api-slim/hindsight_api/engine/retain/fact_storage.py - Recall Retrieval
hindsight-api-slim/hindsight_api/engine/search/retrieval.py - Reflect Agent
hindsight-api-slim/hindsight_api/engine/reflect/agent.py - Mental Models
hindsight-api-slim/hindsight_api/engine/mental_model_refresh.py - Knowledge Pages
hindsight-api-slim/hindsight_api/engine/transfer/importer.py - Memory Engine
hindsight-api-slim/hindsight_api/engine/memory_engine.py - Graph Maintenance
hindsight-api-slim/hindsight_api/engine/graph_maintenance.py
Persistence & Providers
- Memory Store
hindsight-api-slim/hindsight_api/engine/memories/pg/writes.py - Database Access
hindsight-api-slim/hindsight_api/engine/db/base.py - LLM Providers
hindsight-api-slim/hindsight_api/engine/llm_wrapper.py
Other components
- AI Agent
Connections 22
- AI Agent → Client Libraries: uses
README.md - AI Agent → Agent Integrations: connects through
README.md - AI Agent → CLI: operates via
README.md - Client Libraries → HTTP API: calls API
README.md - CLI → HTTP API: calls API
hindsight-cli/src/main.rs - HTTP API → Retain Orchestrator: dispatches retain
- HTTP API → Recall Retrieval: dispatches recall
- HTTP API → Reflect Agent: dispatches reflect
- HTTP API → Memory Banks: manages banks
README.md - HTTP API → Mental Models: serves models
README.md - HTTP API → Knowledge Pages: serves pages
README.md - Retain Orchestrator → Fact Extraction: extracts facts
- Retain Orchestrator → Fact & Chunk Storage: stores content
- Fact & Chunk Storage → Memory Store: inserts facts
hindsight-api-slim/hindsight_api/engine/retain/fact_storage.py - Fact & Chunk Storage → Graph Maintenance: queues relinking
hindsight-api-slim/hindsight_api/engine/retain/fact_storage.py - Recall Retrieval → Memory Store: retrieves memories
- Reflect Agent → Recall Retrieval: uses recall
README.md - Retain Orchestrator → LLM Providers: requests extraction
- Reflect Agent → LLM Providers: generates response
- Memory Engine → Memory Store: coordinates storage
- Memory Store → Database Access: reads and writes
- Webhooks → Database Access: stores deliveries
hindsight-api-slim/hindsight_api/webhooks/manager.py