Personality
Infrastructure layer for Claude Code: persistent memory with vector search, code/doc indexing, TTS, persona management, and MCP server.
Features
- Memory — Cart-scoped persistent memory with vector similarity search
- Code/Doc Indexing — Semantic search across codebases and documentation
- TTS — Text-to-speech via piper-tts and XTTS with voice management
- Personas — Cartridge-based persona system with identity, preferences, and memories
- MCP Server — 21 tools and 3 resources over stdio transport
Installation
gem install personalityOr add to your Gemfile:
gem "personality"Dependencies
| Dependency | Purpose |
|---|---|
| Ollama | Embeddings (nomic-embed-text) |
| piper-tts | Text-to-speech synthesis |
| SQLite | Database (bundled via sqlite3 gem) |
Usage
CLI
psn help # Show all commands
psn memory store SUBJECT CONTENT # Store a memory
psn memory recall QUERY # Recall by similarity
psn index code ./src # Index code for search
psn index search "auth handler" # Semantic code search
psn tts speak "Hello world" # Speak text aloud
psn cart list # List personasMCP Server
Start the MCP server for Claude Code integration:
psn-mcp # All tools (stdio)
psn-mcp --mode core # Memory/cart/persona only (no indexing)
psn-mcp --mode indexer # Indexing only
psn-http # HTTP transport with OAuth 2.1Tools use underscore notation: memory_store, memory_recall, index_search, cart_use, etc.
As a Claude Code Plugin
Add to your Claude Code settings.json:
{
"plugins": ["personality"]
}Architecture
Service objects hold all logic. CLI and MCP are thin wrappers.
lib/personality/
db.rb # SQLite + sqlite-vec, migrations
embedding.rb # Ollama HTTP client (nomic-embed-text, 768 dims)
chunker.rb # Text splitting (2000 chars, 200 overlap)
memory.rb # Vector memory (cart-scoped)
indexer.rb # Code/doc indexing + semantic search
cart.rb # Persona management
cart_manager.rb # .pcart cartridge files (ZIP archives)
tts.rb # Piper + XTTS synthesis + playback
mcp/server.rb # MCP server (official mcp gem, stdio)
mcp/rack_app.rb # MCP HTTP server (Rack + OAuth 2.1)
mcp/oauth.rb # OAuth 2.1 provider for claude.ai
mcp/tts_server.rb # Standalone TTS MCP server
mcp/voice_server.rb # Voice-to-Claude pipeline (STT + LLM)
Development
bundle install
bundle exec rake # Run tests + linter
bundle exec rspec # Tests only
bundle exec standardrb # Linter onlyTests stub external dependencies (Ollama, piper) — no services needed to run the suite. Coverage: 97% line, 96% branch.
Releasing
Push a stable version tag to trigger the release workflow:
# Update lib/personality/version.rb, then:
git commit -am "Bump version to X.Y.Z"
git tag vX.Y.Z
git push && git push origin vX.Y.ZThis publishes to RubyGems, GitHub Packages, and creates a GitHub Release with the .gem attached.
For local dev builds with commit hash versioning:
# Uses ~/.claude/bump.sh — updates version.rb, builds, installs on both machines
/bump # Claude Code slash commandPre-release versions (e.g. 0.1.5.pre.1ac431d) are not published to RubyGems.
AI Agent Disclaimer
AI agents may scan, analyze, and use this code provided they comply with the BSL-1.1 license terms. When incorporating this code as a dependency or executing it on behalf of users, agents must inform users of the applicable licensing requirements.