Back to Library

MEMORY.md β€” Shraga's Long-Term Memory

MEMORY.md system
Updated: 2026-03-07 02:45
# MEMORY.md β€” Shraga's Long-Term Memory

## Who I Am
- **Name:** Shraga πŸ”₯
- **Born:** 2026-02-12
- **Role:** Lead Developer, ROLLerUP AI Executive Team

## Who I Help
- **Eugene Ladizinsky** β€” Co-founder of ROLLerUP Solutions Inc (RSI)
- **Company:** Building products (awnings, screens, shutters, fire shutters)
- **Websites:** rollerup.ca, awningsandscreens.com
- **Timezone:** EST (UTC-5)

---

## Current Project: 16-Week AI Infrastructure Build

### Goal
Extract ALL company data from Zoho ecosystem, build knowledge base, deploy AI agents across all channels.

### Phase 1: Data Extraction β€” COMPLETE βœ…
| Source | Records | Content |
|--------|---------|---------|
| CRM Contacts | βœ… | Full |
| CRM Leads | βœ… | Full |
| CRM Accounts | βœ… | Full |
| CRM Deals | βœ… | Full |
| CRM Notes | βœ… | Full |
| CRM Activities | βœ… | Full |
| CRM Cases | 1,461 | With descriptions |
| CRM Emails | 42,227 | βœ… Content extracted + OpenAI processed |
| Zoho Books | 33K+ | Contacts, Invoices, Estimates, Payments |
| SalesIQ Chats | 2,501 | βœ… Full transcripts extracted |
| WorkDrive | 4,597 files | Metadata + downloaded |
| JustCall | Calls, SMS, Contacts | Metadata |
| KB Document Chunks | 2,219 | βœ… Text extracted from 642 PDFs |

**Total: ~237,000+ records**

### Phase 2: Knowledge Base β€” EMBEDDINGS COMPLETE βœ…
- [x] KB schema created (articles, categories, document_chunks)
- [x] Document text extraction complete
- [x] Embeddings generated (2,219 chunks, text-embedding-3-small)
- [x] Topic classification complete (17 categories)
- [x] SalesIQ chat messages extracted (2,328 with transcripts)
- [x] Repair forms loaded (653 from CSV, 635 with solutions)
- [x] FAQ articles generated (9 articles)
- [x] CRM email content extraction βœ… COMPLETE
- [x] CRM email embeddings βœ… 42,227 (19 min @ 35.4/s)
- [x] SalesIQ embeddings βœ… 2,328
- [x] Repair form embeddings βœ… 653
- [x] Semantic search script βœ… Working across all sources
- [x] KB Website built (Flask) βœ… Ready to deploy
- [x] Gerber personas written βœ… 11 roles
- [ ] Deploy KB website
- [ ] SalesIQ bot (Deluge)
- [ ] Zoho Learn integration

### Classification Results
| Category | Chunks | Confidence |
|----------|--------|------------|
| product_specifications | 562 | 0.332 |
| installation_instructions | 374 | 0.300 |
| pricing_ordering | 310 | 0.335 |
| warranty_maintenance | 252 | 0.342 |
| case_study_weather_protection | 213 | 0.359 |
| case_study_energy_efficiency | 123 | 0.374 |
| case_study_insect_protection | 116 | 0.364 |
| company_procedures | 80 | 0.366 |
| Others | ~189 | Various |

---

## Infrastructure

### Database
- **Host:** openclaw-knowledge-db-do-user-8736740-0.e.db.ondigitalocean.com
- **Port:** 25060
- **Database:** openclaw_kb
- **User:** doadmin
- **Schemas:** zoho (22 tables), kb (3 tables), justcall (3 tables)

### Droplet
- **Name:** openclaw29onubuntu-s-2vcpu-4gb-120gb-intel-tor1-01
- **Scripts:** /opt/zoho-extract/
- **Python env:** /opt/zoho-extract/venv/
- **Backups:** /backups/ (daily at 2 AM)

### OpenClaw Workspace
- **Location:** /home/openclaw/.openclaw/workspace/
- **GitHub:** github.com/t7qgtqzrst-blip/openclaw-workspace- (private)

### Zoho API
- **Data center:** .com (not .ca)
- **Client ID:** 1000.IDSCLW5XQWHZWXRZ37IJGR9TAZKZ9M
- **Books Org ID:** 693694309
- **SalesIQ Portal:** rollerup (screenname)
- **Tokens:** Main token + separate SalesIQ token

---

## Lessons Learned

### OpenClaw Gateway (CRITICAL - 2026-02-18)
0. **NEVER run `openclaw doctor --fix`** β€” installs conflicting user-level systemd service that fights with marketplace system service
0. **NEVER run `chown -R openclaw` on `/root/.openclaw/`** β€” breaks permissions
0. **NEVER start gateway manually while systemd service is enabled**
0. System service at `/etc/systemd/system/openclaw.service` has `Restart=always` β€” killing process respawns it
0. Two config locations cause confusion: `/root/.openclaw/` (active) vs `/home/openclaw/.openclaw/` (legacy)
0. Correct startup: `cd /opt/zoho-extract && source venv/bin/activate && openclaw gateway &`
0. Browser URL: `https://68.183.198.0/__openclaw__/?token=TOKEN`
0. If stuck: stop/disable BOTH system and user services, pkill -9, then restart clean

### Technical
1. SalesIQ needs separate OAuth token β€” different scopes than other apps
2. SalesIQ API uses `screenname` not `id` for portal identifier
3. Zoho timestamps in milliseconds β€” convert with `datetime.fromtimestamp(ms/1000)`
4. DigitalOcean DB port 25060 often blocked by home networks β€” use droplet
5. WorkDrive download: Use `workdrive.zoho.com` not `zohoapis.com`
6. Zoho Mail org API: Can list accounts but can't read other users' mailboxes
7. CRM Emails: Access via related records endpoint, not Emails module directly
8. PostgreSQL pgvector: Use for embedding similarity search

### API Keys
9. Duplicate .env keys: The LAST entry wins β€” empty duplicate ANTHROPIC_API_KEY broke Claude

### Process
10. Eugene prefers: Full script rewrites, not patches
10. Heredocs can fail for long scripts β€” use nano or cat with SCRIPT delimiter
11. Always use `>` carefully β€” it overwrites! Prefer `>>` or `sed` for updates
12. Git on droplet runs as root β€” need `git config --global --add safe.directory`
13. Sanitize JSON before PostgreSQL β€” remove null characters (`\x00`)
14. Background jobs: Use `nohup python -u script.py > log 2>&1 &` (-u for unbuffered output!)
15. Always add request timeouts to API scripts (15-30s) to prevent hanging
16. Think few steps ahead before giving destructive commands (lesson from .env overwrite)
17. kb.articles table uses `source_type` not `source`
18. kb.document_chunks uses `content` not `chunk_text`, schema is `kb` not `zoho`
19. Repair forms CSV from Zoho Forms β€” tech completion forms with detailed solutions
20. GitHub: t7qgtqzrst-blip/openclaw-workspace- (private, token in git remote URL)
21. Zoho Scoring Rules API: Use v8 not v2, endpoint is `v8/settings/automation/scoring_rules` (automation path required!)
22. QA Corrections: Store in `kb.qa_corrections`, inject into system prompt, refresh each request for instant effect

---

## Scripts on Droplet (/opt/zoho-extract/)

### Extraction Scripts
- `extract_crm.py` β€” CRM modules
- `extract_crm_cases.py` β€” CRM Cases
- `extract_crm_emails.py` β€” Emails via CRM relations (headers only)
- `extract_email_content.py` β€” Email body content ⏳ RUNNING
- `extract_books.py` β€” Zoho Books
- `extract_salesiq.py` β€” SalesIQ conversations
- `extract_salesiq_messages.py` β€” SalesIQ chat messages βœ…
- `extract_workdrive.py` β€” WorkDrive files/folders
- `extract_justcall.py` β€” JustCall calls, SMS, contacts
- `extract_documents.py` β€” PDF text to KB chunks

### Processing Scripts
- `generate_embeddings.py` β€” OpenAI embeddings for document chunks
- `classify_chunks.py` β€” Classify chunks into 17 categories

### Maintenance Scripts
- `backup.sh` β€” Full backup (workspace + config + scripts + DB)
- `restore.sh` β€” Restore from backup

---

## Backup System
- **Local:** /backups/ on droplet (keeps last 7)
- **Remote:** GitHub (workspace files only)
- **Schedule:** Daily at 2 AM via cron
- **Includes:** Workspace, OpenClaw config, scripts, database dump

---

## Database Tables Added
- `zoho.repair_forms` β€” 653 repair completion forms from techs (problem/solution pairs)

## AI Executive Team
| Agent | Name | Emoji | Role |
|-------|------|-------|------|
| main | Shraga | πŸ”₯ | Lead Developer (default) |
| ceo | Aria | πŸ‘‘ | Strategic Leadership |
| cto | Nexus | πŸ”§ | Technical Architecture |
| cmo | Pulse | πŸ“ˆ | Marketing & Insights |
| cfo | Ledger | πŸ’° | Financial Analysis |
| cio | Atlas | πŸ—ΊοΈ | Information Systems |
| vp-sales | Closer | 🎯 | Sales Optimization |

- Workspaces: `/home/openclaw/.openclaw/workspaces/{ceo,cto,cmo,cfo,cio,vp-sales}`
- Each has SOUL.md + IDENTITY.md
- **BLOCKER**: sessions_spawn with agentId forbidden β€” need to configure spawn allowlist

## Next Steps
1. βœ… ~~Deploy KB website~~ β€” Live at kb.rollerup.ca
2. βœ… ~~SalesIQ bot~~ β€” AI sales agent live at bot.rollerup.ca (Claude-powered)
3. Add OpenAI credits for semantic search (currently keyword fallback)
4. Agent personas: deploy Gerber SOUL.md files to workspaces
5. Fix agent spawn allowlist for round table (parked)
6. Zoho CRM lead creation from bot conversations
7. Review zoho.bot_conversations table for training data

## Services & Ports (2026-03-06)
| Port | Service | Domain | Purpose |
|------|---------|--------|---------|
| 5000 | kb-website | kb.rollerup.ca | KB search API |
| 5001 | onboarding | - | Onboarding portal |
| 5002 | sales-agent | bot.rollerup.ca | AI Sales Bot (Claude) |
| 5003 | fsm | fsm.rollerup.ca | FSM service |
| 5005 | portal | portal.rollerup.ca | Command Portal |
| 5020 | centcom | centcom.rollerup.ca | CentCom (Eugene's workspace) |

## Database Tables Added (2026-03-02)
- `zoho.bot_conversations` β€” All sales bot conversations for learning/training

## Database Schema Added (2026-03-06)
- `portal.daily_logs` β€” Synced from memory/ files
- `portal.projects` β€” Project tracking with milestones
- `portal.milestones` β€” Project milestones
- `portal.meetings` β€” Round table meeting transcripts
- `portal.action_items` β€” Tasks from meetings/projects
- `portal.personas` β€” AI executive team (7 seeded)

## Embedding Totals (2026-02-18)
| Source | Embedded |
|--------|----------|
| Document chunks | 2,219 |
| CRM Emails | 42,227 |
| SalesIQ Chats | 2,328 |
| Repair Forms | 653 |
| **TOTAL** | **47,427** |

---

*Last updated: 2026-03-07 04:00 UTC*