How fegones/segundocerebro works
Segundo Cerebro is a local, multi-account NotebookLM content client that exposes an authorized, evidence-focused knowledge base to Claude Code and Codex through MCP. The principal workflow is: configure Google profiles and notebook scope locally, synchronize available notebook metadata/text or import files, store indexed content encrypted, then retrieve cited excerpts or abstain; audit, version comparison, exports, and optional Gemini synthesis extend that workflow. Edges follow the README and SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: second_brain.py Knowledge orchestrator · desktop.py Desktop panel · mcp_server.py MCP server · operations.py Notebook operations
Components 23
User interfaces
- Desktop panel
src/notebook_conexion/desktop.py - Command-line interface
src/notebook_conexion/cli.py - MCP server
src/notebook_conexion/mcp_server.py - Agent setup
src/notebook_conexion/agent_install.py
Accounts and access
- Notebook operations
src/notebook_conexion/operations.py - Notebook catalog
src/notebook_conexion/catalog.py - Notebook API client
src/notebook_conexion/notebook.py - Google OAuth
src/notebook_conexion/oauth.py - Authorized scope
src/notebook_conexion/brain_scope.py - Temporary grants
src/notebook_conexion/grants.py
Knowledge processing
- Knowledge orchestrator
src/notebook_conexion/second_brain.py - Local file import
src/notebook_conexion/brain_import.py - Evidence retrieval
src/notebook_conexion/brain_retrieval.py - Cited answers
src/notebook_conexion/brain_answers.py - Source audit
src/notebook_conexion/brain_audit.py - Controlled exports
src/notebook_conexion/exports.py
Local state
- Encrypted index
src/notebook_conexion/brain_store.py - Profile configuration
src/notebook_conexion/store.py
External services
- Gemini Notebook API
- Optional Gemini synthesis
src/notebook_conexion/gemini.py - Gemini API
Other components
- Local owner
- Claude Code / Codex
Connections 34
- Local owner → Desktop panel: configures locally
README.md - Local owner → Command-line interface: uses commands
README.md - Claude Code / Codex → MCP server: invoke tools
README.md - Desktop panel → Authorized scope: sets selection
src/notebook_conexion/desktop.py - Desktop panel → Google OAuth: starts login
src/notebook_conexion/desktop.py - Desktop panel → Knowledge orchestrator: manages knowledge
src/notebook_conexion/desktop.py - Desktop panel → Agent setup: connects agents
src/notebook_conexion/desktop.py - Command-line interface → Knowledge orchestrator: runs knowledge tasks
src/notebook_conexion/cli.py - MCP server → Knowledge orchestrator: dispatches requests
src/notebook_conexion/mcp_server.py - MCP server → Notebook operations: dispatches operations
src/notebook_conexion/mcp_server.py - MCP server → Controlled exports: requests exports
src/notebook_conexion/mcp_server.py - Notebook operations → Notebook catalog: lists notebooks
src/notebook_conexion/operations.py - Notebook operations → Notebook API client: performs API actions
src/notebook_conexion/operations.py - Notebook operations → Controlled exports: exports results
src/notebook_conexion/operations.py - Notebook operations → Temporary grants: checks permissions
src/notebook_conexion/operations.py - Notebook catalog → Notebook API client: collects pages
src/notebook_conexion/catalog.py - Notebook API client → Google OAuth: obtains access token
src/notebook_conexion/notebook.py - Notebook API client → Gemini Notebook API: sends API requests
README.md - Google OAuth → Profile configuration: loads account profile
src/notebook_conexion/oauth.py - Knowledge orchestrator → Authorized scope: validates active scope
src/notebook_conexion/second_brain.py - Knowledge orchestrator → Notebook API client: fetches notebook content
src/notebook_conexion/second_brain.py - Knowledge orchestrator → Notebook catalog: collects sources
src/notebook_conexion/second_brain.py - Knowledge orchestrator → Encrypted index: stores synchronized text
src/notebook_conexion/second_brain.py - Knowledge orchestrator → Local file import: imports local files
src/notebook_conexion/second_brain.py - Knowledge orchestrator → Evidence retrieval: requests evidence search
src/notebook_conexion/second_brain.py - Knowledge orchestrator → Cited answers: builds cited answers
src/notebook_conexion/second_brain.py - Knowledge orchestrator → Source audit: runs comparisons
src/notebook_conexion/second_brain.py - Evidence retrieval → Encrypted index: reads indexed text
src/notebook_conexion/brain_retrieval.py - Cited answers → Evidence retrieval: retrieves evidence
src/notebook_conexion/brain_answers.py - Cited answers → Optional Gemini synthesis: optionally synthesizes
README.md - Optional Gemini synthesis → Gemini API: sends selected text
README.md - Knowledge orchestrator → Encrypted index: stores imported content
src/notebook_conexion/second_brain.py - Knowledge orchestrator → Profile configuration: loads account profiles
src/notebook_conexion/second_brain.py - MCP server → Temporary grants: checks temporary permissions
src/notebook_conexion/mcp_server.py