Commit Graph

127 Commits

Author SHA1 Message Date
Ryan Chen
a7726654ff Add testing instructions to CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 08:51:50 -04:00
Ryan Chen
c8306e6702 Add unit test suite with pytest configuration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 08:48:45 -04:00
ryan
cfa77a1779 Add FERNET_KEY env var to docker-compose for email encryption
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:30:45 -04:00
ryan
9f69f0a008 Add Makefile for deploy, migration, and dev commands
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:22:01 -04:00
Ryan Chen
18ef611134 Merge origin/main: resolve conflicts keeping both email/Mealie and WhatsApp/Mailgun/Obsidian work
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 08:19:50 -04:00
ryan
c9b6de9563 no more reindexing 2026-04-04 08:15:31 -04:00
ryan
2fcf84f5d2 Merge pull request 'fix/ynab-transaction-limit' (#16) from fix/ynab-transaction-limit into main
Reviewed-on: #16
2026-04-04 08:14:30 -04:00
Ryan Chen
142fac3a84 Switch image analysis from Ollama to llama-server
Use the same llama-server (OpenAI-compatible API) for vision analysis
that the main agent uses, with OpenAI fallback. Sends images as base64
in the standard OpenAI vision message format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 08:06:51 -04:00
Ryan Chen
0415610d64 Add image upload and vision analysis to Ask Simba chat
Users can now attach images in the web chat for Simba to analyze using
Ollama's gemma3 vision model. Images are stored in Garage (S3-compatible)
and displayed in chat history.

Also fixes aerich migration config by extracting TORTOISE_CONFIG into a
standalone config/db.py module, removing the stale aerich_config.py, and
adding missing MODELS_STATE to migration 3.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 08:03:19 -04:00
Ryan Chen
ac9c821ec7 Remove client-side transaction limit from YNAB service
The get_transactions() method was truncating results to 50 by default,
causing incomplete transaction data. The YNAB API returns all matching
transactions in a single response, so this limit was unnecessary and
caused count/total inconsistencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 21:46:51 -04:00
ryan
0f88d211de Add PWA support for install-to-home-screen
Adds manifest.json, service worker with static asset caching,
resized cat icons, and meta tags for iOS/Android installability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 20:16:27 -04:00
ryan
6917f331d8 Fix circular import in email helpers
Move blueprints.email.helpers import from module-level to inside the
endpoint functions that use it, breaking the circular dependency chain.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 16:54:48 -04:00
ryan
6a7b1369ad Add email channel via Mailgun for Ask Simba
Users can now receive a unique email address (ask+<token>@domain) and
interact with Simba by sending emails. Inbound emails hit a Mailgun
webhook, are authenticated via HMAC token lookup, processed through the
LangChain agent, and replied to via the Mailgun API.

- Extract shared SIMBA_SYSTEM_PROMPT to blueprints/conversation/prompts.py
- Add email_enabled and email_hmac_token fields to User model
- Create blueprints/email with webhook, signature validation, rate limiting
- Add admin endpoints to enable/disable email per user
- Update AdminPanel with Email column, toggle, and copy-address button
- Add Mailgun env vars to .env.example
- Include database migration for new fields

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 16:21:18 -04:00
ryan
4621755c54 Make cat icons even bigger across all views
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 16:05:53 -04:00
ryan
b6cd4e85f0 Fix mobile viewport scroll and enlarge cat icons
Use 100dvh for proper mobile browser chrome handling and increase
cat icon sizes across sidebar, mobile header, and empty state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 16:03:40 -04:00
ryan
30d7f0a060 Fix YNAB transaction fetching for SDK v2 compatibility
- Convert date strings to datetime.date objects before passing to API (strict Pydantic validation rejects strings)
- Use txn.var_date instead of txn.date (renamed in SDK v2 to avoid Python builtin conflict)
- Migrate BudgetsApi → PlansApi and update method names accordingly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 18:54:20 -04:00
ryan
da9b52dda1 Add Claude.ai-style homepage with centered empty state
Show centered cat icon + "Ask me anything" + input when no messages
exist. Transition to scrollable messages + bottom input once chat
starts. Auto-create a conversation on first message if none selected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 09:47:37 -04:00
ryan
d1cb55ff1a Frontend revamp: Animal Crossing × Claude design with shadcn components
- New palette: deep nook green sidebar, sage user bubbles, warm cream answer cards
- shadcn-style UI primitives: Button (CVA variants), Textarea, Input, Badge, Table
- cn() utility (clsx + tailwind-merge)
- lucide-react icons throughout (no more text-only buttons)
- Simba mode: custom CSS toggle switch
- Send button: circular amber button with arrow icon
- AnswerBubble: amber gradient accent bar, loading dots animation
- QuestionBubble: sage green pill with rounded-3xl
- ToolBubble: centered leaf-green badge pill
- ConversationList: active item highlighting, proper selectedId prop
- Sidebar: collapsible with PanelLeftClose/Open icons, icon-only collapsed state
- LoginScreen: decorative background blobs, refined rounded card
- AdminPanel: proper icon buttons, leaf-green save confirmation
- Fonts: Playfair Display (brand) + Nunito 800 weight added

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 09:22:34 -04:00
ryan
53b2b3b366 Add admin panel and fix simba mode response display
- Add /me, /admin/users, and WhatsApp link/unlink endpoints
- Add AdminPanel component with user management UI
- Add userService methods for admin API calls
- Fix simba mode so cat responses appear in the message list
- Fetch userinfo endpoint for groups on OIDC callback (Authelia compat)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 09:06:59 -04:00
ryan
03c7e0c951 Fix double space in daily note header template
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 08:27:49 -05:00
ryan
97be5262a8 new feature 2026-03-03 08:23:31 -05:00
ryan
86cc269b3a yeet 2026-03-03 08:23:31 -05:00
ryan
0e3684031b Merge pull request 'Replace blue/indigo sidebar colors with warm stone neutrals' (#15) from worktree-crispy-whistling-snowglobe into main
Reviewed-on: #15
2026-03-03 08:19:32 -05:00
ryan
6d7d713532 Replace blue/indigo sidebar colors with warm stone neutrals
Align ConversationList colors with Anthropic design guidelines,
replacing indigo-300/blue-400 with stone-200/stone-300.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 08:18:08 -05:00
Ryan Chen
e6ca7ad47a docs(01): complete foundation phase
Phase 1: Foundation - All success criteria met
- Database models with encrypted credentials
- IMAP connection service
- Email body parser
- Verification passed (4/4 must-haves)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-08 09:43:48 -05:00
Ryan Chen
f5f661acba docs(01-02): complete IMAP connection & email parsing plan
Tasks completed: 2/2
- Task 1: IMAP connection service with authentication and folder listing
- Task 2: Email body parser for multipart MIME messages

SUMMARY: .planning/phases/01-foundation/01-02-SUMMARY.md
2026-02-08 09:39:49 -05:00
Ryan Chen
e4084276d8 feat(01-02): create email body parser for multipart MIME messages
- Implemented parse_email_body function for RFC822 email parsing
- Uses stdlib email.message_from_bytes with modern EmailMessage API
- Extracts text and HTML bodies using get_body() method
- Prefers plain text over HTML for "preferred" field
- Converts HTML to text using html2text when text body missing
- Extracts all metadata: subject, from, to, date, message_id
- Uses parsedate_to_datetime for proper date parsing
- Handles UnicodeDecodeError gracefully with partial data return
- Follows async patterns and logging conventions from existing codebase
2026-02-08 09:34:47 -05:00
Ryan Chen
6e4ee6c75e feat(01-02): implement IMAP connection service with authentication and folder listing
- Created IMAPService class with async connect/list_folders/close methods
- Uses aioimaplib for async IMAP4_SSL operations
- Implements proper connection cleanup with logout() not close()
- Added aioimaplib and html2text dependencies to pyproject.toml
- Follows async patterns from existing service classes (ynab_service.py, mealie_service.py)
- Includes comprehensive logging with [IMAP] and [IMAP ERROR] prefixes
2026-02-08 09:33:59 -05:00
Ryan Chen
43dd05f9d5 chore(01-01): add FERNET_KEY config and email tables migration
- Add FERNET_KEY to .env.example with generation instructions
- Register email.models in aerich_config.py and app.py
- Register email blueprint in app.py
- Create database migration for email_accounts, email_sync_status, emails
- Migration includes proper foreign keys and indexes
2026-02-08 09:15:23 -05:00
Ryan Chen
bee63d1c60 feat(01-01): create email blueprint with encrypted Tortoise ORM models
- Add EncryptedTextField for transparent Fernet encryption
- Create EmailAccount model with encrypted IMAP credentials
- Create EmailSyncStatus model for sync state tracking
- Create Email model with 30-day retention logic
- Follow existing blueprint patterns from users/conversation
2026-02-08 09:08:32 -05:00
Ryan Chen
800c6fef7f docs(01): create phase plan
Phase 01: Foundation
- 2 plan(s) in 2 wave(s)
- 1 parallel, 1 sequential
- Ready for execution
2026-02-07 13:35:48 -05:00
Ryan Chen
126b53f17d docs(1): research phase domain
Phase 1: Foundation
- Standard stack identified (aioimaplib, email, cryptography, Quart-Tasks)
- Architecture patterns documented (encrypted fields, IMAP lifecycle, parsing)
- Pitfalls catalogued (connection limits, encoding, key loss, sync state, IDLE, HTML bloat)
2026-02-07 13:31:42 -05:00
Ryan Chen
38d7292df7 docs: create roadmap (4 phases)
Phases:
1. Foundation: Database models and IMAP utilities
2. Account Management: Admin UI for email configuration (ACCT-01 to ACCT-07)
3. Email Ingestion: Sync engine and retention cleanup (SYNC-01 to SYNC-09, RETN-01 to RETN-05)
4. Query Tools: LangChain email analytics (QUERY-01 to QUERY-06)

All v1 requirements mapped to phases.
2026-02-07 13:18:57 -05:00
Ryan Chen
8a8617887a docs: define v1 requirements
25 requirements across 4 categories
Email account management, sync, retention, and query features
2026-02-07 13:15:46 -05:00
Ryan Chen
ea1b518497 chore: add project config
Mode: yolo
Depth: quick
Parallelization: enabled
Workflow agents: research=on, plan_check=on, verifier=on
2026-02-04 18:25:01 -05:00
Ryan Chen
f588403612 docs: initialize project
Personal RAG system with email inbox analytics integration
2026-02-04 18:02:40 -05:00
Ryan Chen
b0b02d24f4 docs: map existing codebase
- STACK.md - Technologies and dependencies
- ARCHITECTURE.md - System design and patterns
- STRUCTURE.md - Directory layout
- CONVENTIONS.md - Code style and patterns
- TESTING.md - Test structure
- INTEGRATIONS.md - External services
- CONCERNS.md - Technical debt and issues
2026-02-04 16:53:27 -05:00
Ryan Chen
6ae36b51a0 ynab update 2026-01-31 22:47:43 -05:00
ryan
f0f72cce36 Merge pull request 'Replace Ollama with llama-server (OpenAI-compatible API)' (#14) from feature/llama-cpp-integration into main
Reviewed-on: #14
2026-01-31 21:41:19 -05:00
Ryan Chen
32020a6c60 Replace Ollama with llama-server (OpenAI-compatible API)
- Update llm.py to use OpenAI client with custom base_url for llama-server
- Update agents.py to use ChatOpenAI instead of ChatOllama
- Remove unused ollama imports from main.py, chunker.py, query.py
- Add LLAMA_SERVER_URL and LLAMA_MODEL_NAME env vars
- Remove ollama and langchain-ollama dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 21:39:23 -05:00
Ryan Chen
713a058c4f Adding roadmap 2026-01-31 17:28:53 -05:00
Ryan Chen
12f7d9ead1 fixing dockerfile 2026-01-31 17:17:56 -05:00
Ryan Chen
ad39904dda reorganization 2026-01-31 17:13:27 -05:00
Ryan Chen
1fd2e860b2 nani 2026-01-31 16:47:57 -05:00
Ryan Chen
7cfad5baba Adding mkdocs and privileged tools 2026-01-31 16:20:35 -05:00
ryan
f68a79bdb7 Add Simba facts to system prompt and Tavily API key config
Expanded the assistant system prompt with comprehensive Simba facts including
medical history, and added TAVILY_KEY env var for web search integration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 16:08:41 -05:00
ryan
52153cdf1e dockerfile 2026-01-11 17:35:43 -05:00
ryan
6eb3775e0f Merge pull request 'Adding web search infra' (#13) from rc/langchain-migration into main
Reviewed-on: #13
2026-01-11 17:35:36 -05:00
Ryan Chen
b3793d2d32 Adding web search infra 2026-01-11 17:35:05 -05:00
ryan
033429798e Merge pull request 'RAG optimizations' (#12) from rc/langchain-migration into main
Reviewed-on: #12
2026-01-11 09:36:59 -05:00