Pi-Mojo – A Mojo Port of Pi AI Agent Toolkit
pi-mojo is a native Mojo port of the Pi AI agent platform, providing a compiled, self-contained reference implementation for exploring systems-level agent architectures. The repository includes 10 progressive examples, from basic AI completions to full-fledged autonomous agent loops, with support for GPU acceleration, concurrent web scraping, and more.
Notifications You must be signed in to change notification settings
Fork 0
Star 1
BranchesTags
Open more actions menu
Folders and files
NameName
Last commit message
Last commit date
Latest commit
History
1 Commit
1 Commit
examples
examples
src
src
tests
tests
.gitattributes
.gitattributes
.gitignore
.gitignore
ARCHITECTURE.md
ARCHITECTURE.md
LICENSE
LICENSE
README.md
README.md
pixi.toml
pixi.toml
Repository files navigation
pi-mojo is a native Mojo port of Pi—a popular, tool-efficient agentic AI platform (utilizing only 4 core tools) prominent in open-source systems like OpenClaw. It provides the Mojo community with a compiled, self-contained reference implementation to explore systems-level agent architectures, type-safe structures, and native C integrations.
🚀 Getting Started
Prerequisites
Ensure you have the Modular Mojo compiler installed:
mojo --version
Running Examples
The repository features progressive, systems-level agentic AI examples demonstrating the spectrum of agent architectures and compiled system execution capabilities:
🤖 Example 1: Progressive AI Completions & Chat (Sample Run)
A progressive exploration of text completions, starting from zero dependencies, local llm and live cloud LLMs.
mojo -I src examples/example_1_basic_ai/example_basic_ai.mojo
💻 Example 2: Systems Coding Agent (Sample Run)
A systems agent that translates high-level task descriptions into shell commands and executes them natively via system process spawning.
mojo -I src examples/example_2_coding_agent/example_coding_agent.mojo
🔧 Example 3: Native AI Tool Calling (Sample Run)
A cloud-only agent demonstrating how to expose native Mojo functions as tools (Function Calling) to a live LLM.
mojo -I src examples/example_3_tool_calling/example_tool_calling.mojo
🌊 Example 4: Real-Time AI Event Streaming (Sample Run)
A cloud-only completions stream demonstrating real-time SSE token parsing and flushed printing.
mojo -I src examples/example_4_event_stream/example_event_stream.mojo
⚡ Example 5: GPU-Accelerated Hardware Analytics (Sample Run)
A local performance benchmark executing parallel token classification on a hardware-accelerated GPU pipeline.
mojo -I src examples/example_5_gpu_analytics/example_gpu_analytics.mojo
🌐 Example 6: Concurrent Multi-URL Web Research Agent (Sample Run)
A concurrent web agent spawning parallel thread pools to fetch and sanitize multiple websites concurrently, then synthesizing research reports via Gemini 3.5 Flash.
mojo -I src examples/example_6_web_researcher/example_web_researcher.mojo
🔍 Example 7: Codebase Semantic Auditor & Refactoring Agent (Sample Run)
A systems security auditor agent crawling files dynamically and extracting zero-copy StringView lifetimes slices to synthesize refactoring proposals.
mojo -I src examples/example_7_codebase_auditor/example_codebase_auditor.mojo
🔁 Example 8: Long-Running Coder Agent (Sample Run)
An autonomous systems-level coding agent running in a persistent loop (Plan -> Act -> Observe -> Repeat) that maintains session state history, executes system commands, and solves multi-step engineering tasks.
mojo -I src examples/example_8_long_running_coder/example_long_running_coder.mojo --interactive
💓 Example 9: Local LLM Service Heartbeat Check (Sample Run)
A diagnostics checker that executes health queries and round-trip timing checks to verify the state of local LLM models on port 1234.
mojo -I src examples/example_9_local_heartbeat/example_local_heartbeat.mojo
🔄 Example 10: Towards Full-Fledged Agentic Loops (Sample Run)
An autonomous background-ticking daemon agent driven by a heartbeat clock that polls workspace states, monitors compilation status, patches error logs, and drives tasks to completion.
mojo -I src examples/example_10_full_fledged_agent/example_full_fledged_agent.mojo --interactive
🏗️ High-Level System Architecture
pi-mojo unifies compiled, high-performance systems logic with dynamic agent loops. High-level agent packages leverage low-level subprocess utilities and filesystem caching tools to achieve zero-overhead execution.
For complete technical implementation details, sequence diagrams of the execution, and the repository directory layout, refer to ARCHITECTURE.md.
🛡️ License
Licensed under the MIT License (refer to the LICENSE file for details). All attributions belong to the original upstream Pi development team.
About
A mojo port of the PI AI Agent Toolkit
Resources
Readme
License
MIT license
Uh oh!
There was an error while loading. Please reload this page.
Activity
Stars
1 star
Watchers
1 watching
Forks
0 forks
Report repository
Releases
1 tags
Packages 0
Uh oh!
There was an error while loading. Please reload this page.
Contributors
Uh oh!
There was an error while loading. Please reload this page.
Languages
Mojo 97.9%
Python 2.1%