CodeArkt
CodeArkt is a battery-included implementation of the CodeAct framework with support for the multi-agent architecture. Ship autonomous agents that can reason, write, execute & iterate over code. All from a single Python package.
✨ Why CodeArkt?
- Multi-agent orchestration – coordinate hierarchies of specialist agents.
- Secure Python sandbox – secure, ephemeral Docker execution environment for code actions.
- First-class tool ecosystem – auto-discover & register MCP tools.
- Drop-dead simple UI – launch an elegant Gradio chat or run the terminal client.
- Production ready – typed codebase (
mypy --strict), CI, tests, Docker & Apache-2.0 license.
🚀 Quick Start
Install the package:
pip install codearkt # requires Python ≥ 3.12
Run your MCP servers:
python -m academia_mcp --port 5056 # just an example MCP server
Run a server with a simple agent and connect it to your MCP servers:
import os
from codearkt.codeact import CodeActAgent
from codearkt.llm import LLM
from codearkt.server import run_server
# Use your own or remote MCP servers
mcp_config = {
"mcpServers": {"academia": {"url": "http://0.0.0.0:5056/mcp", "transport": "streamable-http"}}
}
# Create an agent definition
api_key = os.getenv("OPENROUTER_API_KEY", "")
assert api_key, "Please provide OpenRouter API key!"
agent = CodeActAgent(
name="manager",
description="A simple agent",
llm=LLM(model_name="deepseek/deepseek-chat-v3-0324", api_key=api_key),
tool_names=["arxiv_download", "arxiv_search"],
)
# Run the server with MCP proxy and agentic endpoints
run_server(agent, mcp_config, port=5055)
Now run a Python client:
from codearkt.client import query_agent
from codearkt.llm import ChatMessage
history = [ChatMessage(role="user", content="Find an abstract of the 2402.01030 paper")]
for event in query_agent(history, port=5055):
if event.content:
print(event.content, end="", flush=True)
Within seconds, you will see agents collaborating, executing Python snippets, and streaming the results back to your console.
You can also use existing clients, Gradio and terminal:
uv run -m codearkt.terminal --port 5055
uv run -m codearkt.gradio --port 5055
🧩 Feature Overview
| Area | Highlights |
|---|---|
| Agents | Hierarchical manager / worker pattern, pluggable prompts, configurable iteration limits |
| Tools | Automatic discovery via MCP registry, Python execution (python_interpreter) |
| Execution | Sandboxed temp directory, timeout, streamed chunks, cleanup hooks |
| Observability | AgentEventBus publishes JSON events – integrate with logs, websockets, or GUI. Opentelemetry is also supported. |
| UI | Responsive Gradio Blocks chat with stop button, syntax-highlighted code & output panels |
| Extensibility | Compose multiple CodeActAgent instances, add your own LLM backend, override prompts |
📖 Documentation
For now, explore the well-typed source code.
🛠️ Project Structure
codearkt/
├─ codeact.py # Core agent logic
├─ python_executor.py # Secure sandbox for arbitrary code
├─ event_bus.py # Pub/Sub for agent events
├─ gradio.py # Optional web UI
└─ ...
examples/
└─ multi_agent/ # End-to-end usage demos
🤝 Contributing
Pull requests are welcome! Please:
- Fork the repo & create your branch:
git checkout -b feature/my-feature - Install dev deps:
make install - Run the linter & tests:
make validate && make test - Submit a PR and pass the CI.
Join the discussion in Discussions or open an Issue.
📝 License
CodeArkt is released under the Apache License 2.0 – see the LICENSE file for details.
Metadata
Release files for codearkt 1.9.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| codearkt-1.9.5.tar.gz | 44.2 kB | Without provenance | Details for codearkt-1.9.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| codearkt-1.9.5-py3-none-any.whl | Python 3 | none | any | Details for codearkt-1.9.5-py3-none-any.whl |
Total release size: 84.1 kB
Release files / codearkt-1.9.5.tar.gz
| Download URL | codearkt-1.9.5.tar.gz |
|---|---|
| Size | 44.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69d91c0d6d3d091734d316294f9ff3805a5619540e0ef1a17194fc8ba04f15e7
|
|
BLAKE2b-256 checksum How to use checksums |
dae0c6f121ac9ca9d4fb91e11793899fc5bf0aff5a4b98e7b6ae34b3449bc22d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.0
|
Release files / codearkt-1.9.5-py3-none-any.whl
| Download URL | codearkt-1.9.5-py3-none-any.whl |
|---|---|
| Size | 39.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6425a503074f40bbf97a037646539ab3fe3bb3db8f019e8efce76857539d6562
|
|
BLAKE2b-256 checksum How to use checksums |
942816899c19b2dfa2a26772e0d42798536605c37f450f51c1e76319e49f2ffa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.0
|
Security for codearkt 1.9.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.