A complete research agent platform with multiple interfaces - GUI, CLI, TUI, and Desktop App. Brainiac performs deep research with cited sources, enabling you to connect any LLM provider (Anthropic, OpenAI, or custom APIs) to generate comprehensive research reports.
- GUI Version - Modern web interface with real-time streaming
- CLI Version - Command-line interface for terminal users
- TUI Version - Rich terminal interface with keyboard navigation
- Desktop App - Native application for Mac, Windows, and Linux
- Multi-Provider Support: Anthropic Claude, OpenAI GPT, or any custom LLM API
- Deep Research: Searches Wikipedia, Open Library, recent news, and academic sources
- Cited Sources: Inline citations with numbered references
- Custom Configuration: API endpoints, models, tokens, and system prompts
- Research History: Save and review past research sessions
- Export Options: Markdown, TXT, and JSON formats
- Real-time streaming responses
- Beautiful dark-themed interface
- Research history browser
- Export to multiple formats
- Responsive design
- Full command-line control
- Batch research capabilities
- History management
- Script-friendly output
- Works on all platforms
- Rich terminal interface
- Keyboard shortcuts
- Visual progress indicators
- Inline report viewing
- History navigation
- Native application experience
- Offline-ready configuration
- System tray integration
- Auto-updates (planned)
- Cross-platform support
- Clone the repository:
git clone https://github.com/zanni098/brainiac.git
cd brainiac- Install dependencies:
npm install- Configure your API key:
npm run cli confignpm run devOpen http://localhost:5173 in your browser.
npm run cli research "quantum computing"
npm run cli historynpm run tui# Development
npm run electron:dev
# Build for your platform
npm run electron:build:mac # macOS
npm run electron:build:win # Windows
npm run electron:build:linux # LinuxFor detailed installation instructions, see INSTALL.md.
- Click the βοΈ SETTINGS button to configure your API
- Enter a research topic in the search box
- Click RESEARCH β or press Enter
- View the generated report with citations
- Use π HISTORY to review past research
- Export reports in MD, TXT, or JSON format
# Research a topic
brainiac research "climate change"
# Export to file
brainiac research "AI ethics" -o report.md
# View history
brainiac history
# Export specific report
brainiac export 1 output.md
# Clear history
brainiac history --clearKeyboard shortcuts:
Enter: Research current queryCtrl+C: ExitCtrl+E: Export current reportCtrl+H: View history
All versions share the same configuration stored in ~/.brainiac/config.json:
{
"provider": "anthropic",
"apiUrl": "https://api.anthropic.com/v1/messages",
"apiKey": "your-api-key",
"model": "claude-sonnet-4-20250514",
"maxTokens": 4096,
"systemPrompt": "..."
}Configure via CLI:
brainiac configOr edit the file directly.
{
provider: "anthropic",
apiUrl: "https://api.anthropic.com/v1/messages",
apiKey: "sk-ant-...",
model: "claude-sonnet-4-20250514",
maxTokens: 4096
}Get your API key from: https://console.anthropic.com/
{
provider: "openai",
apiUrl: "https://api.openai.com/v1/chat/completions",
apiKey: "sk-...",
model: "gpt-4",
maxTokens: 4096
}Get your API key from: https://platform.openai.com/api-keys
{
provider: "custom",
apiUrl: "http://localhost:11434/api/chat",
apiKey: "your-key-or-empty",
model: "llama2",
maxTokens: 4096
}Brainiac generates comprehensive reports with these sections:
- ## [Title]: Descriptive title for the research
- ### Executive Summary: Brief overview of key findings
- ### Background & Context: Historical context from Wikipedia
- ### Recent Developments: Current developments (last 12 months)
- ### Key Findings & Data: Statistics and data points
- ### Expert Perspectives: Quotes and expert opinions
- ### Books & Academic Sources: Relevant literature from Open Library
- ### Critical Analysis: Deep dive and balanced perspectives
- ### Implications & Future Outlook: Forward-looking analysis
- ### References: Numbered list with full URLs and dates
All claims are cited inline using superscript numbers [1][2][3] with corresponding references at the end.
Modify the system prompt to change research behavior. The default prompt is comprehensive but you can customize it via:
brainiac configOr edit ~/.brainiac/config.json directly.
The GUI uses inline styles for portability. To customize:
- Modify style objects in
gui/brainiac.jsx - Or extract to a CSS file and update
gui/src/index.css
- API keys are stored locally in
~/.brainiac/config.json(CLI/TUI) or browser localStorage (GUI) - No data is sent to any server other than your configured LLM API
- Configuration persists between sessions on the same device
- Clear
~/.brainiac/directory or browser data to remove credentials
brainiac/
βββ gui/ # Web/GUI version
β βββ brainiac.jsx # Main React component
β βββ src/ # React app source
β βββ index.html # HTML entry point
βββ cli/ # CLI version
β βββ index.js # CLI implementation
βββ tui/ # TUI version
β βββ index.js # Terminal UI implementation
βββ electron/ # Desktop app
β βββ main.js # Electron main process
βββ package.json # Dependencies and scripts
βββ vite.config.js # Vite configuration
βββ README.md # This file
βββ INSTALL.md # Detailed installation guide
βββ ABOUT.md # About documentation
To add support for a new LLM provider, extend the API_ADAPTERS object in the appropriate version file:
const API_ADAPTERS = {
// ... existing adapters
yourProvider: {
formatRequest: (config, query) => ({
// Format request for your API
}),
formatHeaders: (config, apiKey) => ({
// Format headers for your API
}),
parseResponse: (data) => {
// Parse response (CLI/TUI)
},
parseStream: (line) => {
// Parse streaming response (GUI)
}
}
};Contributions are welcome! Areas for improvement:
- Additional API provider adapters (Google Gemini, Cohere, etc.)
- Export reports to PDF
- Collaborative research features
- Mobile app version
- Internationalization support
- Plugin system for custom data sources
Feel free to open issues or submit pull requests.
MIT License - feel free to use this project for personal or commercial purposes.
- Original research agent concept
- Anthropic Claude API
- OpenAI GPT API
- React, Vite, and Electron communities
- Blessed and Commander libraries
For issues, questions, or suggestions:
- GitHub Issues: https://github.com/zanni098/brainiac/issues
- Documentation: INSTALL.md, ABOUT.md
Made with β€οΈ by zanni098