Skip to main content

loong-agent

Agent framework for all — a fully open-source, model-agnostic, pure-code autonomous AI Agent SDK.

Built on the ReAct (Reasoning + Acting) framework and inspired by the design of the Claude Agent SDK, it provides a thought-action-observation loop, a tool system, plugins, MCP, Skills, subagents, hooks, permissions, and tracing.

Features

  • Model-agnostic: works with any OpenAI-compatible API (OpenAI, local LLaMA.cpp / Ollama / vLLM, etc.).
  • Pure code implementation: all logic is written in Python source, with no dependency on commercial closed-source binaries.
  • ReAct loop: an autonomous execution engine of Think → Act → Observe.
  • Rich components: built-in tools, hook system, permission policies, MCP gateway, Skills, subagents, plugins, and OpenTelemetry tracing.

Installation

pip install -e .

Quick Start

import asyncio
from loong_agent import LoongAgentOptions, query
from loong_agent.llm import OpenAICompatibleProvider

async def main():
    options = LoongAgentOptions(
        llm=OpenAICompatibleProvider(
            base_url="https://api.openai.com/v1",
            api_key="sk-...",
            model="gpt-4o-mini",
        ),
        allowed_tools=["Read", "Write", "Bash", "Grep", "Glob"],
    )

    async for message in query("Review the code in src/", options=options):
        if message.type == "assistant":
            print(f"Agent: {message.text}")
        elif message.type == "result":
            print(f"Done! Usage: {message.usage}")

asyncio.run(main())

See examples/ for more examples.

Project Structure

src/loong_agent/
├── client.py          # LoongAgentClient / query entry point
├── loop/              # Agent Loop engine (ReAct loop)
├── llm/               # LLM adapter layer (OpenAI-compatible)
├── tools/             # Tool system + built-in tools (Read/Write/Edit/Bash/Grep/Glob)
├── hooks/             # Hook system
├── permissions/       # Permission system
├── mcp/               # MCP gateway (stdio / http / in-process)
├── skills/            # Skills system (SKILL.md)
├── subagents/         # Subagent system
├── plugins/           # Plugin system
├── tracing/           # OpenTelemetry tracing
└── types/             # Core types (Message / Options)

License

MIT

Metadata

Release files for loong-agent 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loong-agent 0.0.2
File Size Uploaded Provenance
loong_agent-0.0.2.tar.gz 28.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for loong-agent 0.0.2
File Interpreter ABI Platform
loong_agent-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 76.7 kB

Release files / loong_agent-0.0.2.tar.gz

Download URL loong_agent-0.0.2.tar.gz
Size 28.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c7e92d6fd77f8b619575a1ea494d5055b582fda56f96f196f71591e99c655d44
BLAKE2b-256 checksum
How to use checksums
095b386e77a13c1d567f0c2b5e925e17c589ecd345e11335133f53bed177c673
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / loong_agent-0.0.2-py3-none-any.whl

Download URL loong_agent-0.0.2-py3-none-any.whl
Size 48.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2254428ed1cf56f834aea30a68dcf9969fcbee7578bb1b777b19723edd19eaa1
BLAKE2b-256 checksum
How to use checksums
a545d039b3d8c7411a2cc3fe8dbbccc66714b3c0f7c257fbdc351837c61de96b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for loong-agent 0.0.2

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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page