ai-memory

Store user preferences and facts in PostgreSQL for cross-session AI memory.

3|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/mattwoodco/skills --skill ai-memory-mattwoodco
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-memory
Source: https://github.com/mattwoodco/skills/tree/main/skills/ai-memory
Command: npx skills add https://github.com/mattwoodco/skills --skill ai-memory-mattwoodco

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables AI models to retain and recall information across different user interactions and chat sessions, creating a more personalized and context-aware experience.

Core Features & Use Cases

  • Cross-Session Memory: Stores user preferences, facts, and conversation history in a PostgreSQL database.
  • Context Injection: Automatically injects relevant memories into the AI's system prompt for immediate context.
  • Tool Integration: Provides saveMemory, recallMemory, forgetMemory, and listAllMemories tools for AI-driven memory management.
  • Use Case: An AI assistant remembers a user's name, job title, and preferred communication style from a previous conversation and uses this information to tailor its responses in a new session.

Quick Start

Tell the AI "my name is Alex" and then start a new session and ask "what's my name".

Frequently Asked Questions about ai-memory

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I give an LLM persistent memory across different chat sessions?

Persistent LLM memory across chat sessions is achieved by storing user preferences and facts in a PostgreSQL database. The system automatically injects these relevant memories into the AI's system prompt for immediate context in new interactions.

How does AI context injection work with a PostgreSQL database?

AI context injection retrieves stored user facts from a PostgreSQL database and inserts them directly into the AI's system prompt. This mechanism provides the model with immediate background context without manual data entry.

What tools do I need for AI-driven memory management?

AI-driven memory management uses saveMemory, recallMemory, forgetMemory, and listAllMemories tools. These allow the model to autonomously store, retrieve, and delete information from the database during interactions.

Do I need a running PostgreSQL instance to use cross-session AI memory?

Yes, cross-session AI memory requires a running PostgreSQL instance to store data. You also need the ai-chat, ai-tools, and ai-core dependencies to handle the conversation interface and memory injection.

How to test if an AI assistant remembers user preferences in a new session?

To test cross-session memory, tell the AI a fact like your name in one session. Start a new session and ask a related question to verify the model successfully recalls the previously stored preference.

What is the best way to store user preferences for an LLM?

Storing user preferences for an LLM is best handled by saving facts to a PostgreSQL database with automated context injection. This ensures the AI consistently applies user-specific details across sessions.