Git Analytics AI AgentAI Agent
vectorize-io/hindsight

Hindsight — ระบบ Memory สำหรับ AI Agent ที่เรียนรู้ได้Hindsight — Agent Memory System That Learns Over Time

AI AgentAI Agent 60,085 ดาวStars 7,353 Python MIT อัปเดตล่าสุดLast push 10 พ.ย. 256910 Nov 2026
vectorize-io/hindsight

Hindsight เป็นระบบ long-term memory สำหรับ AI agent ที่เน้นการเรียนรู้จากบทสนทนา ไม่ใช่แค่จำประวัติ chat โดยทำผลงานบน LongMemEval benchmark ได้สูงสุดในระบบ memory ที่เคยทดสอบ รองรับ LLM provider กว่า 25 ราย และมี integration สำเร็จรูปกว่า 60 ตัว

Hindsight is a long-term memory system for AI agents focused on learning from conversations, not just recalling chat history. It achieves state-of-the-art accuracy on the LongMemEval benchmark, supports 25+ LLM providers, and offers 60+ ready-made integrations.

ไว้ทำอะไร

ปัญหาหลักที่ Hindsight แก้คือ AI agent ส่วนใหญ่ไม่มีความจำข้ามเซสชัน — พอเริ่ม conversation ใหม่ก็ลืมทุกอย่าง เทคนิคแบบ RAG หรือ knowledge graph มีข้อจำกัดด้าน accuracy ในงาน long-term memory Hindsight ออกแบบมาให้ agent 'เรียนรู้' จากข้อมูลที่เคยรับเข้ามา สร้าง mental model, knowledge page และ decision model จากบทสนทนา แล้วนำมาใช้ตอบคำถามหรือตัดสินใจได้แม่นยำขึ้น ใช้งานได้ตั้งแต่ chatbot ส่วนตัว, coding agent ไปจนถึงระบบ enterprise ขนาดใหญ่

ทำงานอย่างไร

Hindsight มี 3 operation หลัก: Retain (เก็บข้อมูลเข้า memory bank), Recall (ค้นหา memory ที่เกี่ยวข้องกับ query) และ Reflect (สร้างคำตอบที่คำนึงถึง context จาก memory) ข้อมูลที่ retain เข้าไปจะถูกแปลงเป็น observations แล้วสังเคราะห์เป็น mental model และ knowledge page โดยอัตโนมัติ ทำให้ระบบไม่ได้แค่เก็บ raw text แต่สร้างความเข้าใจเชิงโครงสร้างจากข้อมูลที่สะสม

Core API เป็น Python (FastAPI + asyncpg) เก็บข้อมูลใน PostgreSQL โดยมี embedded mode ที่ bundle PostgreSQL มาในตัว (pg0) ไม่ต้อง setup database แยก สำหรับ inference ใช้ LLM จาก provider ที่เลือก (OpenAI, Anthropic, Gemini, Ollama ฯลฯ) ผ่าน LiteLLM เป็น abstraction layer

Client SDK มีให้ทั้ง Python, TypeScript, Go และ Rust พร้อม CLI ที่เขียนด้วย Rust สำหรับ integration แบบง่ายสุดคือใช้ LLM Wrapper ที่ wrap OpenAI/Anthropic client เดิมด้วยโค้ดแค่ 2 บรรทัด ระบบจะ retain/recall อัตโนมัติทุกครั้งที่เรียก LLM

Control plane เป็น Next.js App Router + Tailwind + shadcn/ui ใช้เป็น dashboard สำหรับจัดการ memory bank, ดู observations และ knowledge page ที่ระบบสร้างขึ้น

โครงสร้างโค้ด

  • hindsight-api/ — Core API server เขียนด้วย FastAPI (Python) เป็นหัวใจหลักของระบบ
  • hindsight-api-slim/ — API server เวอร์ชัน slim สำหรับ platform ที่มีข้อจำกัด (เช่น Intel Mac)
  • hindsight-all/ — Embedded package รวม server + embedded PostgreSQL ใช้งานได้โดยไม่ต้อง setup แยก
  • hindsight-all-npm/ — Embedded package สำหรับ Node.js/TypeScript
  • hindsight-clients/ — SDK สำหรับ Python, TypeScript, Go และ Rust
  • hindsight-cli/ — CLI tool เขียนด้วย Rust สำหรับใช้งานผ่าน terminal
  • hindsight-control-plane/ — Dashboard UI เป็น Next.js App Router + shadcn/ui
  • hindsight-mcp-server/ — MCP server สำหรับ integrate กับ coding agent เช่น Claude Code, Cursor
  • hindsight-embed/ — Embedding component สำหรับ vector representation
  • hindsight-dev/ — Development tools และ benchmarks
  • docker/ — Docker Compose config และ standalone Dockerfile
  • helm/ — Helm chart สำหรับ deploy บน Kubernetes
  • cookbook/ — ตัวอย่างการใช้งานและ recipes

เริ่มใช้งาน

# 1. Start server with Docker
export OPENAI_API_KEY=sk-xxx

docker run -it --pull always --name hindsight --restart unless-stopped \
  -p 8888:8888 -p 9999:9999 \
  -e HINDSIGHT_API_LLM_API_KEY=$OPENAI_API_KEY \
  -v hindsight-data:/home/hindsight/.pg0 \
  ghcr.io/vectorize-io/hindsight:latest

# 2. Install Python client
pip install hindsight-client -U
from hindsight_client import Hindsight

client = Hindsight(base_url="http://localhost:8888")

# Retain: Store information
client.retain(bank_id="my-bank", content="Alice works at Google as a software engineer")

# Recall: Search memories
client.recall(bank_id="my-bank", query="What does Alice do?")

# Reflect: Generate disposition-aware response
client.reflect(bank_id="my-bank", query="Tell me about Alice")

เหมาะกับงานแบบไหน

  • เพิ่ม long-term memory ให้ chatbot หรือ AI assistant — จำข้อมูลผู้ใช้ข้ามเซสชันได้
  • ให้ coding agent (Claude Code, Cursor, Copilot) จำ context ของโปรเจกต์และ preference ของ developer
  • สร้าง personalized AI ที่เรียนรู้พฤติกรรมและความชอบของผู้ใช้แต่ละคนผ่าน memory bank แยก
  • ใช้เป็น memory layer ใน multi-agent system — agent หลายตัวแชร์ knowledge ผ่าน memory bank เดียวกัน
  • Enterprise knowledge management — เก็บและสังเคราะห์ข้อมูลจากบทสนทนาภายในองค์กร

ข้อควรรู้

  • ต้องมี LLM API key (OpenAI, Anthropic ฯลฯ) สำหรับ inference — ไม่สามารถทำงานได้โดยไม่มี LLM เลย แม้จะรองรับ local model ผ่าน Ollama ได้
  • License MIT — ใช้งานเชิงพาณิชย์ได้อิสระ แต่ชื่อ Hindsight™ เป็น trademark
  • Embedded mode (pg0) เหมาะสำหรับ development และ single-instance — production ควรใช้ external PostgreSQL
  • Intel Mac (x86_64) ต้องใช้ slim variant แทน full package
  • Self-hosted ต้องดูแล PostgreSQL และ update เอง — Hindsight Cloud เป็นทางเลือก managed แต่มีค่าใช้จ่ายตาม usage

What it is for

Most AI agents have no memory across sessions — each new conversation starts from scratch. Techniques like RAG and knowledge graphs have limited accuracy for long-term memory tasks. Hindsight is designed to make agents truly learn from past interactions by building mental models, knowledge pages, and decision models from conversations, enabling more accurate responses and decisions over time. It serves use cases from personal chatbots and coding agents to large-scale enterprise systems.

How it works

Hindsight has three core operations: Retain (store information into a memory bank), Recall (search memories relevant to a query), and Reflect (generate a disposition-aware response using memory context). Retained data is automatically transformed into observations, then synthesized into mental models and knowledge pages — structured understanding built from accumulated data, not just raw text storage.

The core API is Python (FastAPI + asyncpg) backed by PostgreSQL, with an embedded mode that bundles PostgreSQL (pg0) so no separate database setup is needed. For inference, it uses the configured LLM provider (OpenAI, Anthropic, Gemini, Ollama, etc.) through LiteLLM as an abstraction layer.

Client SDKs are available for Python, TypeScript, Go, and Rust, plus a Rust-based CLI. The simplest integration path is the LLM Wrapper, which wraps an existing OpenAI/Anthropic client in 2 lines of code — retain and recall happen automatically on every LLM call.

The control plane is a Next.js App Router + Tailwind + shadcn/ui dashboard for managing memory banks and inspecting observations and knowledge pages.

Code structure

  • hindsight-api/ — Core API server built with FastAPI (Python), the system's main engine
  • hindsight-api-slim/ — Slim API server variant for constrained platforms (e.g. Intel Mac)
  • hindsight-all/ — Embedded package bundling server + embedded PostgreSQL, no external setup needed
  • hindsight-all-npm/ — Embedded package for Node.js/TypeScript
  • hindsight-clients/ — SDKs for Python, TypeScript, Go, and Rust
  • hindsight-cli/ — Rust-based CLI tool for terminal usage
  • hindsight-control-plane/ — Dashboard UI built with Next.js App Router + shadcn/ui
  • hindsight-mcp-server/ — MCP server for coding agent integration (Claude Code, Cursor, etc.)
  • hindsight-embed/ — Embedding component for vector representation
  • hindsight-dev/ — Development tools and benchmarks
  • docker/ — Docker Compose configs and standalone Dockerfile
  • helm/ — Helm chart for Kubernetes deployment
  • cookbook/ — Usage examples and recipes

Getting started

# 1. Start server with Docker
export OPENAI_API_KEY=sk-xxx

docker run -it --pull always --name hindsight --restart unless-stopped \
  -p 8888:8888 -p 9999:9999 \
  -e HINDSIGHT_API_LLM_API_KEY=$OPENAI_API_KEY \
  -v hindsight-data:/home/hindsight/.pg0 \
  ghcr.io/vectorize-io/hindsight:latest

# 2. Install Python client
pip install hindsight-client -U
from hindsight_client import Hindsight

client = Hindsight(base_url="http://localhost:8888")

# Retain: Store information
client.retain(bank_id="my-bank", content="Alice works at Google as a software engineer")

# Recall: Search memories
client.recall(bank_id="my-bank", query="What does Alice do?")

# Reflect: Generate disposition-aware response
client.reflect(bank_id="my-bank", query="Tell me about Alice")

Good fit for

  • Add long-term memory to chatbots or AI assistants — remember user information across sessions
  • Give coding agents (Claude Code, Cursor, Copilot) persistent project context and developer preferences
  • Build personalized AI that learns individual user behavior and preferences via separate memory banks
  • Use as a memory layer in multi-agent systems — multiple agents share knowledge through the same memory bank
  • Enterprise knowledge management — store and synthesize information from organizational conversations

Things to know

  • Requires an LLM API key (OpenAI, Anthropic, etc.) for inference — cannot operate without an LLM, though local models via Ollama are supported
  • MIT licensed — free for commercial use, but Hindsight™ is a trademark
  • Embedded mode (pg0) suits development and single-instance use — production should use external PostgreSQL
  • Intel Mac (x86_64) requires the slim variant instead of the full package
  • Self-hosted deployments require managing PostgreSQL and updates — Hindsight Cloud is a managed alternative with usage-based billing

บทวิเคราะห์นี้สร้างจาก README และโค้ดของ repo โดย AI ของ Oneable — ตรวจสอบ license และเอกสารต้นทางก่อนนำไปใช้งานจริงThis breakdown was generated from the repository's README and code by Oneable's AI — check the license and upstream docs before using it in production.

#agentic-ai#agents#ai-memory#memory

repo อื่นในหมวดเดียวกันMore in this category

ไปที่เพจ FacebookOpen Facebook page">