# AgentKeeper

A memory infrastructure library for long-running AI agents that keeps identity and facts consistent across model switches, crashes, and context limits.

AgentKeeper is cognitive-continuity infrastructure for AI agents, aimed at keeping an agent's state, priorities, and identity stable across model switches, crashes, and restarts. Core principles and constraints are protected from every compression pass and re-injected into every reconstructed context regardless of token budget.

Stored memory is reconstructed in the format each backing model expects, such as XML for Claude, labelled sections for GPT-4, prose for Gemini, or terse tokens for Ollama, so switching providers does not lose memory or identity. Facts and relationship triples can carry a time-to-live so they expire automatically, and a graph-traversal API finds related facts across multiple hops.

It installs from PyPI, needs no required external infrastructure, and stores data in local SQLite by default.

Website: https://github.com/Thinklanceai/agentkeeper
