iPuppy-Notebooks icon indicating copy to clipboard operation
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:

  1. 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
    
  2. 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 ๐Ÿ“ฆ

  1. Clone the repository ๐Ÿ•

    git clone <repository-url>
    cd iPuppy-Notebooks
    
  2. 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
    
  3. Frontend Setup โš›๏ธ

    # Install Node dependencies
    npm install
    
    # Build the React frontend
    npm run build
    

Launch ๐Ÿš€

  1. Start the FastAPI server ๐ŸŒ

    python main.py
    
  2. Open your browser ๐ŸŒ Navigate to http://localhost:8000 and start your data science journey! ๐Ÿถ

๐ŸŽฏ Usage Guide

Getting Started ๐Ÿพ

  1. Create a Notebook - Click "create" in the sidebar and give your notebook a name
  2. Add Cells - Use the "add cell" button to create code or markdown cells
  3. Run Code - Press the ๐Ÿš€ run button or use Shift+Enter to execute cells (automatically scrolls to output!)
  4. Chat with Puppy Scientist - Ask questions and watch the AI autonomously control your notebook, write code, and analyze data
  5. Write Math - Use LaTeX in markdown cells: $inline$ or $$display$$ for beautiful mathematical expressions
  6. 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! ๐Ÿ•

  1. Fork the repository
  2. Create a feature branch
  3. Make your improvements
  4. 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! ๐Ÿพ๐Ÿ“Š