Skip to main content

AI-powered development context tracker - never lose your train of thought

Project description

๐Ÿง  Brainet

Never lose your train of thought again.

Brainet is an AI-powered development context tracker that automatically captures what you're working on, why you're working on it, and what's next. Think of it as a second brain for your coding sessions.

PyPI version Python License


๐Ÿš€ What's New in v0.2.0

Major Architecture Overhaul - 5-Source Intelligence System:

  • ๐Ÿ” SOURCE 1 - Git Diffs: Smart chunking with AST-based function extraction
  • ๐Ÿ“„ SOURCE 2 - Full Files: Complete code context for accurate answers
  • ๐ŸŒฒ SOURCE 3 - AST Analysis: Deep code structure understanding (classes, methods, imports)
  • ๐ŸŽฏ SOURCE 4 - Semantic Search: Proactive code discovery related to your queries
  • ๐Ÿ“ฆ SOURCE 5 - Project Metadata: Dependencies, file types, and project structure

Critical Bugs Fixed:

  • โœ… Ask command now provides specific, detailed answers with line numbers
  • โœ… Proper diff counting (additions/deletions) in all scenarios

New Features:

  • ๐ŸŽจ Capsule indexing (#01, #02, #03 format)
  • ๐Ÿ‘๏ธ brainet preview <index> - View any historical capsule
  • ๐Ÿ’ฌ Dramatically improved AI responses - specific method listings, accurate context

๐Ÿค” The Problem

You're deep in the zone, building a feature. Then...

  • ๐Ÿ“ง An urgent email arrives
  • ๐Ÿ”ฅ A production bug needs fixing
  • โ˜• You take a break
  • ๐Ÿ“… It's Friday, you'll continue Monday

Monday morning: "Wait... what was I doing? Why did I change this file? What was the plan?"

You spend 30 minutes scrolling through git commits, reading code, trying to remember. Your flow state? Gone.

โœจ The Solution

Brainet captures your coding sessions automatically and uses AI to create human-readable summaries:

$ brainet capture

๐Ÿ“ธ Context Captured
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Added a Character class with methods for combat (attack, 
take_damage, heal), progression (gain_experience, level_up), 
and status checking (is_alive). Also added Inventory class 
with item management.

๐Ÿ“Š Stats:
   โ€ข 1 files modified
   โ€ข 67 lines added
   โ€ข 3 TODOs found

โœ“ Capsule saved: 2025-11-02 15:45:53
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

Now when you come back, just run brainet history and instantly remember everything.


๐Ÿš€ Quick Start

Installation

# 1. Install brainet
pip install brainet --user

# 2. Add to PATH permanently
echo 'export PATH="$HOME/Library/Python/3.9/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Setup

# 1. Check it works
brainet --version

# 2. Get free API key from https://console.groq.com/keys

# 3. Set it permanently
echo 'export GROQ_API_KEY="gsk_your_key_here"' >> ~/.zshrc
source ~/.zshrc

# 4. Start using brainet in any git project!
cd your-project

brainet start
# ... make some changes ...
brainet capture --tag feature -m "Added user authentication"

That's it! Brainet is now tracking your development context.


๐Ÿ’ก Key Features

๐Ÿค– AI-Powered Summaries

Brainet uses Claude Sonnet 3.5 (via Groq) to understand your changes and generate intelligent summaries. It knows the difference between:

  • Major features vs minor refactors
  • Bug fixes vs new functionality
  • Breaking changes vs safe updates

๐Ÿ” Natural Language Querying (Powered by 5 Sources)

Ask questions about your work in plain English - now with comprehensive context:

$ brainet ask "what methods does the Character class have?"

You have a Character class with these methods: __init__ 
(lines 4-10), take_damage (lines 12-15), heal (lines 17-20), 
is_alive (lines 22-23), attack (lines 25-27), gain_experience 
(lines 29-32), and level_up (lines 34-39). The TODOs include 
adding a magic system with spells, implementing quest tracking, 
and adding save/load game functionality.

v0.2.0 Intelligence: Brainet now searches through full file contents, AST structure, and semantically related code to give you accurate, detailed answers with line numbers.

๐Ÿข Multi-Project Support

Working on multiple projects? Brainet handles it seamlessly:

$ brainet workspaces

๐Ÿ“š Active Brainet Sessions (3):
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Project      โ”ƒ Location               โ”ƒ Capsules โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ api-backend  โ”‚ ~/projects/api         โ”‚       12 โ”‚
โ”‚ frontend-app โ”‚ ~/projects/frontend    โ”‚        8 โ”‚
โ”‚ mobile-app   โ”‚ ~/projects/mobile      โ”‚        5 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ Note: The workspaces command scans these directories for brainet projects:

  • ~/Desktop - For desktop projects
  • ~/Documents - For document-based work
  • ~/Projects - For dedicated project folders

Keep your projects in these locations for automatic discovery!

๐Ÿ”Ž Cross-Project Search

Find where you implemented that feature across all your projects:

$ brainet search "authentication" --all-projects

๐Ÿ” Found in 3 projects:
  โ€ข api-backend: JWT authentication with refresh tokens
  โ€ข frontend-app: Google OAuth integration
  โ€ข mobile-app: Biometric authentication added

๐Ÿ“Š Development Analytics

Understand your coding patterns:

$ brainet stats

๐Ÿ“Š Development Insights
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Sessions: 47
  Files modified: 234
  Most active file: auth.py (23 changes)
  Top tags: feature, bugfix, refactor
  
  Recent activity:
  โ€ข 15 sessions this week
  โ€ข Peak productivity: Tuesday afternoons
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

๐Ÿ“š Commands

Command Description
brainet start Initialize tracking in current project
brainet capture Save current session with AI summary
brainet history View all captured sessions with #01, #02 indexing
brainet preview Preview what will be captured next
brainet preview <N> View historical capsule #N
brainet ask "question" Query your work with AI (v0.2.0: 5-source intelligence)
brainet search "keyword" Search across sessions
brainet workspaces List all tracked projects
brainet stats View development analytics
brainet export Export sessions to Markdown
brainet diff <file> View colorized file changes
brainet switch Quick navigation between projects

Run brainet --help for full command list.


๐ŸŽฏ Real-World Use Cases

1. Context Switching

Switch between tasks without losing context:

# Working on Feature A
brainet capture --tag feature-a

# Emergency bug fix needed
brainet pause
cd ~/other-project
brainet start
# Fix bug...
brainet capture --tag hotfix

# Back to Feature A
cd ~/original-project
brainet resume  # Instantly recall where you left off

2. Code Reviews

Generate PR descriptions automatically:

brainet export --since yesterday

# Copy the AI-generated summary into your PR

3. Weekly Standups

"What did I work on this week?"

brainet history --since "1 week ago"

# See all your accomplishments summarized

4. Knowledge Transfer

Onboarding a teammate:

brainet export --tag authentication > auth_work.md

# Share the complete history of authentication feature

๐Ÿ› ๏ธ How It Works

  1. File Watching - Tracks changes in your git repository
  2. Git Integration - Captures commits, diffs, and file changes
  3. TODO Extraction - Finds TODO comments automatically
  4. AI Analysis - Claude Sonnet 3.5 generates intelligent summaries
  5. Local Storage - Everything saved locally in .brainet/ folder

Privacy First: All your data stays on your machine. AI summaries are generated via API but your code never leaves your control.


๐Ÿ”ง Configuration

API Keys

Brainet supports two AI providers:

Groq (Recommended) - Free, fast, 500+ tokens/sec

export GROQ_API_KEY="your_key_here"

Anthropic Claude - More powerful, requires paid account

export ANTHROPIC_API_KEY="your_key_here"

Advanced Options

# Capture with custom tags
brainet capture --tag feature --tag auth -m "Added JWT support"

# Export filtered sessions
brainet export --tag bugfix --since "2024-10-01"

# Search in current project only
brainet search "payment integration"

# Clean up old sessions
brainet cleanup --days 90

๐ŸŽ“ Best Practices

  1. Capture Often - At least once per coding session
  2. Use Tags - Organize with --tag feature, --tag bugfix, etc.
  3. Add Messages - Use -m for important context
  4. Regular Cleanup - Run brainet cleanup monthly
  5. Export Important Work - Save milestones to Markdown
  6. Organize Projects - Keep projects in ~/Desktop, ~/Documents, or ~/Projects for the workspaces command to find them automatically

๐Ÿค Contributing

Brainet is open source! Contributions welcome:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing)
  5. Open a Pull Request

๐Ÿ“„ License

MIT License - see LICENSE file for details.


๐Ÿ™ Acknowledgments

  • Built with Anthropic Claude
  • Powered by Groq for fast AI inference
  • Uses Rich for beautiful terminal output
  • Created for developers, by developers

๐Ÿ’ฌ Support


Stop losing context. Start using Brainet.

Made with โค๏ธ for developers who value flow state

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brainet-0.2.2.tar.gz (80.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brainet-0.2.2-py3-none-any.whl (84.9 kB view details)

Uploaded Python 3

File details

Details for the file brainet-0.2.2.tar.gz.

File metadata

  • Download URL: brainet-0.2.2.tar.gz
  • Upload date:
  • Size: 80.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for brainet-0.2.2.tar.gz
Algorithm Hash digest
SHA256 7e1763f6bf6800304abcdf1abcc49626094204116dee91bcc330cf68a354b0ad
MD5 0cdc4729fbbc7f26bf6f33e811586ab0
BLAKE2b-256 f8f20b41b58ecd188c96fb60ca488148778e9f1ba746c89bfb7a76c35f389a8b

See more details on using hashes here.

File details

Details for the file brainet-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: brainet-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 84.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for brainet-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f3b10a8e683d1f9645356b75c97956095c72a0efa4211541c041b7aa496be2c
MD5 a04429bfc7db67b4f5de61e9e587428a
BLAKE2b-256 636316d59ba6b36e82fbe4069c198952dcdbe21bb5747758aa158bfeabe9f7ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page