Ai Memory logo

Ai Memory

Community
somnus0x
ai-memory

Give your AI long-term and short-term memory: keyword-searchable session history (FTS5 index) plus a hot cache of current project state loaded at session start. Use when AI should remember past sessions and know project state without re-explaining.

Overview

Publishersomnus0x
Repositoryagt-skill-pack
Skill nameai-memory
Stars
74
Forks
17
Bundled files
2
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by somnus0x on GitHub. Read the source before you install it.

Installation

Install the Ai Memory AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/somnus0x/agt-skill-pack/tree/main/skills/ai-memory
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/somnus0x/agt-skill-pack.git /tmp/agt-skill-pack
mkdir -p .claude/skills
cp -r /tmp/agt-skill-pack/skills/ai-memory .claude/skills/ai-memory
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ai Memory in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ai Memory on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ai Memory is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

AI Memory — Give Your AI a Past and a Present

AI doesn't remember anything between sessions. Every new chat starts blank — no history, no context, no idea what you shipped yesterday.

This skill gives your AI two things it's missing:

  1. Long-term memory — search past sessions by keyword (FTS5 index)
  2. Short-term memory — know current project state at session start (hot cache)

The Problem (two sides)

Side 1: Can't find the past. You discussed an auth refactor two weeks ago. Made a decision. Wrote a great prompt. Now it's gone — buried in hundreds of session files with no search, no index.

Side 2: Doesn't know the present. What shipped yesterday? What's blocked? When's the deadline? AI has no idea until you paste context manually. Every session. Every morning.

Setup: Long-Term Memory (Session Search)

Drop-in prompt (copy into Claude Code):

อ่านไฟล์ JSONL ทุกไฟล์ใน ~/.claude/projects/ ดึงแค่ข้อความ user + assistant ออกมา สร้าง SQLite database ที่มี FTS5 full-text search index ให้ search ด้วย keyword ได้ทันที เขียนเป็น Python script ชื่อ session-store.py ที่รับ command search, ingest, stats

English version:

Read all JSONL files in ~/.claude/projects/ and extract only user + assistant messages. Create a SQLite database with FTS5 full-text search index that can search by keyword instantly. Write it as a Python script called session-store.py that accepts commands: search, ingest, stats

One prompt. AI writes the script, runs ingest, ready to search.

Usage

bash
# Search across all sessions
python3 session-store.py search "refactor authentication"

# Output:
# [2026-05-10] interactive:a3f2...  (42,318 chars)
#   ...ต้อง refactor authentication flow เพราะ Privy session...

# Re-index after new sessions
python3 session-store.py ingest

# Show index stats
python3 session-store.py stats

Manual setup (if you prefer)

Key components:

  1. Parser — Read JSONL session files, extract type: "human" and type: "assistant" messages
  2. SQLite + FTS5 — Virtual table with tokenize='unicode61' for multilingual support
  3. CLI — search "keyword", ingest (rebuild index), stats (show counts)

No cloud, no API keys, no vector DB, no embeddings. FTS5 is built into Python's sqlite3.

Setup: Short-Term Memory (Hot Cache)

Drop-in prompt (copy into Claude Code):

อ่านไฟล์พวกนี้: [standup log, decisions.md, schedule.env, tester-gate.md] สรุปให้เหลือแค่ข้อมูลที่จำเป็น — เมื่อวาน ship อะไร, blocker ตอนนี้คืออะไร, deadline เมื่อไหร่, decision ไหนยัง active — save เป็น hot-cache.md

English version:

Read these files: [standup log, decisions.md, schedule.env, project-status.md] and summarize into only the essential information — what shipped yesterday, current blockers, upcoming deadlines, which decisions are still active — save as hot-cache.md

Replace the file list with whatever holds your project state: git log, TODO files, kanban boards, decision journals, sprint trackers, open PRs.

What hot-cache.md looks like

markdown
# Hot Cache — 2026-05-24

## Last Standup
- feature X ✅ shipped
- feature Y BLOCKED on [person]
- feature Z IN PROGRESS

## Active Decisions
- Auth approach: social-first (Privy) — active
- Deployment: Cloud Run — decided, not revisiting

## Deadlines
- Launch: June 2
- Demo: May 28

## Recently Modified Files (last 24h)
- src/auth/privy.ts
- contracts/Parimutuel.sol

Keeping it fresh

  • Manual: Before closing a session, tell the AI: "update hot-cache.md with what we did today."
  • Automated: Set up a cron to refresh periodically:
bash
0 */4 * * * cd /path/to/project && claude -p "Read [source files]. Update hot-cache.md." >> /dev/null 2>&1

Wire It Up — Add to CLAUDE.md

This is the key step. Add these lines to your CLAUDE.md (or your AI tool's instruction file):

markdown
Before starting work:
1. Read data/hot-cache.md for current context (blockers, decisions, deadlines)
2. If you need info from a past session, use: python3 session-store.py search "keyword"

Now every session starts with context and has access to history. No manual pasting.

When to use

  • "What did we decide about X?" — search past sessions
  • "I wrote a good prompt for Y" — search and recover it
  • "What shipped yesterday?" — hot cache knows
  • Starting a new session on a multi-day task — hot cache has continuity
  • Before making architectural decisions — search for past discussions on the topic

Technical notes

  • Everything local. No cloud, no API keys, no external services.
  • No vector DB. FTS5 full-text search handles keyword lookup without embeddings.
  • Multilingual. FTS5 unicode61 tokenizer works with Thai, English, and mixed text.
  • Fast. 800+ sessions (3M+ chars) searched in milliseconds.
  • Universal. Works with Claude Code, Cursor, Copilot, Windsurf, Aider — any tool that reads files.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Ai Memory AI skill do?

Give your AI long-term and short-term memory: keyword-searchable session history (FTS5 index) plus a hot cache of current project state loaded at session start. Use when AI should remember past sessions and know project state without re-explaining.

Why use Ai Memory on TypingMind?

Because you install it once and use it with any model. Ai Memory is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ai Memory in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/somnus0x/agt-skill-pack/tree/main/skills/ai-memory. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Ai Memory?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ai Memory?

As many as you like. As long as a model supports skills, you can use Ai Memory with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ai Memory AI skill free?

Yes. It is published on GitHub by somnus0x under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇