GBrain for BOS
This MCP server provides a cost-optimized personal-knowledge brain, enabling AI agents to query imported documents via hybrid search and synthesis at minimal monthly spend.
README
GBrain for BOS
A cost-optimized personal-knowledge brain for running The Builders' Ops Studio.
This is a fork of garrytan/gbrain (MIT, 27.9k★) tuned for a single-operator boutique consultancy at minimum monthly spend.
What's different from upstream
- Default cost posture: ~$1–5/mo for active use. Upstream defaults assume enterprise scale.
- Conservative search mode + Google Gemini free tier + Haiku synthesis set as the install defaults. Zero new-account cost (Gemini uses your existing Google login). Zero surprise bills.
skills/bos-cost-optimization/— operating manual for keeping spend at floor.- Brain Cost Tracker schema documented in this README so the spend is auditable, not implicit.
The engine, hybrid search, MCP server, OAuth admin, and 43 upstream skills are unchanged. They're excellent. Don't fork what works.
Quick start (cost-optimized)
# 1. Install
curl -fsSL https://bun.sh/install | bash
export PATH="$HOME/.bun/bin:$PATH"
bun install -g github.com/cynthiajones34/GBrain
# 2. Set the API keys BEFORE init so the picker auto-selects the cheapest recipe
export GOOGLE_GENERATIVE_AI_API_KEY=<from https://aistudio.google.com/apikey>
export ANTHROPIC_API_KEY=<from https://console.anthropic.com>
# 3. Init with PGLite (zero infra cost) and Gemini free-tier embeddings
gbrain init --pglite --model google:gemini-embedding-001 --embedding-dimensions 768
# 4. Force conservative search mode (smallest token budget)
gbrain config set search.mode conservative
gbrain config set synthesis.expansion false
gbrain config set synthesis.model claude-haiku-4-5
# 5. Wire as MCP memory to your existing Hermes Agent
gbrain serve --http &
gbrain connect https://your-hermes-host/mcp --install
# 6. Import your existing Notion content (free tier covers ~500 pages)
gbrain import ~/notion-export/
# 7. Verify
gbrain doctor
gbrain think "what did I work on with [client name]?"
Cost target
| Component | Choice | Monthly cost |
|---|---|---|
| Database | PGLite embedded | $0 |
| Embeddings | Google Gemini gemini-embedding-001 (768d, free tier: 1,500 req/day) |
$0 |
| Reranker | (none — hybrid retrieval uses vector + BM25 + RRF) | $0 |
| Search mode | conservative (4K token budget) | $0 |
| Synthesis | Haiku 4.5 | $0.80–2.50 |
| LLM expansion | OFF | $0 |
| Total at 1K queries/mo | ~$1–2.50 |
Anything above $5/mo means a knob has drifted. See skills/bos-cost-optimization/SKILL.md.
Tracking spend
All actual spend is logged to the Brain Cost Tracker database in your Notion HQ. Each cost event records service, use case, cost, query count, tokens, model, and an optimization flag. Daily audit cron surfaces drift within 24 hours.
When to upgrade (only after measuring)
conservative→balancedsearch mode: only if recall tests fail- Haiku → Sonnet synthesis: only if
gbrain thinkanswers hallucinate facts you know are in the brain - PGLite → Supabase: only at 50K+ pages or multi-machine access
Never upgrade two knobs at once. You won't know which change caused what.
What's upstream, unchanged
All credit for the engine, search stack, MCP server, OAuth admin, dream cycle, and eval framework goes to Garry Tan and the gbrain contributors. This fork adds cost discipline; it does not replace engineering.
Read skills/RESOLVER.md for skill routing. Read CLAUDE.md if you're Claude Code working on this fork.
License + credit
MIT. Engine and architecture © Garry Tan and gbrain contributors. Cost-optimization layer © Cynthia Jones / The Builders' Ops Studio.
Upstream: github.com/garrytan/gbrain Fork: github.com/cynthiajones34/GBrain
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.