A local-first, file-based second brain architecture powered by Claude Code. Turn Claude into your personalised knowledge agent for understanding customers, identifying opportunities, and surfacing next best actions by bringing your business data directly into Claude Code.
Built by Brainqub3 — AI engineering consultancy shipping production-grade agents and automations for SMEs.
Claude can help you with any setup or customisation in this repo. Simply ask:
- "Help me configure the Google Calendar integration"
- "How do I connect a different CRM?"
- "Add a new data source for Slack messages"
- "Modify the CRM schema to include custom fields"
Claude has full context of this repository and can guide you through any changes.
git clone https://github.com/brainqub3/brainqub3.git
cd brainqub3
claude # Opens Claude Code in this directoryBefore using the agent, populate these two files with your information:
| File | Purpose |
|---|---|
ME.MD |
Your bio, expertise, communication preferences, operating principles |
BUSINESS.MD |
Your offerings, positioning, target audience, proof points |
These files give Claude the context it needs to provide personalised assistance.
See Integrations below for setting up Google Calendar, Zoho CRM, etc.
brainqub3/
├── CLAUDE.MD # Agent instructions and orchestration rules
├── ME.MD # Personal context (edit this first)
├── BUSINESS.MD # Business offerings (edit this first)
├── raw/ # Immutable source data (append-only, never edit)
│ ├── calendars/ # Calendar exports
│ │ └── gcal/ # Google Calendar events
│ ├── crm/ # CRM data
│ │ ├── crm.db # SQLite database (leads, history, sync log)
│ │ ├── customers/ # Customer records
│ │ └── leads/ # Lead records
│ ├── gmail/ # Email data
│ │ ├── inbound/ # Inbound emails
│ │ └── meeting-summaries/
│ ├── linkedin/ # LinkedIn exports
│ │ ├── archive/ # Historical exports
│ │ └── Connections.csv
│ ├── meetings/ # Meeting notes from Gemini summaries (.txt files)
│ └── youtube/ # YouTube data
│ ├── analytics/
│ └── comments/
├── kb/ # Knowledge base (agent-writable)
│ ├── customers/ # Customer profiles and insights
│ ├── people/ # Individual contact profiles
│ ├── orgs/ # Organisation profiles
│ ├── offers/ # Offering definitions
│ ├── insights/ # Patterns and observations
│ ├── playbooks/ # Repeatable processes
│ ├── decisions/ # Key decisions with rationale
│ └── glossary.md # Terms and definitions
├── state/ # Machine state
│ ├── cache/ # Query and retrieval caches
│ ├── checkpoints/ # Processing checkpoints
│ ├── manifest.jsonl # Processing manifest
│ └── rlm-scopes.yaml # RLM scope definitions
├── scripts/ # Utility scripts
│ ├── ingest/ # Data ingestion (gcal_fetch.py, requirements.txt)
│ ├── crm/ # CRM database schema (db_schema.sql)
│ ├── normalise/ # Data normalisation scripts
│ ├── maintenance/ # Maintenance utilities
│ └── sync_zoho_leads.py # Zoho CRM sync script
└── .claude/ # Claude Code configuration
├── agents/ # Sub-agent prompts
│ ├── calendar-fetch.md
│ ├── crm-lead-retriever.md
│ ├── external-research.md
│ └── rlm-subcall.md
├── skills/ # Skill definitions
│ ├── crm-sync/
│ ├── kb-update/
│ └── rlm/
└── settings.local.json
| Layer | Read/Write | Purpose |
|---|---|---|
raw/ |
Read-only | Immutable source dumps. Never edit after ingestion. |
kb/ |
Read/Write | Your curated knowledge base. Safe for Claude to update. |
state/ |
Read/Write | Machine-managed state, caches, checkpoints. |
ME.MD / BUSINESS.MD |
Read/Write | Your personal and business context. |
The main instruction file that tells Claude how to behave as your second brain agent. It defines:
- Data access policies (what to read, what to write)
- Query workflows and response formats
- Sub-agent orchestration rules
- Privacy and quality guardrails
Your personal profile. Include:
- Bio and background
- Technical expertise
- Operating principles
- Communication preferences
- Current focus areas
Your business context. Include:
- Company offerings (problem → outcome → who it's for)
- Positioning and differentiators
- Target audience
- Proof points and case studies
The system includes specialised sub-agents for different tasks:
| Agent | File | Purpose |
|---|---|---|
| Calendar Fetch | .claude/agents/calendar-fetch.md |
Fetches Google Calendar events to raw/calendars/ |
| CRM Lead Retriever | .claude/agents/crm-lead-retriever.md |
Syncs leads from Zoho CRM to the local SQLite database |
| External Research | .claude/agents/external-research.md |
Web research for current events, competitors, pricing |
| RLM Subcall | .claude/agents/rlm-subcall.md |
Extracts relevant info from large contexts |
Skills are reusable workflows invoked with /command syntax:
| Skill | Command | Purpose |
|---|---|---|
| RLM | /rlm |
Long-context retrieval over local files (meetings, CRM, kb) |
| KB Update | /kb-update |
Safely write and link knowledge to kb/ |
| CRM Sync | /crm-sync |
Sync leads from Zoho CRM into local SQLite |
The RLM skill uses a chunked, iterative approach to process large contexts without "context rot" (degradation of quality as context grows). It works best when explicitly invoked for high-complexity tasks.
Use /rlm explicitly when:
- Processing 100+ documents (e.g., all meeting notes, full email history)
- Building or updating the knowledge base from raw data
- Identifying patterns across many sources (e.g., recurring customer objections)
- Performing deep analysis that requires iterative refinement
- Working with contexts that exceed comfortable single-pass processing
You don't need /rlm for:
- Simple lookups in a few files
- Questions about recent meetings (1-5 files)
- Quick CRM queries
- Single-document analysis
Example usage:
/rlm context=raw/meetings query="Identify all partnership opportunities discussed across meetings and who proposed them"
For shorter contexts, Claude will handle retrieval automatically without needing RLM.
CRM data is stored in a SQLite database at raw/crm/crm.db. The schema (scripts/crm/db_schema.sql) includes:
| Table | Purpose |
|---|---|
leads |
Current state of all CRM leads |
leads_history |
Full audit trail of all changes (insert/update/delete) |
sync_log |
Metadata for each sync operation |
A Zoho CRM MCP server is already connected. To use it:
- Configure your Zoho OAuth credentials
- Use
/crm-syncto pull leads into the local database - Query your leads naturally: "Show me all leads from last week"
The current schema is designed for Zoho Leads. You may want to:
- Add custom fields specific to your CRM
- Change field names to match a different CRM provider
- Add new tables for other CRM objects (Contacts, Deals, etc.)
Just ask Claude: "Help me modify the CRM schema to add a 'deal_value' field"
The repo includes a Google Calendar fetch script (scripts/ingest/gcal_fetch.py) for pulling calendar events.
-
Create OAuth credentials in Google Cloud Platform:
- Go to GCP Console
- Create a new project (or use existing)
- Enable the Google Calendar API
- Create OAuth 2.0 credentials (Desktop app type)
-
Set environment variables in
scripts/.env:GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com GOOGLE_CLIENT_SECRET=your-client-secret
-
Install dependencies and authenticate:
pip install -r scripts/ingest/requirements.txt python scripts/ingest/gcal_fetch.py auth
-
Fetch events:
python scripts/ingest/gcal_fetch.py fetch # Next 7 days python scripts/ingest/gcal_fetch.py fetch --days 30 # Next 30 days
Events are saved to raw/calendars/gcal/.
You can extend the system with your own APIs and data sources:
- Add ingestion scripts to
scripts/ingest/ - Store raw data in
raw/<source-name>/ - Ask Claude to help: "Create an integration to fetch Slack messages"
This repo is designed to be customised. Claude can help you:
- Add new data sources: Gmail, Notion, Jira, Slack, etc.
- Change CRM providers: HubSpot, Salesforce, Pipedrive, etc.
- Create new sub-agents: Specialised agents for your workflows
- Modify the knowledge base structure: Adapt
kb/to your needs - Build automation scripts: Data processing, reporting, alerts
Just ask: "Help me add a HubSpot integration" or "Create an agent for weekly reporting"
Once configured, you can ask Claude things like:
- "What did I discuss with Acme Corp in our last meeting?"
- "Show me all leads from Q4 who mentioned pricing concerns"
- "What are the common objections I'm hearing from prospects?"
- "Draft a follow-up email based on yesterday's call"
- "What should I prioritise this week based on my calendar and pipeline?"
- "Update my knowledge base with insights from today's meetings"
This repository is not a production system. It's a template and starting point for building your own personalised productivity agent. You should:
- Customise the schema for your specific needs
- Add integrations relevant to your workflow
- Extend the agents and skills as needed
- Treat it as a foundation to build upon
- All data stays local on your machine
- Raw data in
raw/is treated as sensitive by default - Claude won't include PII in responses unless explicitly requested
This project is maintained by Brainqub3.
For questions, customisation help, or to discuss building production AI agents for your business, visit brainqub3.com.
See LICENSE for details.