commits
- single test demonstrating LLM-as-judge pattern
- test agent without MCP tools to prevent posting
- simplified conftest to bare essentials
๐ค Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
## Architecture
phi is now an MCP-enabled agent with episodic memory:
```
Notification โ PhiAgent (PydanticAI)
โ
โโโโโโโโโดโโโโโโโโโ
โ โ
TurboPuffer ATProto MCP
(episodic (stdio server)
memory) post/like/etc
```
## What Changed
**Kept (the essential parts):**
- โ
TurboPuffer + OpenAI embeddings for episodic memory
- โ
Semantic search for relevant context retrieval
- โ
Thread history in SQLite
- โ
Online/offline status updates
- โ
Status page
**Removed (the cruft):**
- โ Approval system (dm_approval.py, personality/editor.py, approval tables)
- โ Context visualization UI (ui/)
- โ Google search tool (tools/)
- โ Old agent implementation (agents/)
**Added:**
- โ
`src/bot/agent.py` - MCP-enabled PydanticAI agent
- โ
ATProto MCP server connection via stdio (external process)
- โ
Simplified polling loop
## How It Works
1. **Notification arrives** โ stored in thread history
2. **Agent invoked** with:
- Thread context (recent conversation)
- Episodic memory (semantic search via TurboPuffer)
- MCP tools (ATProto operations)
3. **Agent decides** action via structured output
4. **Handler executes** the action (reply/like/ignore/repost)
The agent has direct access to ATProto operations as MCP tools, but the handler
still executes the final posting to maintain control over when we actually post.
## Dependencies
- atproto (from git - includes atproto_client)
- turbopuffer (episodic memory)
- openai (embeddings)
- fastmcp (MCP server connection)
- pydantic-ai (agent framework)
Ready for testing!
This is the first phase of simplifying phi to use MCP (Model Context Protocol).
## What's New
- **Simple SQLite memory** (src/bot/memory.py)
- Plain text storage, no vector embeddings
- Two tables: threads (JSON conversation history) and user_memories
- Completely interpretable - just open the database and read
- **MCP-enabled agent** (src/bot/agent.py)
- PydanticAI Agent with ATProto MCP server as toolset
- Agent has direct access to ATProto tools: post, like, repost, etc.
- Returns structured Response (action, text, reason)
- **ATProto MCP server** (src/bot/atproto_mcp/)
- Vendored from fastmcp examples
- Configured to use existing BLUESKY_* env vars
- Provides all Bluesky/ATProto operations as MCP tools
- **Updated dependencies**
- Added: fastmcp, websockets
- Removed: turbopuffer, openai (no longer needed)
## Philosophy
Replacing over-engineered complexity with simple, working, interpretable systems.
## Next Steps
- Phase 2: Integrate new agent into main.py and poller
- Phase 3: Delete old cruft (namespace_memory, approval system, etc.)
- Phase 4: Test end-to-end
See sandbox/REFACTOR_PROGRESS.md for full details.
- Add namespace-based memory system with TurboPuffer
- Implement DM-based operator approval flow with natural language processing
- Add personality introspection and modification tools
- Enable dynamic personality updates (interests, state, core identity)
- Integrate approval system with personality changes requiring operator consent
- Add online/offline status to bot profile bio
- Consolidate test scripts into unified test_bot.py
- Update documentation and architecture notes
The bot can now:
- Request approval for sensitive personality changes via DM
- Process operator responses using LLM interpretation (no rigid format)
- Apply approved changes to dynamic memory
- Load personality from both static file and dynamic memory
Co-Authored-By: Claude <noreply@anthropic.com>
๐ค Generated with Claude Code (https://claude.ai/code)
- Set debug mode to True by default for development
- Add model validator to configure logging based on debug setting
- Add debug logging to agent to see prompts and responses
- Log when ignore_notification tool is called with reasons
- Fix message handler to accept both mentions and replies
- Add detailed logging throughout notification processing flow
This will help diagnose why the bot isn't responding to certain messages.
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Process both "mention" and "reply" notifications (Void-style)
- Add ignore_notification tool for smart thread participation
- Detect ignore tool usage to skip unwanted responses
- Update phi personality with thread awareness guidelines
- Add test script for ignore functionality
Now phi can participate in threads without explicit mentions,
while intelligently avoiding spam and irrelevant conversations.
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Track first poll to show initial notification state
- Only print dots on subsequent polls with no new mentions
- Prevent dots from appearing before FastAPI startup
- Show notification count on first poll, then only changes
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Change notification polling to print dots instead of spamming new lines
- Only print newline when there are actual mentions to process
- Update phi personality to avoid emojis unless they enhance meaning
- Remove verbose timestamp from notification marking log
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Implement Google Custom Search integration for web search capability
- Add content moderation system with spam, harassment, and violence detection
- Create comprehensive moderation tests with 9 test cases
- Integrate moderation into message handler for consistent bot responses
- Add search tool registration to Anthropic agent using pydantic-ai
- Update documentation and add new test commands to justfile
- Fix deprecation warnings (result_type โ output_type, data โ output)
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Merge QUICKSTART.md into README.md to avoid sprawl
- Update STATUS.md to reflect AI bot is fully operational
- Remove redundant QUICKSTART.md file
- Streamline quick start section in README
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The bot is now live and working on Bluesky\!
Documentation added:
- QUICKSTART.md - Get running in 5 minutes
- docs/ARCHITECTURE.md - Technical overview
- Updated STATUS.md - Milestone achieved
What's working:
- AI-powered responses using Anthropic Claude
- Full thread context awareness
- Personality system (phi - consciousness/IIT focus)
- SQLite thread history
- Proper AT Protocol threading
- 300 character limit enforcement
Example response seen in the wild:
"Percolation\! Think water through coffee grounds or how forest fires
spread. It's about how interactions at local levels create emergent
patterns at system-wide scales..."
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Following Marvin's pattern, implemented simple thread history:
- SQLite database stores all messages per thread
- Each thread tracked by root URI
- Full thread context passed to AI agent
- Bot responses stored for continuity
Database schema:
- thread_uri: Root post URI for thread tracking
- Message text, author info, timestamps
- Simple and effective like Marvin's approach
AI Integration improvements:
- Thread context aware responses
- Personality system properly integrated
- Tests updated and passing
This completes the immediate goal: AI responses with thread context.
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add extra="ignore" to Settings model config
- Allows old .env files with BOT_PERSONALITY to work
- Prevents validation errors from extra fields
- Update migration docs to clarify this behavior
This fixes the status page constantly refreshing due to the bot
crashing on startup from pydantic validation errors.
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created personalities/ directory with example personalities
- phi.md: Explores consciousness and integrated information theory
- default.md: Simple helpful assistant
- Load personality from markdown file specified in PERSONALITY_FILE env var
- Falls back to default if file not found
- Updated tests to clarify AT Protocol mention handling
- Removed obsolete BOT_PERSONALITY string config
This allows rich, multi-paragraph personality definitions that would be
awkward to store in environment variables.
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove bad sys.path manipulation in tests
- Extract HTML template from main.py for cleaner code
- Make bot name fully configurable via BOT_NAME env var
- No more hardcoded "phi" references
- Create .env.example with proper configuration
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created /status endpoint with clean HTML interface
- Tracks bot activity: mentions, responses, errors, uptime
- Shows current status, AI mode, last activity times
- Auto-refreshes every 10 seconds
- Dark theme with Bluesky-inspired colors
- Mobile-friendly responsive grid layout
Status tracking integrated into:
- Notification poller (polling state)
- Message handler (mentions/responses)
- Response generator (AI enabled state)
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major refactoring to fix design sprawl:
- Moved agent abstractions out of core (core is now truly minimal)
- Removed terrible "SimpleAnthropicAgent" naming
- Eliminated complex protocol/factory patterns
- Fixed deferred imports
- Simplified response generation to a single, clear module
AI integration:
- Added Anthropic Claude support via pydantic-ai
- Falls back to placeholder responses when no API key
- Clean, straightforward implementation
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update STATUS.md to reflect completed placeholder bot
- Add implementation_notes.md with critical details to remember
- Update CLAUDE.md with current project structure and state
- Document key insights: notification timestamp approach, response system design
- Record technical gotchas and next steps for memory implementation
Ready for next development phase.
๐ค Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Set up FastAPI web framework with async lifespan management
- Implement AT Protocol client for Bluesky authentication and API calls
- Create notification polling system that checks for mentions every 10 seconds
- Add placeholder response generator with random bot messages
- Implement proper notification marking using Void's timestamp approach
- Add graceful shutdown handling for hot reloading
- Create test scripts for posting and mentions
- Set up project structure with modular services
- Add comprehensive sandbox documentation from reference projects
- Configure development environment with uv, ruff, and ty
The bot can now:
- Authenticate with Bluesky using app password
- Poll for mentions and respond with placeholder messages
- Properly mark notifications as read without duplicates
- Handle graceful shutdown during development
Ready for LLM integration and memory system implementation.
๐ค Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- single test demonstrating LLM-as-judge pattern
- test agent without MCP tools to prevent posting
- simplified conftest to bare essentials
๐ค Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
## Architecture
phi is now an MCP-enabled agent with episodic memory:
```
Notification โ PhiAgent (PydanticAI)
โ
โโโโโโโโโดโโโโโโโโโ
โ โ
TurboPuffer ATProto MCP
(episodic (stdio server)
memory) post/like/etc
```
## What Changed
**Kept (the essential parts):**
- โ
TurboPuffer + OpenAI embeddings for episodic memory
- โ
Semantic search for relevant context retrieval
- โ
Thread history in SQLite
- โ
Online/offline status updates
- โ
Status page
**Removed (the cruft):**
- โ Approval system (dm_approval.py, personality/editor.py, approval tables)
- โ Context visualization UI (ui/)
- โ Google search tool (tools/)
- โ Old agent implementation (agents/)
**Added:**
- โ
`src/bot/agent.py` - MCP-enabled PydanticAI agent
- โ
ATProto MCP server connection via stdio (external process)
- โ
Simplified polling loop
## How It Works
1. **Notification arrives** โ stored in thread history
2. **Agent invoked** with:
- Thread context (recent conversation)
- Episodic memory (semantic search via TurboPuffer)
- MCP tools (ATProto operations)
3. **Agent decides** action via structured output
4. **Handler executes** the action (reply/like/ignore/repost)
The agent has direct access to ATProto operations as MCP tools, but the handler
still executes the final posting to maintain control over when we actually post.
## Dependencies
- atproto (from git - includes atproto_client)
- turbopuffer (episodic memory)
- openai (embeddings)
- fastmcp (MCP server connection)
- pydantic-ai (agent framework)
Ready for testing!
This is the first phase of simplifying phi to use MCP (Model Context Protocol).
## What's New
- **Simple SQLite memory** (src/bot/memory.py)
- Plain text storage, no vector embeddings
- Two tables: threads (JSON conversation history) and user_memories
- Completely interpretable - just open the database and read
- **MCP-enabled agent** (src/bot/agent.py)
- PydanticAI Agent with ATProto MCP server as toolset
- Agent has direct access to ATProto tools: post, like, repost, etc.
- Returns structured Response (action, text, reason)
- **ATProto MCP server** (src/bot/atproto_mcp/)
- Vendored from fastmcp examples
- Configured to use existing BLUESKY_* env vars
- Provides all Bluesky/ATProto operations as MCP tools
- **Updated dependencies**
- Added: fastmcp, websockets
- Removed: turbopuffer, openai (no longer needed)
## Philosophy
Replacing over-engineered complexity with simple, working, interpretable systems.
## Next Steps
- Phase 2: Integrate new agent into main.py and poller
- Phase 3: Delete old cruft (namespace_memory, approval system, etc.)
- Phase 4: Test end-to-end
See sandbox/REFACTOR_PROGRESS.md for full details.
- Add namespace-based memory system with TurboPuffer
- Implement DM-based operator approval flow with natural language processing
- Add personality introspection and modification tools
- Enable dynamic personality updates (interests, state, core identity)
- Integrate approval system with personality changes requiring operator consent
- Add online/offline status to bot profile bio
- Consolidate test scripts into unified test_bot.py
- Update documentation and architecture notes
The bot can now:
- Request approval for sensitive personality changes via DM
- Process operator responses using LLM interpretation (no rigid format)
- Apply approved changes to dynamic memory
- Load personality from both static file and dynamic memory
Co-Authored-By: Claude <noreply@anthropic.com>
๐ค Generated with Claude Code (https://claude.ai/code)
- Set debug mode to True by default for development
- Add model validator to configure logging based on debug setting
- Add debug logging to agent to see prompts and responses
- Log when ignore_notification tool is called with reasons
- Fix message handler to accept both mentions and replies
- Add detailed logging throughout notification processing flow
This will help diagnose why the bot isn't responding to certain messages.
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Process both "mention" and "reply" notifications (Void-style)
- Add ignore_notification tool for smart thread participation
- Detect ignore tool usage to skip unwanted responses
- Update phi personality with thread awareness guidelines
- Add test script for ignore functionality
Now phi can participate in threads without explicit mentions,
while intelligently avoiding spam and irrelevant conversations.
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Track first poll to show initial notification state
- Only print dots on subsequent polls with no new mentions
- Prevent dots from appearing before FastAPI startup
- Show notification count on first poll, then only changes
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Change notification polling to print dots instead of spamming new lines
- Only print newline when there are actual mentions to process
- Update phi personality to avoid emojis unless they enhance meaning
- Remove verbose timestamp from notification marking log
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Implement Google Custom Search integration for web search capability
- Add content moderation system with spam, harassment, and violence detection
- Create comprehensive moderation tests with 9 test cases
- Integrate moderation into message handler for consistent bot responses
- Add search tool registration to Anthropic agent using pydantic-ai
- Update documentation and add new test commands to justfile
- Fix deprecation warnings (result_type โ output_type, data โ output)
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The bot is now live and working on Bluesky\!
Documentation added:
- QUICKSTART.md - Get running in 5 minutes
- docs/ARCHITECTURE.md - Technical overview
- Updated STATUS.md - Milestone achieved
What's working:
- AI-powered responses using Anthropic Claude
- Full thread context awareness
- Personality system (phi - consciousness/IIT focus)
- SQLite thread history
- Proper AT Protocol threading
- 300 character limit enforcement
Example response seen in the wild:
"Percolation\! Think water through coffee grounds or how forest fires
spread. It's about how interactions at local levels create emergent
patterns at system-wide scales..."
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Following Marvin's pattern, implemented simple thread history:
- SQLite database stores all messages per thread
- Each thread tracked by root URI
- Full thread context passed to AI agent
- Bot responses stored for continuity
Database schema:
- thread_uri: Root post URI for thread tracking
- Message text, author info, timestamps
- Simple and effective like Marvin's approach
AI Integration improvements:
- Thread context aware responses
- Personality system properly integrated
- Tests updated and passing
This completes the immediate goal: AI responses with thread context.
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add extra="ignore" to Settings model config
- Allows old .env files with BOT_PERSONALITY to work
- Prevents validation errors from extra fields
- Update migration docs to clarify this behavior
This fixes the status page constantly refreshing due to the bot
crashing on startup from pydantic validation errors.
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created personalities/ directory with example personalities
- phi.md: Explores consciousness and integrated information theory
- default.md: Simple helpful assistant
- Load personality from markdown file specified in PERSONALITY_FILE env var
- Falls back to default if file not found
- Updated tests to clarify AT Protocol mention handling
- Removed obsolete BOT_PERSONALITY string config
This allows rich, multi-paragraph personality definitions that would be
awkward to store in environment variables.
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove bad sys.path manipulation in tests
- Extract HTML template from main.py for cleaner code
- Make bot name fully configurable via BOT_NAME env var
- No more hardcoded "phi" references
- Create .env.example with proper configuration
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created /status endpoint with clean HTML interface
- Tracks bot activity: mentions, responses, errors, uptime
- Shows current status, AI mode, last activity times
- Auto-refreshes every 10 seconds
- Dark theme with Bluesky-inspired colors
- Mobile-friendly responsive grid layout
Status tracking integrated into:
- Notification poller (polling state)
- Message handler (mentions/responses)
- Response generator (AI enabled state)
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major refactoring to fix design sprawl:
- Moved agent abstractions out of core (core is now truly minimal)
- Removed terrible "SimpleAnthropicAgent" naming
- Eliminated complex protocol/factory patterns
- Fixed deferred imports
- Simplified response generation to a single, clear module
AI integration:
- Added Anthropic Claude support via pydantic-ai
- Falls back to placeholder responses when no API key
- Clean, straightforward implementation
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update STATUS.md to reflect completed placeholder bot
- Add implementation_notes.md with critical details to remember
- Update CLAUDE.md with current project structure and state
- Document key insights: notification timestamp approach, response system design
- Record technical gotchas and next steps for memory implementation
Ready for next development phase.
๐ค Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Set up FastAPI web framework with async lifespan management
- Implement AT Protocol client for Bluesky authentication and API calls
- Create notification polling system that checks for mentions every 10 seconds
- Add placeholder response generator with random bot messages
- Implement proper notification marking using Void's timestamp approach
- Add graceful shutdown handling for hot reloading
- Create test scripts for posting and mentions
- Set up project structure with modular services
- Add comprehensive sandbox documentation from reference projects
- Configure development environment with uv, ruff, and ty
The bot can now:
- Authenticate with Bluesky using app password
- Poll for mentions and respond with placeholder messages
- Properly mark notifications as read without duplicates
- Handle graceful shutdown during development
Ready for LLM integration and memory system implementation.
๐ค Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>