How bagpotato/brain-agent works
brain-agent is a small, single-file local agent: users submit one or more topics, the script requests structured Markdown from Ollama, classifies the note, and saves it in the matching Obsidian vault folder. The graph separates CLI entry, generation, backend access, and note persistence. README capabilities such as configurable model/vault, interactive input, and note-type folders are represented; the implementation is entirely in the one indexed source file.
Main entry points: Brain-agent.py Generate note
Components 10
User interface
- CLI configuration
Brain-agent.py - Interactive loop
Brain-agent.py
Note generation
- Generate note
Brain-agent.py - Structured prompt
Brain-agent.py - Ollama backend
Vault storage
- Folder detection
Brain-agent.py - Title extraction
Brain-agent.py - Note persistence
Brain-agent.py
Other components
- User
- Obsidian vault
Connections 11
- User → CLI configuration: runs
Brain-agent.py - CLI configuration → Interactive loop: dispatches
Brain-agent.py - CLI configuration → Generate note: dispatches
Brain-agent.py - Interactive loop → Generate note: submits topic
Brain-agent.py - Generate note → Structured prompt: builds request
Brain-agent.py - Generate note → Ollama backend: requests generation
Brain-agent.py - Ollama backend → Generate note: returns Markdown
Brain-agent.py - Generate note → Note persistence: saves content
Brain-agent.py - Note persistence → Folder detection: detects folder
Brain-agent.py - Note persistence → Title extraction: extracts filename
Brain-agent.py - Note persistence → Obsidian vault: writes note
Brain-agent.py