{
 "schema_version": 1,
 "generated": "2026-10-25",
 "id": "vectorize-io-hindsight--add-long-term-memory-to-your-agent-in-two-lines",
 "repo": "vectorize-io/hindsight",
 "repo_url": "https://github.com/vectorize-io/hindsight",
 "repo_slug": "vectorize-io-hindsight",
 "title": "Add long-term memory to an existing chatbot in two lines",
 "page_title": "How to add long-term memory to an existing chatbot in two lines with Hindsight",
 "summary": "Wrap your OpenAI client so memories are recalled before each call and stored after it.",
 "who": "A developer whose assistant forgets the user between sessions.",
 "problem": "Hand-rolling memory means deciding what to store, when to search, and how to inject it.",
 "outcome": "The same chat code, now recalling relevant memories per user bank and saving new ones automatically.",
 "steps": [
  "Start a Hindsight server, for example with the Docker command from the README on ports 8888 and 9999",
  "Install the wrapper: `pip install hindsight-litellm`",
  "Import it with `from hindsight_litellm import wrap_openai` and wrap your OpenAI client, passing a bank_id per user and hindsight_api_url for a self-hosted server (http://localhost:8888)",
  "Call `client.chat.completions.create` as before; use `wrap_anthropic()` for the Anthropic SDK"
 ],
 "agent_prompt": "Add vectorize-io/hindsight memory to my chatbot in <file> using the LLM wrapper against a local server, one bank per user id, and show me a two-session test where the second session remembers a fact from the first.",
 "agents": [
  "any"
 ],
 "difficulty": "Beginner",
 "time": "20 minutes",
 "basis": "readme",
 "caveat": "",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Docker, pip or Kubernetes",
  "An LLM API key (OpenAI in the quick start)",
  "Python, Node.js or Go for the client"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "The server holds your LLM key in its environment; do not expose it publicly without auth."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/vectorize-io-hindsight/add-long-term-memory-to-your-agent-in-two-lines/",
 "md": "https://dedupedai.com/use-cases/vectorize-io-hindsight/add-long-term-memory-to-your-agent-in-two-lines/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/vectorize-io-hindsight--add-long-term-memory-to-your-agent-in-two-lines.json",
 "api_version": "v1"
}
