Use when you have a written implementation plan to execute in a separate session with review checkpoints
npx skills add Agency7ai/agent-rag-memories-universal
Or install specific skill: npx add-skill https://github.com/Agency7ai/agent-rag-memories-universal
# Description
Full RAG (Retrieval-Augmented Generation) context memory system. Automatically preserves and retrieves context across sessions using vector search. Framework agnostic - works with any project.
# SKILL.md
name: rag-memory
description: Full RAG (Retrieval-Augmented Generation) context memory system. Automatically preserves and retrieves context across sessions using vector search. Framework agnostic - works with any project.
user_invocable: true
RAG Memory - Persistent Context Across Sessions
A portable, framework-agnostic RAG system for Claude Code that preserves your project context across sessions.
Quick Start
# 1. Copy this skill folder to your project
cp -r .claude/skills/rag-memory /path/to/your/project/.claude/skills/
# 2. Run the setup
/rag-memory setup
# 3. Start using it
/rag-memory load # Load context at session start
/rag-memory save # Save context when needed
Commands
| Command | Description |
|---|---|
/rag-memory setup |
Initialize RAG for this project |
/rag-memory load |
Load relevant context (run at session start) |
/rag-memory load [topic] |
Search for context about a specific topic |
/rag-memory save |
Save current session context |
/rag-memory status |
Show current configuration and stats |
/rag-memory clear |
Clear all stored context (careful!) |
Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRAMEWORK AGNOSTIC RAG β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β /rag-memory load /rag-memory save β
β β β β
β βΌ βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββ β
β β Convex (Serverless Backend) β β
β β β β
β β β’ ragMemories table β β
β β β’ OpenAI text-embedding-3-small β β
β β β’ Vector similarity search β β
β β β’ No framework code in your app β β
β βββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β Works with: React, Vue, Svelte, Node, Python, β
β Go, Rust, or ANY tech stack β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
How RAG Works
- RETRIEVAL - When you run
/rag-memory load: - Fetches relevant memories from vector database
- Uses semantic search (not just keywords)
-
Returns decisions, patterns, progress from past sessions
-
AUGMENTATION - The retrieved context is presented to Claude:
- Becomes part of the conversation
- Informs all subsequent responses
-
No need to re-explain your project
-
GENERATION - Claude uses the context:
- References past decisions
- Follows established patterns
- Continues from where you left off
Configuration
After setup, your .claude/rag-memory.json looks like:
{
"projectId": "your-project-name",
"convexUrl": "https://your-deployment.convex.cloud",
"autoLoad": true
}
Memory Types
| Type | What to Store |
|---|---|
decision |
Architecture choices, tech stack decisions, trade-offs |
code_pattern |
Reusable patterns, conventions, idioms |
progress |
Completed features, milestones, current state |
blocker |
Known issues, pending questions, limitations |
context |
Project-specific knowledge, business logic |
file_summary |
Key files and their purposes |
conversation |
Important discussions, user preferences |
Backend Setup (One-Time)
You need a Convex backend. This can be:
- A dedicated project just for RAG memory
- Part of an existing Convex project
- Shared across multiple projects (different projectIds)
Quick Convex Setup
# Create backend (can be anywhere)
mkdir rag-backend && cd rag-backend
npm init -y
npm install convex
npx convex dev
# Set OpenAI key for embeddings
npx convex env set OPENAI_API_KEY sk-your-key
# Copy schema and functions from templates/convex/
When to Use
/rag-memory load
- Starting a new session
- Switching to a feature you've worked on before
- Need to recall a previous decision
- After context was summarized/compressed
/rag-memory save
- Ending a productive session
- Made important decisions
- Established new patterns
- Context window getting full
- Before switching to a different topic
Example Flow
Day 1:
User: Let's build an auth system
Claude: [Works on auth, makes decisions about Stack Auth, patterns, etc.]
User: /rag-memory save
Claude: Saved 4 memories: Stack Auth decision, auth patterns, progress, config notes
Day 2:
User: /rag-memory load
Claude: Loaded context - you're using Stack Auth with email/OAuth,
middleware pattern for protected routes, auth is complete.
User: Add profile settings
Claude: I'll add profile settings that integrates with your Stack Auth
setup, following your established patterns...
Sharing
Share Just the Skill
zip -r rag-memory.zip .claude/skills/rag-memory/
# Friends unzip to their .claude/skills/
# They set up their own Convex backend
Share Everything
- Add friends to your Convex team
- Share the convexUrl
- They use unique projectIds
Files
rag-memory/
βββ README.md # Detailed documentation
βββ SKILL.md # This file
βββ commands/
β βββ setup.md # Setup flow
β βββ load.md # Retrieval logic
β βββ save.md # Extraction logic
β βββ status.md # Status display
βββ templates/
βββ convex/
βββ ragMemories.ts # Copy to convex/
βββ schema-addition.ts # Add to schema.ts
# README.md
RAG Memory - Portable Context Preservation for Claude Agent Skills or Agents.md Memories

Never forget what your building
A complete RAG (Retrieval-Augmented Generation) system that preserves your project context across Claude Code or Agent sessions.
Framework Agnostic - Works with any tech stack. Only requires Convex for storage.
What It Does
- Saves important decisions, code patterns, progress, and blockers
- Retrieves relevant context at the start of new sessions
- Augments Claude's responses with your project history
- Prevents repeating yourself or losing track of decisions
Quick Install
Non Claude Agents start
npm i -g openskills
touch .agent/skills
mv rag-memory .agent/skills/rag-memory
openskills sync
claude agents start
same for both
# 1. Copy to your project
cp -r /path/to/rag-memory /your/project/.claude/skills/
# 2. Start Claude Code in your project
cd /your/project
claude
# 3. Run setup
/rag-memory setup
Commands
| Command | What It Does |
|---|---|
/rag-memory setup |
Initialize RAG for this project |
/rag-memory load |
Load context at session start |
/rag-memory load auth |
Search for context about "auth" |
/rag-memory save |
Save current session context |
/rag-memory status |
Show configuration and stats |
/rag-memory clear |
Delete all stored context |
How It Works
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRAMEWORK AGNOSTIC β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Your Project Claude Code Convex β
β (Any Stack) Skills (Storage) β
β β
β βββββββββββββ βββββββββββββββ βββββββββββββ β
β β React β β /rag-memory ββββββββΆβ Vector DB β β
β β Vue ββββββββΆβ load / save βββββββββ Embeddingsβ β
β β Svelte β β β β Search β β
β β Node β βββββββββββββββ βββββββββββββ β
β β Python β β
β β Go β No framework code β
β β Anything! β needed in your app β
β βββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Setup (One-Time)
1. Create a Convex Project
# In any directory (can be separate from your main project)
mkdir rag-memory-backend && cd rag-memory-backend
npm init -y
npm install convex
npx convex dev
2. Add Schema
Create convex/schema.ts:
import { defineSchema, defineTable } from 'convex/server';
import { v } from 'convex/values';
export default defineSchema({
ragMemories: defineTable({
projectId: v.string(),
sessionId: v.optional(v.string()),
type: v.union(
v.literal('decision'),
v.literal('code_pattern'),
v.literal('progress'),
v.literal('blocker'),
v.literal('context'),
v.literal('file_summary'),
v.literal('conversation')
),
title: v.string(),
content: v.string(),
tags: v.array(v.string()),
embedding: v.array(v.float64()),
createdAt: v.number()
})
.index('by_project', ['projectId'])
.index('by_type', ['projectId', 'type'])
.vectorIndex('by_embedding', {
vectorField: 'embedding',
dimensions: 1536,
filterFields: ['projectId', 'type']
})
});
3. Add Functions
Copy templates/convex/ragMemories.ts to convex/ragMemories.ts
4. Set OpenAI Key
npx convex env set OPENAI_API_KEY sk-your-key-here
5. Get Your Convex URL
After npx convex dev, note your deployment URL:
https://your-project-123.convex.cloud
6. Configure the Skill
Create .claude/rag-memory.json in your actual project:
{
"projectId": "my-project-name",
"convexUrl": "https://your-project-123.convex.cloud"
}
Memory Types
| Type | Use For |
|---|---|
decision |
Tech choices, architecture decisions, trade-offs |
code_pattern |
Reusable patterns, conventions, idioms |
progress |
Completed features, milestones, current state |
blocker |
Known issues, pending questions, limitations |
context |
Project knowledge, business logic, requirements |
file_summary |
Key files and their purposes |
conversation |
Important discussions, user preferences |
Example Session
User: /rag-memory load
Claude: RAG Context Loaded
==================
Retrieved 5 relevant memories:
Decisions:
β’ Using PostgreSQL for main database
β’ Chose Tailwind over styled-components
Patterns:
β’ API error handling pattern
β’ Form validation approach
Progress:
β’ User authentication complete
β’ Dashboard layout done
I'm ready to continue. What would you like to work on?
User: Add user profile editing
Claude: I'll add profile editing. Based on your existing patterns,
I'll follow the same form validation approach and use the
established API error handling...
Sharing With Friends
Option A: Share Just the Skill
# Zip the skill folder
cd .claude/skills
zip -r rag-memory.zip rag-memory/
# Share the zip file
They'll need to:
1. Set up their own Convex backend
2. Configure .claude/rag-memory.json with their URL
Option B: Share Backend Too
If you want friends to use the same backend (shared context):
1. Add them as team members in Convex dashboard
2. Share the convexUrl
3. They use a different projectId for their projects
Troubleshooting
"Convex not configured"
Create a Convex project and set the URL in .claude/rag-memory.json
"No OPENAI_API_KEY"
In your Convex project: npx convex env set OPENAI_API_KEY sk-...
Low quality search results
Clear old memories and re-save after setting OpenAI key:
/rag-memory clear
/rag-memory save
Auto-Load Hook (True RAG)
To make context loading automatic at session start:
-
Copy the hook script:
bash mkdir -p .claude/hooks cp .claude/skills/rag-memory/templates/hooks/rag-session-start.sh .claude/hooks/ chmod +x .claude/hooks/rag-session-start.sh -
Add to settings (
.claude/settings.jsonorsettings.local.json):
json { "hooks": { "SessionStart": [ { "hooks": [ { "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/rag-session-start.sh" } ] } ] } }
Now Claude will automatically be instructed to load context at session start!
Files Included
rag-memory/
βββ README.md # This file
βββ SKILL.md # Main skill definition
βββ commands/
β βββ setup.md # Setup instructions
β βββ load.md # Load context logic
β βββ save.md # Save context logic
β βββ status.md # Status display
βββ templates/
βββ convex/
β βββ ragMemories.ts # Convex functions
β βββ schema-addition.ts # Schema to add
βββ hooks/
βββ rag-session-start.sh # Auto-load hook
Why Convex?
- Free tier - Plenty for personal/small team use
- Built-in vector search - No additional setup
- Serverless - No server to maintain
- Works anywhere - Just an HTTP API
License
MIT - Use freely, share with friends.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.