π Because Two Hands Just Aren't Enough
Let's be honest: being a human is exhausting. You only have two arms, one brain, and a desperate, daily need for caffeine. How are you supposed to handle a never-ending to-do list with hardware like that?
Enter Octopus AI.
We looked at the animal kingdom for the ultimate productivity guru and found the undisputed multitasking ninja of the sea. Why? Because octopuses are freakishly smart and boast eight highly capable arms.
They can open child-proof jars from the inside, solve puzzles, and juggle multiple tasks without breaking a sweat (mostly because they live underwater, but you get the point). We took that big-brained, multi-limbed brilliance and turned it into an AI tool designed to do your heavy lifting.
π¦Ύ Eight-Armed Multitasking: While your clumsy human hands are still typing a single sentence, Octopus AI is already crunching data, drafting emails, organizing your schedule, and virtually high-fiving itself.
π§ Escape-Artist Intelligence: Got a problem that feels like you're stuck in a locked box? Octopus AI uses its massive, squishy digital brain to squeeze through complex problems and find elegant solutions.
π Total Flexibility: It adapts to your workflow seamlessly. No rigid bones, no frictionβjust smooth, intelligent automation wrapping around your daily tasks.
π§Ή 100% Mess-Free: All the genius of a cephalopod, with absolutely zero ink squirted on your nice clean desk when it gets surprised.
Stop drowning in a sea of tabs and endless tasks. Let Octopus AI wrap its virtual tentacles around your workload, so you can go back to doing what humans do best: taking naps and drinking coffee. β
graph TB
subgraph Frontend["π¨ Frontend (HTML/CSS/JS)"]
UI[Chat Interface]
Settings[Settings Panel]
end
subgraph Backend["βοΈ FastAPI Backend"]
Agent[π Agent Engine<br/>plan Β· act Β· reflect]
Config[Config Manager]
Memory[Memory + Vector RAG]
end
subgraph LLM["π§ LLM Providers"]
OpenAI[OpenAI<br/>GPT-4o / GPT-4o-mini]
Anthropic[Anthropic<br/>Claude Sonnet 4]
Gemini[Google Gemini<br/>Gemini 3 Flash]
Ollama[Ollama<br/>native tool-calling]
Local[Local OpenAI-compat<br/>LM Studio / vLLM]
end
subgraph Tools["π¦ Tentacle Tools"]
Shell[π Shell]
FileOps[π File Ops]
WebBrowse[π Web Browse]
CodeRun[π» Code Runner]
Search[π Web Search]
Image[π¨ Image Gen]
Plan[πΊοΈ Plan]
Delegate[π€ Delegate]
end
UI -- WebSocket --> Agent
Settings -- REST API --> Config
Agent --> LLM
Agent --> Tools
Agent --> Memory
| Tentacle | Capability | Description |
|---|---|---|
| π | Shell Commands | Execute system commands with real-time output streaming |
| π | File Operations | Read, write, edit, list, and search files & directories |
| π | Web Browse | Navigate, click, type, and read JS-rendered pages (Playwright) |
| π» | Code Execution | Run Python in a sandboxed, resource-limited subprocess |
| π | Web Search | Search the internet via DuckDuckGo |
| π¨ | Image Generation | Create images from text (DALLΒ·E) |
| πΊοΈ | Task Planning | Maintain a live step-by-step todo checklist (streamed to the UI) |
| π€ | Sub-agent Delegate | Spawn focused, tool-capable sub-agents for isolated sub-tasks |
- Plan β act β observe β adapt loop with parallel tool calls (swarm), self-healing retries, and result verification.
- Universal tool-calling β native function-calling on OpenAI/Anthropic/Gemini/Ollama/local, plus a prompt-based emulation fallback so even small local models can use tools. Pick the behavior with Tool Mode (auto / native / emulated / off).
- Agent Activity panel showing the live plan and a tentacle timeline, plus an in-header model switcher.
Switch between AI providers on the fly β no restart needed:
| Provider | Models | Authentication |
|---|---|---|
| OpenAI | GPT-4o, GPT-4o-mini, GPT-4-Turbo | API Key |
| Anthropic | Claude Sonnet 4, Claude 3.5 Haiku, Claude 3 Opus | API Key |
| Google Gemini | Gemini 3 Flash, Gemini 2.5 Pro/Flash | API Key or Google Sign-In |
| Ollama | Llama 3.2, Mistral, Code Llama + any local model β now with native tool-calling | Local (free!) |
| Local (OpenAI-compatible) | LM Studio Β· llama.cpp Β· vLLM Β· text-generation-webui (set a base_url) |
Local (free!) |
- Glassmorphism design with deep-ocean dark theme + light mode
- Animated octopus welcome screen with CSS tentacle animation
- Real-time streaming chat with rich Markdown (tables, task lists, sanitized HTML) via
marked+DOMPurify - Agent Activity panel β watch the live plan checklist and tentacle timeline as the agent works
- In-header model switcher with live discovery of installed Ollama / local models
- Settings panel β provider, model, tool mode, temperature, local runtimes, tentacle permissions
- Responsive design optimized for desktop & mobile
- Google Sign-In for seamless Gemini integration
- Conversations automatically saved to disk as JSON
- Auto-generated conversation titles
- Full-text searchable conversation history
- Configurable context window (up to 50 messages)
- Path Isolation: All
FileandShellinteractions are securely jailed strictly to thedata/workspacedirectory. - Network Containment: Python subprocess environments are spawned using Linux
unshare -rnto sever network access completely and neutralize code-based data extraction. - Robust Prompt Armor: Extracted texts from DuckDuckGo queries and Web navigations are structurally isolated within XML wrappers (like
<untrusted>or<external_content>), effectively stripping them of instruct-override privileges and preventing Prompt Injections. - Local IP Anchoring: To harden the backend against unauthenticated external hijacking, Octopus utilizes a strict
LocalhostRestrictionMiddlewarelayer blocking all non-local connections.
Full documentation lives in docs/:
| For Users | For Developers |
|---|---|
| User Guide β install, run, UI tour, usage | Architecture β design & request lifecycle |
| Providers & Models β cloud + local | Code Structure β file-by-file map |
| Configuration β every setting | Agent Engine β the planβact loop |
| Security β sandbox & threat model | Tools Reference β tentacles + how to add one |
| API Reference β REST + WebSocket | |
| Development Guide β setup, testing, extending |
| Requirement | Version |
|---|---|
| Python | 3.10 or higher |
| pip | Latest recommended |
| API Key | At least one (OpenAI / Anthropic / Gemini) β or Ollama for free local models |
# 1. Clone the repository
git clone https://github.com/Masriyan/Octopus-Ai.git
cd Octopus-Ai
# 2. Make the start script executable
chmod +x start.sh
# 3. Launch everything (auto-installs deps, starts backend + frontend)
./start.shThen open http://localhost:5500 in your browser. π
If you prefer to set things up manually:
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r backend/requirements.txt
# Copy environment config
cp .env.example .env
# Edit .env and add your API key(s)
# Start the backend
cd backend
python3 -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload &
# Start the frontend (in another terminal)
cd frontend
python3 -m http.server 5500- Open http://localhost:5500
- Click the βοΈ Settings button in the sidebar
- Select your preferred LLM provider
- Enter your API key and click Save
- Start chatting! π
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Pull a model
ollama pull llama3.2
# In Octopus AI settings β select "Ollama" as providerSimply type your message and Octopus AI will respond. It automatically detects when tools would be helpful and uses them proactively.
The welcome screen features interactive cards that demonstrate each tentacle:
| Card | Example Prompt |
|---|---|
| π Shell | "List all files in my home directory" |
| π Files | "Read and summarize the README.md in the current project" |
| π Search | "Search the web for the latest AI news" |
| π» Code | "Write a Python script to calculate Fibonacci numbers and run it" |
| π Web | "Fetch and summarize the contents of https://news.ycombinator.com" |
| π¨ Image | "Generate an image of a cyberpunk octopus in neon lights" |
| πΊοΈ Plan | "Plan and build a small CLI to-do app, then implement it" |
| π¦ Multi | "Research X, delegate the analysis, and summarize your findings" |
| Setting | Description |
|---|---|
| LLM Provider | Switch between OpenAI, Anthropic, Gemini, Ollama, or Local |
| Model | Choose the model (local/Ollama models are auto-discovered) |
| Tool Mode | How tools are driven: auto / native / emulated / off |
| Temperature | Control response creativity (0.0 = focused, 1.0 = creative) |
| Tentacle Permissions | Enable/disable individual tools (incl. Plan & Delegate) |
| Local Runtimes | Ollama & OpenAI-compatible base URLs / model / key |
| API Keys | Securely save provider API keys (stored in .env, not config) |
| Google Sign-In | Authenticate with Google for Gemini access |
Octopus AI uses WebSocket connections for real-time, token-by-token streaming β no polling, no delays.
Octopus-Ai/
βββ backend/
β βββ main.py # FastAPI server + WebSocket endpoints
β βββ agent.py # Core agent engine (plan/act/reflect + emulation)
β βββ llm_providers.py # OpenAI / Anthropic / Gemini / Ollama / Local
β βββ config.py # Configuration manager
β βββ memory.py # Conversation persistence (JSON)
β βββ vector_memory.py # Long-term RAG (Qdrant + embeddings)
β βββ requirements.txt # Python dependencies
β βββ tests/ # Pytest suite
β βββ tools/
β βββ __init__.py # Tool registry & schema builder
β βββ shell_tool.py # π Shell command execution
β βββ file_tool.py # π File system operations
β βββ web_tool.py # π Web browse (Playwright)
β βββ code_tool.py # π» Python code execution
β βββ search_tool.py # π DuckDuckGo web search
β βββ image_tool.py # π¨ Image generation (DALLΒ·E)
β βββ plan_tool.py # πΊοΈ Live task planning
β βββ delegate_tool.py # π€ Sub-agent delegation
βββ frontend/
β βββ index.html # Main application page
β βββ css/main.css # Deep-ocean dark theme
β βββ js/app.js # Frontend logic & WebSocket client
βββ data/ # Created at runtime (git-ignored)
β βββ config.json # User preferences (no secrets)
β βββ memory/ # Saved conversations
β βββ vector_db/ # Qdrant vector store
β βββ workspace/ # Sandboxed File/Shell jail
βββ docs/
β βββ images/ # Documentation assets
βββ .env.example # Environment variable template
βββ .gitignore # Git ignore rules
βββ start.sh # One-command launcher
βββ CHANGELOG.md # Release history
βββ CONTRIBUTING.md # Contribution guidelines
βββ LICENSE # MIT License
βββ README.md # β You are here
cd backend
python3 -m uvicorn main:app --reload --port 8000cd frontend
python3 -m http.server 5500Visit http://localhost:8000/docs for the interactive Swagger UI.
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/health |
Health check (version + tool count) |
GET |
/api/config |
Get configuration (keys masked) |
POST |
/api/config |
Update configuration |
POST |
/api/config/apikey |
Save an API key |
GET/POST |
/api/config/system-prompt |
Get / set custom system prompt |
GET |
/api/tools |
List registered tentacles |
GET |
/api/conversations |
List all conversations |
POST |
/api/conversations |
Create new conversation |
GET |
/api/conversations/{id} |
Get conversation with messages |
PATCH |
/api/conversations/{id} |
Rename conversation |
DELETE |
/api/conversations/{id} |
Delete conversation |
GET |
/api/conversations/{id}/export |
Export as JSON or Markdown |
POST |
/api/upload |
Upload a file for the agent (β€10MB) |
GET |
/api/models/{provider} |
List models (live for ollama/local) |
POST |
/api/auth/google |
Google OAuth sign-in |
GET/POST |
/api/auth/google/status Β· /signout |
Google session status / sign-out |
WS |
/ws/chat/{conv_id} |
WebSocket for real-time chat + tools |
gantt
title Octopus AI Development Roadmap
dateFormat YYYY-MM
section Core
Multi-LLM Providers :done, 2025-01, 2025-02
Tool System (5 tentacles) :done, 2025-01, 2025-02
WebSocket Streaming :done, 2025-02, 2025-03
section Enhancements
Plugin System :active, 2025-03, 2025-05
RAG / Document Chat :2025-04, 2025-06
Voice Input/Output :2025-05, 2025-07
section Infrastructure
Docker Support :2025-03, 2025-04
Auth & Multi-User :2025-05, 2025-07
Cloud Deployment :2025-06, 2025-08
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-tentacle) - Commit your changes (
git commit -m 'Add amazing tentacle') - Push to the branch (
git push origin feature/amazing-tentacle) - Open a Pull Request
This project is licensed under the MIT License β see the LICENSE file for details.
An octopus has eight arms, each capable of independent action β tasting, gripping, exploring. Octopus AI embodies this: many tools, each specialized, working together to accomplish any task.
Made with π by Masriyan
β Star this repo β’ π Report Bug β’ π‘ Request Feature

