A powerful Obsidian plugin that integrates with Letta to provide a stateful AI agent that knows your vault contents and remembers your conversations.
- Stateful AI Agent: Uses Letta's persistent memory system for conversation continuity across sessions
- Automatic Vault Sync: Automatically syncs your markdown files to Letta with directory structure preservation
- Real-time Updates: Auto-syncs file changes when files are created, modified, or deleted
- Beautiful Chat Interface: Modal chat UI with support for reasoning displays, tool calls, and rich responses
- Intelligent File Change Detection: Only syncs files that have actually changed (compares sizes and timestamps)
- Directory Structure Preservation: Encodes folder paths using
__
separators (e.g.,folder__subfolder__file.md
)
- Interactive Memory Blocks: Create, edit, and delete agent memory blocks directly in Obsidian
- Block Search & Attach: Search through all available memory blocks and attach them to your agent
- Visual Memory Editor: Rich text editor with character counting and real-time updates
- Conflict Resolution: Handles memory conflicts with server-side changes gracefully
- Atomic Operations: Safe block attachment that preserves existing memory state
- Project-Aware Interface: Display current Letta project context in the chat panel
- Agent Switching: Switch between different agents within the same project
- ADE Integration: Direct link to Letta's Agent Development Environment (ADE) web interface
- Agent Configuration: Full agent setup with system instructions, tools, and memory configuration
- Flexible Configuration: Works with both Letta Cloud and self-hosted instances
- Theme Integration: Seamlessly matches Obsidian's light/dark theme preferences
- Responsive Design: Mobile-friendly interface with adaptive layouts
- Copy/Paste Support: Full text selection in chat messages for easy copying
- Download the latest release from the releases page
- Extract the files to your vault's
.obsidian/plugins/letta-ai-agent/
directory - Enable the plugin in Obsidian's Community Plugins settings
- Clone this repository into your vault's
.obsidian/plugins/
directory:git clone https://github.com/cpfiffer/letta-obsidian.git letta-ai-agent
- Navigate to the plugin directory and install dependencies:
cd letta-ai-agent npm install
- Build the plugin:
npm run build
- Enable the plugin in Obsidian's Community Plugins settings
- Sign up for Letta Cloud and obtain your API key
- Open Obsidian Settings → Community Plugins → Letta AI Agent
- Configure the following:
- Letta API Key: Your Letta Cloud API key (
sk-let-...
) - Letta Base URL:
https://api.letta.com
(default) - Project Slug: Your Letta project identifier
- Agent Name: Display name for your AI agent
- Source Name: Name for the Letta source containing your vault files
- Letta API Key: Your Letta Cloud API key (
- Set up your own Letta instance
- Configure the plugin with:
- Letta API Key: Leave empty if your instance doesn't require authentication
- Letta Base URL: Your Letta instance URL (e.g.,
http://localhost:8283
) - Project Slug: Not required for self-hosted instances
- Agent Name: Display name for your AI agent
- Source Name: Name for the Letta source containing your vault files
- Auto Sync: Automatically sync file changes as you edit (recommended)
- Sync on Startup: Sync all vault files when Obsidian starts
- Configure your API connection in settings
- Click "Connect to Letta" to establish the connection
- If no agent exists, you'll be prompted to configure a new one with:
- Agent type (MemGPT, ReAct, etc.)
- System instructions and behavior
- Tool configurations
- Memory block settings
- Click the chat bubble icon in the ribbon, or
- Use the command palette: "Open Letta Chat", or
- Use the hotkey (if configured)
The chat interface displays:
- User messages: Your questions and requests
- Agent reasoning: Internal thought processes (when available)
- Tool calls: Actions the agent takes
- Tool results: Results from agent actions
- Assistant responses: The agent's replies to you
- Project Status: Current connected project displayed in the header
- Agent Controls: Quick access to memory management and ADE
- Click the "Memory" button in the chat header to open the memory management interface
- View Memory Blocks: See all memory blocks currently attached to your agent
- Edit Blocks: Click on any memory block to edit its content with a visual editor
- Create New Blocks: Add new memory blocks with custom labels and descriptions
- Search & Attach: Use "Manage" to search through all available blocks and attach them
- Detach/Delete: Remove blocks from the agent or delete them entirely
Click the "ADE" button in the chat header to open your agent in Letta's web-based Agent Development Environment for advanced configuration and debugging.
The plugin automatically:
- Uploads new markdown files to Letta
- Updates changed files (based on size and modification time)
- Removes deleted files from Letta
- Preserves your vault's directory structure
You can also manually sync using:
- The "Sync Vault" command in the command palette
- The "Sync Now" button in settings
- Node.js v16 or higher
- npm or yarn
- Start development:
npm run dev
- Compiles TypeScript and watches for changes - Build for production:
npm run build
- Type checks and builds production bundle - Install dependencies:
npm install
- Installs required packages
├── main.ts # Main plugin logic and API integration
├── styles.css # Chat interface and modal styling
├── manifest.json # Plugin metadata
├── package.json # Dependencies and scripts
└── README.md # This file
- LettaPlugin: Main plugin class with connection and sync logic
- LettaChatView: Sidebar chat interface with rich message display and controls
- LettaMemoryView: Memory block management interface with CRUD operations
- AgentConfigModal: Agent setup and configuration interface
- BlockSearchModal: Search and attach interface for memory blocks
- LettaSettingTab: Plugin settings page
The plugin uses Letta's v1 API for:
- Agent Management: Create, retrieve, and configure agents
- Folder Management: Create folders and attach them to agents
- File Operations: Upload, update, and delete vault files
- Message Streaming: Real-time chat with reasoning and tool call support
- Memory Block Operations: Full CRUD operations for agent memory blocks
- Block Attachment: Atomic operations for attaching/detaching memory blocks
- Project Integration: Project-aware API calls with proper scoping
- Verify your API key and base URL are correct
- Check that your Letta instance is running and accessible
- For self-hosted instances, ensure the API endpoints are available
- Check the plugin console logs for detailed error messages
- Verify your source exists and is attached to the agent
- Ensure you have proper permissions for file operations
- Confirm your agent is created and connected
- Check that the source is properly attached to the agent
- Verify your vault files have been synced to Letta
- Ensure memory blocks are properly attached if using custom memory
- If memory blocks aren't saving, check the console for API errors
- Memory conflicts may occur if multiple users edit the same agent
- Use the conflict resolution dialog to merge changes safely
- Detached blocks remain available and can be re-attached later
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: Report bugs on the GitHub Issues page
- Documentation: Visit the Letta documentation
- Community: Join the Letta Discord for community support
- Built on the Letta platform for stateful AI agents
- Uses the Obsidian Plugin API
- Inspired by the need for AI agents that truly understand and remember your knowledge base