-
Notifications
You must be signed in to change notification settings - Fork 12
Quick Start
Get up and running with OpenCode Memory in 5 minutes.
Add the plugin to your OpenCode configuration:
Edit: ~/.config/opencode/opencode.json or opencode.jsonc
Restart OpenCode to install the plugin automatically.
Check that the web interface is running:
curl http://127.0.0.1:4747/api/statsYou should see JSON output with memory statistics.
Add your first memory using the memory tool:
memory({
mode: "add",
content: "I prefer TypeScript over JavaScript for all projects",
,
type: "preference"
})Search for the memory you just added:
memory({
mode: "search",
query: "programming language preference",
})Check your user profile:
memory({ mode: "profile" })Open the web interface in your browser:
http://127.0.0.1:4747
Explore the features:
- Browse all memories
- Search by keyword or similarity
- Edit or delete memories
- View statistics
Store project-specific information:
memory({
mode: "add",
content: "This project uses React 18 with Vite and TypeScript",
,
type: "architecture"
})View recent memories by scope:
memory({ mode: "list", limit: 10 })Remove a specific memory:
memory({ mode: "forget", memoryId: "mem_abc123" })For cross-project information:
- Coding preferences
- Tool preferences
- Communication style
- Work patterns
For project-specific information:
- Architecture decisions
- Technology stack
- Code conventions
- Bug fixes
The agent automatically detects memory-related keywords:
- "remember this"
- "don't forget"
- "keep in mind"
- "make a note"
- "save this"
When detected, the agent will offer to save the information.
Enable automatic memory extraction from conversations:
- Edit config file:
~/.config/opencode/opencode-mem.jsonc - Add API credentials:
{
"autoCaptureEnabled": true,
"memoryModel": "gpt-4",
"memoryApiUrl": "https://api.openai.com/v1",
"memoryApiKey": "sk-your-api-key-here"
}- Restart OpenCode
The system will now automatically extract important information from conversations.
- Text Search: Search by keywords in content
- Vector Search: Semantic similarity search
- Filters: Filter by scope, type, or tags
- Edit: Click any memory to edit content or metadata
- Delete: Remove individual or multiple memories
- Pin: Mark important memories to keep them at the top
- Cleanup: Remove old memories based on retention period
- Deduplication: Find and remove similar duplicates
- Migration: Change embedding model dimensions
Edit ~/.config/opencode/opencode-mem.jsonc:
{
"webServerPort": 4747,
"similarityThreshold": 0.6,
"maxMemories": 5,
"maxProjectMemories": 10
}If port 4747 is in use:
{
"webServerPort": 4748
}Store database in a different location:
{
"storagePath": "/path/to/custom/location"
}- Be specific and concise
- Include context when needed
- Use consistent terminology
- Avoid sensitive information
- Use
userscope for personal preferences - Use
projectscope for project-specific info - Keep scopes separate for better organization
- Use natural language queries
- Be specific for better results
- Adjust similarity threshold if needed
- Run cleanup periodically to remove old memories
- Use deduplication to prevent redundancy
- Monitor storage usage in web interface
- Memory Operations - Detailed tool usage
- Configuration Guide - All configuration options
- Web Interface - Complete UI guide
- Auto-Capture System - Automatic memory extraction
If you encounter issues:
- Check Troubleshooting guide
- Review Configuration Guide
- Open an issue on GitHub
{ "plugins": [ "opencode-mem" ] }