iPuppy-Notebooks
iPuppy-Notebooks copied to clipboard
iPuppy Notebooks - Agentic Coding for Data Science
๐ถ iPuppy Notebooks ๐ถ
Agentic AI-Empowered Data Science for the Modern Era ๐๐
A revolutionary notebook environment that combines the power of Jupyter-style computing with intelligent AI assistance. Built with FastAPI backend and React frontend, iPuppy Notebooks puts the fun back in data science! ๐
โจ Features
๐ Puppy Scientist AI Agent - Fully integrated AI assistant that autonomously controls notebooks, writes code, executes analyses, and provides data science expertise
๐ Modern Dark Theme - Sleek monochromatic design with zinc color palette and JetBrains Mono fonts
โก Real-time Execution - WebSocket-powered code execution with instant feedback and auto-scroll to outputs
๐ Rich Output Support - LaTeX math rendering, Plotly charts, matplotlib/seaborn plots, images, videos, and more
๐งฎ LaTeX in Markdown - Write beautiful mathematical expressions with KaTeX rendering (both inline $x$ and display $$x$$)
๐ฑ Responsive Design - Works beautifully on desktop and mobile
๐ Cell Management - Create, reorder, expand, and manage code/markdown cells with full programmatic control
โจ๏ธ Smart Shortcuts - Shift+Enter to run cells and navigate seamlessly with intelligent tab handling
๐ค Agentic Operations - AI can directly manipulate notebooks: add cells, execute code, read outputs, and more
๐ Python Kernel - Full iPython kernel with autocomplete, rich MIME type support, and matplotlib inline display
๐จ Animated UI - Puppy spinner animations and smooth transitions throughout
๐ Quick Start
How to Run ๐โโ๏ธ
The fastest way to get iPuppy Notebooks running:
-
Set up your API keys ๐
export OPENAI_API_KEY="your-openai-api-key" export GEMINI_API_KEY="your-gemini-api-key" export ANTHROPIC_API_KEY="your-anthropic-api-key" # Add any other AI provider keys you want to use -
Run with uvx โก
uvx ipuppy-notebooks
That's it! iPuppy Notebooks will start and be available at http://localhost:8000 ๐ถ
Development Setup ๐ ๏ธ
For development or if you prefer to build from source:
Prerequisites ๐พ
- Python 3.10+
- Node.js 16+
- uv package manager
Installation ๐ฆ
-
Clone the repository ๐
git clone <repository-url> cd iPuppy-Notebooks -
Backend Setup ๐
# Install Python dependencies uv pip install -r pyproject.toml # Install code_puppy for AI model management (optional but recommended) # Follow instructions at: https://github.com/anthropics/code_puppy -
Frontend Setup โ๏ธ
# Install Node dependencies npm install # Build the React frontend npm run build
Launch ๐
-
Start the FastAPI server ๐
python main.py -
Open your browser ๐ Navigate to
http://localhost:8000and start your data science journey! ๐ถ
๐ฏ Usage Guide
Getting Started ๐พ
- Create a Notebook - Click "create" in the sidebar and give your notebook a name
- Add Cells - Use the "add cell" button to create code or markdown cells
- Run Code - Press the ๐ run button or use Shift+Enter to execute cells (automatically scrolls to output!)
- Chat with Puppy Scientist - Ask questions and watch the AI autonomously control your notebook, write code, and analyze data
-
Write Math - Use LaTeX in markdown cells:
$inline$or$$display$$for beautiful mathematical expressions - Rich Outputs - Enjoy Plotly charts, matplotlib plots, LaTeX rendering, images, and more
AI Agent Operations ๐ค
The Puppy Scientist AI Agent can autonomously control your notebook through these operations:
Notebook Manipulation:
-
add_new_cell(cell_index, cell_type, content)- Add new code/markdown cells -
delete_cell(cell_index)- Remove cells -
alter_cell_content(cell_index, content)- Modify cell content -
execute_cell(cell_index)- Execute cells and wait for results -
swap_cell_type(cell_index, new_type)- Switch between code/markdown -
move_cell(cell_index, new_index)- Reorder cells
State Reading (requires active notebook):
-
list_all_cells()- Get complete notebook overview -
read_cell_input(cell_index)- Read cell source code -
read_cell_output(cell_index)- Read execution outputs
Communication:
-
share_your_reasoning(reasoning, next_steps)- Explain thought process
The agent uses these tools to autonomously:
- ๐ Analyze your data and create visualizations
- ๐ป Write, execute, and debug Python code
- ๐ Create markdown documentation with LaTeX math
- ๐ Inspect notebook state and outputs
- ๐ Implement complete data science workflows
Example conversation:
You: "Analyze the iris dataset and create some visualizations"
๐ถ: *Creates cells, loads data, performs EDA, generates Plotly charts*
Keyboard Shortcuts โจ๏ธ
- Shift+Enter - Execute current cell and move to next (with auto-scroll to output)
- Tab - Smart indentation and autocomplete in code cells
- Cell Navigation - Seamlessly move between cells after execution
Cell Types ๐
- Code Cells - Execute Python code with full IPython kernel, rich outputs, and autocomplete
-
Markdown Cells - Rich text formatting with LaTeX math support (
$inline$and$$display$$)
๐๏ธ Architecture
๐ถ iPuppy Notebooks Architecture ๐ถ
โโโ ๐ Backend (FastAPI)
โ โโโ main.py # FastAPI server and WebSocket handling
โ โโโ ipuppy_notebooks/ # Core notebook functionality
โ โ โโโ agent/ # AI agent system
โ โ โ โโโ agent.py # DataSciencePuppyAgent main class
โ โ โ โโโ tools.py # Notebook manipulation tools
โ โ โ โโโ prompts.py # System prompts and instructions
โ โ โโโ kernels/ # Jupyter kernel management
โ โ โ โโโ manager.py # Kernel lifecycle and initialization
โ โ โ โโโ executor.py # Code execution handling
โ โ โโโ frontend_operations.py # BackendโFrontend communication
โ โ โโโ socket_handlers.py # WebSocket event handling
โ โโโ notebooks/ # Stored notebook files (.py format)
โโโ โ๏ธ Frontend (React + TypeScript)
โ โโโ src/
โ โ โโโ components/ # React components
โ โ โ โโโ Header.tsx # Top navigation with kernel status
โ โ โ โโโ Sidebar.tsx # Notebooks + Puppy Scientist chat
โ โ โ โโโ NotebookCell.tsx # Individual cell with LaTeX support
โ โ โ โโโ NotebookContainer.tsx # Main notebook view
โ โ โโโ lib/
โ โ โ โโโ tabHandler.ts # Smart tab indentation system
โ โ โโโ App.tsx # Main application logic & WebSocket
โ โ โโโ main.tsx # React entry point
โ โโโ public/
โ โโโ puppy.svg # Custom puppy favicon ๐
๐จ Design Philosophy
iPuppy Notebooks embraces a modern monochromatic aesthetic with:
- ๐จ Zinc color palette (grey variants only)
- ๐ค JetBrains Mono monospace typography
- ๐ Dark theme optimized for long coding sessions
- โจ Subtle animations and clean interfaces
- ๐ Playful puppy branding throughout
๐ค AI Agent Integration
The Puppy Scientist ๐โ๐ฆบ is a fully autonomous AI agent powered by pydantic-ai that can:
- ๐ฏ Autonomous Operation - Takes high-level requests and executes complete workflows independently
- ๐ Data Analysis - Loads, cleans, analyzes data and creates professional visualizations
- ๐ป Code Generation - Writes, executes, and debugs Python code in real-time
- ๐งฎ Mathematical Communication - Creates markdown cells with LaTeX equations and explanations
- ๐ Notebook Inspection - Reads existing notebook state and builds upon your work
- ๐ Best Practices - Follows data science methodologies and coding standards
- ๐ Personality - Fun, informal, and pedantic about data science principles (refuses to make pie charts!)
Supported AI Models:
- Claude (Anthropic) - Recommended for best performance
- GPT-4 series (OpenAI)
- QWEN models (Alibaba)
- Any model supported by pydantic-ai
The agent maintains conversation history per notebook and can switch between different models on the fly! ๐ฏ
๐ฃ๏ธ Roadmap
Phase 1: Foundation โ
- [x] Modern React + TypeScript frontend
- [x] FastAPI backend with WebSocket support
- [x] Cell management and execution
- [x] Keyboard shortcuts and navigation
- [x] Modern UI/UX design
Phase 2: AI Integration โ
- [x] Fully autonomous Puppy Scientist AI agent
- [x] Real-time notebook manipulation by AI
- [x] Multi-model support (Claude, GPT-4, QWEN, etc.)
- [x] Conversation history per notebook
- [x] Intelligent error handling and guidance
Phase 3: Rich Content โ
- [x] LaTeX math rendering in markdown cells
- [x] Comprehensive MIME type support (images, videos, audio, JSON, CSV)
- [x] Plotly charts with proper timing
- [x] Matplotlib/seaborn inline display
- [x] Auto-scroll to outputs on execution
- [x] Animated puppy spinner and smooth UI transitions
Phase 4: Advanced Features ๐ฎ
- [ ] Collaborative editing
- [ ] Version control integration
- [ ] Plugin system
- [ ] Export to various formats (PDF, HTML, etc.)
- [ ] Custom visualization libraries
- [ ] Advanced data connectors
๐ค Contributing
Want to help make iPuppy Notebooks even better? We'd love your contributions! ๐
- Fork the repository
- Create a feature branch
- Make your improvements
- Submit a pull request
๐ License
MIT License - Feel free to use iPuppy Notebooks for your data science adventures! ๐พ
๐ About the Creator
Created with โค๏ธ by Michael Pfaffenberger to revolutionize how we approach data science. iPuppy Notebooks combines the best of Jupyter-style computing with cutting-edge AI assistance - no more bloated IDEs or expensive proprietary tools, just pure, puppy-powered productivity! ๐ถโจ
Why iPuppy Notebooks?
- ๐ค True AI Partnership - The agent doesn't just suggest, it actually does the work
- ๐ Beautiful Math & Viz - LaTeX rendering and rich outputs make presentations ready
- โก Lightning Fast - Modern architecture with real-time updates
- ๐จ Thoughtful Design - Every detail crafted for the data science workflow
- ๐ Pure Joy - Data science should be fun, not frustrating!
Ready to unleash your data science potential? ๐๐
Ask the Puppy Scientist: "Analyze the Titanic dataset and create some visualizations"
Watch as it autonomously loads data, performs EDA, and generates beautiful charts! ๐พ๐