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 FreeAgentOptions, query
from loong_agent.llm import OpenAICompatibleProvider

async def main():
    options = FreeAgentOptions(
        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/free_agent/
├── client.py          # FreeAgentClient / 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loong_agent-0.0.1.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loong_agent-0.0.1-py3-none-any.whl (48.7 kB view details)

Uploaded Python 3

File details

Details for the file loong_agent-0.0.1.tar.gz.

File metadata

  • Download URL: loong_agent-0.0.1.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for loong_agent-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5ab463799746b8c3388fda99dd7e9d7c263f6239f36b52c7d1ef88212bf8cb8c
MD5 d0dd0187dabf7638a5d86fead08e2ae1
BLAKE2b-256 a4a3a5bce9026eb62dde3df8369aee122187f1940a60a7d7f7df700ea19e5fb5

See more details on using hashes here.

File details

Details for the file loong_agent-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: loong_agent-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 48.7 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for loong_agent-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7f8f06b03e55c2b56f5dbdab71bf8dbfd62dc0b915dbb32abf5a32eb5d273ea
MD5 41801f8e1f917523e327e57604abda82
BLAKE2b-256 20093f06c22620775d3fb596b87f7ae79535643a43e709aefd0cd889244609bc

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.2

2 files

This release

0.0.1 This release

2 files

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