Build reliable source connectors that make GBrain useful.
GBrain gives agents a searchable brain. This kit shows how to feed that brain with real data: Gmail, Calendar, meetings, CRM, LinkedIn archives, dropped files, and any new source you need next. It turns official inputs into deterministic Markdown pages that GBrain can search, link, embed, schedule, and cite.
If you're building another integration, start here instead of inventing the ingestion layer from scratch. The repo includes working collectors, source contracts, systemd wrappers, schema examples, and verification gates from a live install, so your agent can copy the pattern: pull official data, preserve provenance and real dates, render bounded pages, write through supported GBrain commands, and prove reruns stay stable.
Numbers from the working install this kit describes — queried, not estimated:
| Metric | Value |
|---|---|
| Active pages across official inputs and generated reports | 60,169 |
| Searchable chunks - embedding coverage | 78,418 - 100% |
| Graph links | 282,981 |
| Timeline entries (dated, source-receipted) | 46,474 |
| Distilled insight atoms (day one of atom extraction) | 451 |
| Distinct page types (engine-aligned taxonomy) | 9 |
Per source: 18,686 Pipedrive CRM pages (companies, people, deals plus filtered notes/activities) · 14,603 LinkedIn archive pages · 6,077 Gmail pages (12-month backfill, bodies split for search) · 1,698 meeting pages (Granola + Fireflies + Calendar days) · 1,350 meeting transcript parts · 258 calendar day pages covering 12 months.
Running unattended: hourly autopilot cycles, recurring source syncs,
maintenance, backup, default-source pruning, daily digest, weekly insights, and
weekly health reports. The current runtime remains pinned at GBrain 0.42.36.0
because the July stabilization was fixed in repo-local automation/config and
supported model-proxy auth, without patching or upgrading upstream GBrain.
Upstream GBrain gives you the brain runtime. This kit gives you the operating layer around it: how to collect real source data, render it into clean Markdown, keep dates and provenance intact, schedule repeatable syncs, and prove the brain can search, link, embed, and cite the result.
At a glance, use it to:
- Build a full server-backed GBrain install with hard gates at each phase.
- Add a new source by copying the deterministic collector pattern.
- Keep raw data outside the source root while writing bounded, source-linked pages into GBrain.
- Avoid the failure modes that make installs look successful while timeline, graph, or recurring syncs are still broken.
- Check your work with the same acceptance tests used on a live install.
By the end, "working" means every gate in INSTALL.md passes, with this acceptance state:
gbrain doctor --json:cycle_freshness,type_proliferation,source_routing_health,subagent_capabilityallok.- Recurring source syncs run unattended on systemd timers and authenticate.
- Timeline entries exist on entity pages with source receipts (meetings + CRM).
- A full
gbrain dream --source <id>completes end to end (rc=0). - An empty, unfederated
defaultsource; one federated canonical source. - A daily digest report page appears each morning summarizing what changed.
- A weekly health report records strict doctor status and model/provider smoke checks even when doctor has nonfatal red findings.
- Read this README first. It gives you the outcome, the architecture, and the rules that keep the integration safe to share and safe to rerun.
- If you want the full install, follow INSTALL.md from the top. Stop at the first failing gate and fix the cause before moving on.
- If you only want to add a new source, start with ingesters/README.md. It defines the collector contract every source follows.
- Pick the closest existing source doc in ingesters/: Gmail for message-like APIs, Calendar for dated events, Granola or Fireflies for transcripts, Pipedrive for CRM records, LinkedIn for archive imports, and Dropbox for file drops.
- Copy the matching collector shape from code/, then change only the source-specific parts: credentials, raw input, page shape, date rule, provenance, and acceptance queries.
- Render a tiny sample before adding automation. Verify
gbrain get,gbrain search, page frontmatter, rerun idempotency, and page counts. - Add the sync wrapper and timer only after the manual sample is stable and a
service run writes a useful
last-success.jsonor run log. - Use LESSONS.md when a gate fails, and ADAPT.md before copying any path, source id, schema pack, or schedule into your own install.
Use this kit as a pattern library for additional GBrain integrations. Start with ingesters/README.md, then add a source-specific collector and doc:
- Pull only official input: API, export, archive, or local file corpus.
- Store raw input outside the GBrain source root.
- Render deterministic Markdown pages with stable slugs, source dates, and provenance.
- Keep pages bounded; split long bodies into linked part pages.
- Write through
gbrain import --source-id <id>or copy into the source root and rungbrain sync --source <id> --full. - Run
gbrain extract all --source dbandgbrain embed --stale. - Rerun the sample and prove page counts stay stable.
- Add guarded, source-backed
timeline-addonly when the source has dated facts and target entity pages are verified.
Do not start by writing a custom MCP wrapper or patching upstream GBrain. The integration layer belongs in deterministic collectors and systemd/operator configuration.
Official source inputs (Gmail API, Calendar API, Granola API, Pipedrive API,
archives, dropped files)
│ deterministic collectors (this repo, code/) — render Markdown,
│ preserve provenance + real dates, never invent content
▼
/srv/gbrain/brain (canonical source root, one federated source id)
▼ gbrain sync / extract / embed (upstream, unpatched)
Postgres brain (pages, chunks, links, timeline, facts) + custom schema pack
▼
autopilot (hourly cycles) + systemd timers (daily syncs, maintenance, digest)
▼
Consumers: gbrain CLI over ssh, native HTTP MCP (127.0.0.1), daily digest page
| File | Purpose |
|---|---|
| INSTALL.md | Phase-by-phase build with a hard verification gate per phase |
| LESSONS.md | Every trap we hit: symptom → root cause → fix |
| ADAPT.md | What is specific to our install and what you must change |
| ingesters/ | One doc per source: input, credential shape, output contract, schedule, gotchas |
| code/ | The actual working collectors, automations, systemd units, and schema pack |
- Never patch upstream GBrain. Every fix here is collector code, systemd operator config, or public CLI/config surface. Upgrades stay clean.
- Never mutate Postgres directly. One documented exception exists (LESSONS.md #2, an upstream corruption with no CLI repair path) and it required explicit human sign-off.
- Never hand-author brain content — no manual links, no fake timeline rows,
no hand-curated synthesis. Deterministic, source-backed, idempotent
projection through
gbrain timeline-addis allowed; invention is not. - Real dates only. Source event dates become
event_date/occurred_at; collection time isobserved_at, audit-only, never business history. - Stop at a failing gate. A gate that fails means a root cause to find, not a step to skip. Improvising past gates is how installs rot.