# ๐ŸŒŸ Hikari (ๅ…‰) โ€” Autonomous Windows AI Agent

PyPI Version Python Versions License Tests Windows Support

Hikari (ๅ…‰ โ€” Japanese for "Light / Velocity") is a high-performance, autonomous Computer-Use AI Agent built natively for Microsoft Windows. Powered by real-time Accessibility Tree decomposition, Hikari interacts with any desktop application with human-like precision, sub-second latency, and 90% fewer tokens than vision-only agents.

Key Features โ€ข Quickstart โ€ข Architecture โ€ข Benchmarks โ€ข Tools โ€ข SDK Guide โ€ข Author

--- ## โšก Why Hikari? (Paradigm Shift in Computer-Use) Most existing computer-use agents rely on brute-force screen capture: taking 4K screenshots every second, feeding them to costly vision models, and guessing clickable coordinates. This leads to slow 5-second latency loops, high API costs, and frequent misclicks. **Hikari solves this fundamentally through native OS integration:** | Feature | ๐Ÿ“ธ Vision-Only Agents | ๐ŸŒŸ **Hikari (ๅ…‰)** | |:---|:---:|:---:| | **Decomposition Engine** | Fullscreen Screenshots (VLM) | **Native Windows UI Accessibility Tree** | | **Coordinate Accuracy** | Pixel Guessing (~82% accuracy) | **Exact Sub-pixel OS Bounding Boxes (100%)** | | **Latency per Step** | 3.5s โ€“ 6.0s | **0.4s โ€“ 1.2s (Sub-second with Groq)** | | **Token Cost per Step** | ~1,600 โ€“ 3,200 tokens | **~180 โ€“ 350 tokens (90% Cost Reduction)** | | **Mouse Trajectory** | Teleport clicks (easily blocked) | **Natural Human Bezier Curves (`SystemCursor`)** | | **Shell Integration** | Terminal GUI typing only | **Direct PowerShell Pipeline Execution** | --- ## ๐Ÿš€ Key Capabilities - ๐Ÿ” **Native Windows Accessibility Tree**: Directly queries `UIAutomation` for interactive buttons, input fields, menus, tree views, and scrollable panes. - ๐Ÿง  **Structured XML Cognitive Engine**: Operates on a transparent self-correcting loop with ``, ``, ``, ``, and `` tags. - โšก **Multi-LLM Engine Agnostic**: - **Groq Cloud AI** (`openai/gpt-oss-120b`, `openai/gpt-oss-20b`, `qwen/qwen3.6-27b`) โ€” Ultra-low latency. - **Google Gemini 2.0 Flash** โ€” Ultra-fast with generous free tier. - **OpenAI GPT-4o / GPT-4o-mini** โ€” High precision multi-step reasoning. - **Local Ollama** (`qwen2.5:14b`, `llama3.3`) โ€” 100% private offline automation. - ๐Ÿ–ฑ๏ธ **Human-like Mouse & Keyboard Physics**: Bezier curve movement, organic acceleration/deceleration, and natural typing intervals. - ๐Ÿ’ป **Hybrid GUI + CLI Automation**: Intelligently switches between clicking GUI elements and running PowerShell scripts for maximum speed. - ๐ŸชŸ **Active Window & Process Supervision**: Automatically focuses target windows, monitors application launch cycles, and handles multi-app workflows. - ๐Ÿ“‹ **Integrated System Utilities**: Clipboard management (copy/paste), webpage scraping to markdown, and window repositioning. --- ## ๐Ÿ—๏ธ System Architecture ``` +---------------------------------------+ | User Desktop Goal | | "Open Spotify & play my fav playlist" | +-------------------+-------------------+ | v +---------------------------------------+ | Hikari Runtime Engine | | (hikari.agent.service) | +-------------------+-------------------+ | +----------------------------+----------------------------+ | | v v +----------------------------------+ +----------------------------------+ | hikari.tree.service | | hikari.desktop.service | | Windows Accessibility Tree | | Process & Window Supervisor | | - Interactive Clickable Nodes | | - Active Window Detection | | - Informative Text Elements | | - Window Geometry & Handles | | - Scrollable Offset Detection | | - Optional Screenshot Capture | +----------------+-----------------+ +----------------+-----------------+ | | +----------------------------+----------------------------+ | v +---------------------------------------+ | Dynamic XML Prompt Engine | | (hikari.agent.prompt.service) | | Desktop State & Schema Serialization | +-------------------+-------------------+ | v +---------------------------------------+ | Large Language Model | | (Groq / Gemini / OpenAI / Ollama) | | | | Verified previous action | | Persisted UI coordinates | | Multi-step roadmap | | Immediate action logic | | Target tool & parameters | +-------------------+-------------------+ | v +---------------------------------------+ | Dynamic Tool Dispatcher | | (hikari.agent.tools.service) | | Click โ€ข Type โ€ข Launch โ€ข Shell โ€ข Drag | +-------------------+-------------------+ | v +---------------------------------------+ | Native Windows OS Execution | +---------------------------------------+ ``` --- ## ๐Ÿ“ฆ Installation Hikari requires **Windows 10/11** and **Python 3.13+**. ### Via PyPI (Recommended): ```bash pip install hikari-agent ``` ### From Source: ```bash git clone https://github.com/CodewithEvilxd/hikari.git cd hikari uv venv uv pip install -e ".[dev]" ``` --- ## โš™๏ธ Environment Configuration Create a `.env` file in your workspace (or copy `.env-example`): ```env # Groq Cloud API Key (Recommended for ultra-fast execution) GROQ_API_KEY="gsk_your_groq_api_key_here" # Google Gemini API Key GOOGLE_API_KEY="your_google_gemini_api_key_here" # OpenAI API Key (Optional) OPENAI_API_KEY="sk-your_openai_api_key_here" ``` --- ## ๐ŸŽฎ Quickstart: Interactive CLI Launch the interactive assistant: ```bash python main.py ``` ```text _ _ _____ _ __ _____ _____ | | | |_ _| |/ / /\ | __ \|_ _| | |__| | | | | ' / / \| |__) | | | | __ | | | | < / /\\ \ _ / | | | | | |_| |_| . \ / ____ \ | \ \ _| |_ |_| |_|_____|_|\_/_/ \_\| \_\_____| ๅ…‰ - Autonomous Windows AI Agent Developed by Nishant Gaurav (Codewithevilxd) Choose your AI Model Engine: 1. Google Gemini 2.0 Flash (Recommended - Superfast & Free Tier) 2. OpenAI GPT-4o (High Precision Desktop Control) 3. OpenAI GPT-4o-mini (Budget Fast Option) 4. Groq Cloud AI (Ultra-low Latency - GPT-OSS / Qwen / Compound) 5. Local Ollama (Private / Offline) Hikari > Open Spotify and play my Discover Weekly playlist ๐Ÿš€ Executing: Open Spotify and play my Discover Weekly playlist... ๐Ÿ’ญ Thought: Launch the Spotify desktop application. ๐ŸŽฏ Action: Launch Tool(name="spotify") ๐Ÿ”ญ Observe: Spotify launched. ๐Ÿ’ญ Thought: Click on the search bar to locate Discover Weekly. ๐ŸŽฏ Action: Click Tool(loc=[140, 72], button="left", clicks=1) ... โœ… Done: Discover Weekly playlist is now playing. ``` --- ## ๐Ÿ’ป Python SDK Guide Easily integrate Hikari into your custom scripts, automated workflows, and multi-agent frameworks: ### Example 1: Basic Desktop Automation ```python from langchain_groq import ChatGroq from hikari.agent import Agent from dotenv import load_dotenv load_dotenv() # Initialize LLM llm = ChatGroq(model_name="openai/gpt-oss-120b", temperature=0.1) # Initialize Agent agent = Agent( llm=llm, browser="chrome", use_vision=False, auto_minimize=True, max_steps=15 ) # Run Task result = agent.invoke("Open Notepad, write a welcome note for Hikari AI, and save it to Desktop") print("Agent Finished:", result.content) ``` ### Example 2: Web Research & Data Extraction ```python from langchain_google_genai import ChatGoogleGenerativeAI from hikari.agent import Agent llm = ChatGoogleGenerativeAI(model="gemini-2.0-flash", temperature=0.1) agent = Agent(llm=llm, max_steps=10) # Autonomous browser navigation and information gathering result = agent.invoke("Open Chrome, navigate to GitHub trending, and tell me the #1 Python repo today") print(result.content) ``` --- ## ๐Ÿงฐ Built-in Tool Catalog Hikari provides 15 production-ready native Windows automation tools: | Tool Name | Parameters | Return Type | Description | |:---|:---|:---:|:---| | **`Launch Tool`** | `name: str` | `str` | Launches applications from Start Menu or PATH (`notepad`, `chrome`, `calc`, `spotify`). | | **`Click Tool`** | `loc: (x,y)`, `button: left\|right\|middle`, `clicks: 0..3` | `str` | Precise clicking with hover (0), single (1), double (2), or triple (3) click modes. | | **`Type Tool`** | `loc: (x,y)`, `text: str`, `clear: bool`, `caret_pos: start\|idle\|end`, `press_enter: bool` | `str` | Natural typing into focused fields with caret positioning and enter submission. | | **`Shell Tool`** | `command: str` | `str` | Executes native PowerShell scripts and returns stdout, stderr, and exit codes. | | **`Switch Tool`** | `name: str` | `str` | Brings target running application window to the foreground. | | **`Resize Tool`** | `name: str`, `loc: (x,y)`, `size: (w,h)` | `str` | Resizes and repositions window layouts dynamically. | | **`Scroll Tool`** | `loc: Optional[(x,y)]`, `type: horizontal\|vertical`, `direction: up\|down\|left\|right`, `wheel_times: int` | `str` | Native mouse wheel scrolling on panes and web views. | | **`Drag Tool`** | `from_loc: (x,y)`, `to_loc: (x,y)` | `str` | Drags UI elements or files across exact screen coordinates. | | **`Move Tool`** | `to_loc: (x,y)` | `str` | Moves mouse pointer smoothly along natural Bezier curves. | | **`Shortcut Tool`**| `shortcut: list[str]` | `str` | Triggers key combinations (e.g. `['ctrl', 'c']`, `['alt', 'tab']`, `['win', 'r']`). | | **`Key Tool`** | `key: str` | `str` | Presses individual keys (`enter`, `escape`, `tab`, `backspace`, `f5`). | | **`Clipboard Tool`**| `mode: copy\|paste`, `text: Optional[str]` | `str` | Reads from or writes text to the Windows system clipboard. | | **`Scrape Tool`** | `url: str` | `str` | Scrapes webpage HTML and converts it into clean Markdown text. | | **`Wait Tool`** | `duration: int` | `str` | Pauses execution for specified seconds to allow UI rendering. | | **`Done Tool`** | `answer: str` | `str` | Signals successful task completion and formats final response. | --- ## ๐Ÿงช Automated Testing Hikari maintains an automated test suite with **159 unit tests** covering all internal subpackages: ```bash pytest tests/ -v ``` ```text tests/unit/agent/test_agent_utils.py ......................... PASSED [ 30%] tests/unit/agent/agent_tools/test_agent_tools_service.py ..... PASSED [ 60%] tests/unit/desktop/test_desktop_init.py ...................... PASSED [ 85%] tests/unit/tree/test_tree_views.py ........................... PASSED [100%] ============================= 159 passed in 1.94s ============================= ``` --- ## ๐Ÿ—บ๏ธ Project Structure ```text hikari/ โ”œโ”€โ”€ hikari/ โ”‚ โ”œโ”€โ”€ __init__.py # Root package exports โ”‚ โ”œโ”€โ”€ agent/ โ”‚ โ”‚ โ”œโ”€โ”€ service.py # Main Agent orchestrator & LangGraph state machine โ”‚ โ”‚ โ”œโ”€โ”€ state.py # Pydantic agent state & memory โ”‚ โ”‚ โ”œโ”€โ”€ utils.py # XML parsing & image serialization โ”‚ โ”‚ โ”œโ”€โ”€ views.py # Data schemas & action models โ”‚ โ”‚ โ”œโ”€โ”€ prompt/ # Dynamic system, action & observation prompts โ”‚ โ”‚ โ”œโ”€โ”€ registry/ # Dynamic tool execution registry โ”‚ โ”‚ โ””โ”€โ”€ tools/ # Native Windows tools (Click, Type, Shell, etc.) โ”‚ โ”œโ”€โ”€ desktop/ โ”‚ โ”‚ โ”œโ”€โ”€ config.py # System application exclusion rules โ”‚ โ”‚ โ”œโ”€โ”€ service.py # Windows process & window management โ”‚ โ”‚ โ””โ”€โ”€ views.py # App & DesktopState schemas โ”‚ โ””โ”€โ”€ tree/ โ”‚ โ”œโ”€โ”€ config.py # Accessibility control definitions โ”‚ โ”œโ”€โ”€ service.py # Native Accessibility Tree parser โ”‚ โ”œโ”€โ”€ utils.py # Coordinate calculation & bounding box math โ”‚ โ””โ”€โ”€ views.py # Interactive & scrollable node schemas โ”œโ”€โ”€ tests/ # 14 unit test suites (159 tests) โ”œโ”€โ”€ LICENSE # MIT License โ”œโ”€โ”€ main.py # Interactive Rich CLI assistant โ”œโ”€โ”€ pyproject.toml # PyPI package configuration โ””โ”€โ”€ README.md # Documentation ``` --- ## ๐Ÿ“œ License This project is licensed under the **MIT License** โ€” see the [LICENSE](LICENSE) file for details. --- ## ๐Ÿ‘ค Author & Maintainer **Nishant Gaurav (Codewithevilxd)** - ๐Ÿ™ **GitHub**: [@CodewithEvilxd](https://github.com/CodewithEvilxd) - ๐Ÿ“ง **Email**: [codewithevilxd@gmail.com](mailto:codewithevilxd@gmail.com) โ€ข [btwitznishantgaurav@gmail.com](mailto:btwitznishantgaurav@gmail.com) - ๐ŸŒ **PyPI**: [https://pypi.org/project/hikari-agent/](https://pypi.org/project/hikari-agent/) - ๐Ÿ“ฆ **Repository**: [https://github.com/CodewithEvilxd/hikari](https://github.com/CodewithEvilxd/hikari) ---

Hikari (ๅ…‰) โ€” Autonomous Windows Desktop Intelligence.
Crafted with passion by Nishant Gaurav (Codewithevilxd)