What problem does it solve? Building conversational AI agents requires persistent session memory, conversation history storage, and retrieval patterns, but implementing these correctly with database fallbacks and clean architecture is error-prone. This Skill provides the established patterns and design rules for session management, vector memory, and RAG in an AI agent platform. ## Core Features & Use Cases - Session Management: Implements PostgreSQL-backed session storage with SQLAlchemy ORM models (Session, MessageHistory) and automatic in-memory fallback when the database is unavailable. - Conversation History: Provides key functions like get_or_create_session, add_message, and get_history for managing multi-turn dialogue context. - Vector Memory & RAG Planning: Outlines the planned approach for embeddings, semantic search with pgvector, and retrieval-augmented generation with chunking and citation. - Use Case: When adding conversation history to a FastAPI gateway service, use this Skill to generate the session manager with PostgreSQL persistence, graceful in-memory fallback, and 50,000-character content truncation. ## Quick Start Use the memory skill to implement session management with PostgreSQL persistence and in-memory fallback for the gateway service.