Skip to main content

Bog Agents - batteries-included agent harness for building AI agents. Supports any major provider (Anthropic, OpenAI, AWS Bedrock, Google, etc.) and local models via Ollama. Built on LangGraph.

Project description

Bog Agents

A production-grade Python SDK for building LangGraph-based AI agents. One create_agent() call gets you a compiled graph with file/shell/git tools, sub-agents, plan mode, auto-quality checks, and 80+ composable middleware. Pluggable backends (local, sandbox, composite). Works with any tool-calling LLM.

PyPI License Downloads

Quick Install

pip install bog-agents
# or
uv add bog-agents

Getting Started

  1. Set your API key (the default model uses Anthropic):
export ANTHROPIC_API_KEY="sk-ant-..."

Or for OpenAI, Google, etc.:

export OPENAI_API_KEY="sk-..."
export GOOGLE_API_KEY="AI..."
  1. Create and run an agent:
from bog_agents import create_agent

# Uses Claude Sonnet by default (needs ANTHROPIC_API_KEY)
agent = create_agent()

# Or specify a different provider
agent = create_agent(model="openai:gpt-4o")
agent = create_agent(model="google_genai:gemini-2.0-flash")

# Run the agent
result = agent.invoke(
    {"messages": [{"role": "user", "content": "Hello!"}]},
    config={"configurable": {"thread_id": "my-thread"}},
)
  1. Run as an HTTP server (optional):
pip install 'bog-agents[serve]'
from bog_agents import create_agent
from bog_agents.serve import AgentServer

agent = create_agent()
server = AgentServer(agent)
server.run()  # Starts on http://127.0.0.1:8420

What Is This?

Using an LLM to call tools in a loop is the simplest form of an agent. This architecture, however, can yield agents that are "shallow" and fail to plan and act over longer, more complex tasks.

Applications like "Deep Research", "Manus", and "Claude Code" have gotten around this limitation by implementing a combination of four things: a planning tool, sub agents, access to a file system, and a detailed prompt.

bog-agents is a Python package that implements these in a general purpose way so that you can easily create a Bog Agents for your application. For a full overview and quickstart of Bog Agents, the best resource is our docs.

Acknowledgements: This project was primarily inspired by Claude Code, and initially was largely an attempt to see what made Claude Code general purpose, and make it even more so.

Features

Core Agent

  • LangGraph-powered — composable agent with middleware architecture
  • Multi-model — works with Anthropic, OpenAI, Google, DeepSeek, and any LangChain-compatible LLM
  • Sub-agents — spawn isolated sub-agents for complex tasks
  • File system — read, write, edit, search files with pluggable backends
  • Planning — built-in todo list and plan mode for structured task execution

Middleware (Pluggable)

Middleware Description
FilesystemMiddleware File read/write/edit/search + multi-edit and batch read
GitToolsMiddleware 9 git tools: status, diff, log, commit, add, branch, stash, blame, show
RepoMapMiddleware Structural code map with symbol extraction (Python, JS, TS, Rust, Go, Java)
CheckpointingMiddleware Git-based snapshots before mutations, with undo/diff
CostTrackerMiddleware Token usage, cost estimation, budget enforcement, effort levels
PlanModeMiddleware Read-only mode that blocks mutating tools
AutoQualityMiddleware Auto-lint/test after edits with project detection
ArchitectMiddleware Dual-model architect/reviewer with cross-model consultation
ParallelAgentsMiddleware Concurrent sub-agent task execution
LifecycleHooksMiddleware 15 event types for external tool integration
ContextPackingMiddleware Smart structured context compression
SummarizationMiddleware Auto-summarization when context window fills
MemoryMiddleware Persistent AGENTS.md memory across sessions
SkillsMiddleware Custom skill/instruction loading
SafeToolsConfig Per-tool auto-approval rules

Security

  • OS-level sandbox — bubblewrap (Linux), seatbelt (macOS), landlock isolation
  • Human-in-the-loop — configurable tool approval with interrupt handling

Quick Start

from bog_agents import create_agent

agent = create_agent(
    model="anthropic:claude-sonnet-4-6",
    enable_git_tools=True,
    enable_repo_map=True,
    enable_checkpointing=True,
    enable_cost_tracking=True,
    enable_plan_mode=True,
    auto_lint=True,
    working_dir="/path/to/project",
)

# Run the agent
result = await agent.ainvoke(
    {"messages": [{"role": "user", "content": "Fix the failing tests"}]},
    config={"configurable": {"thread_id": "my-session"}},
)

Resources

Releases & Versioning

See our Releases and Versioning policies.

Contributing

As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.

For detailed information on how to contribute, see the Contributing Guide.

Project details


Download files

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

Source Distribution

bog_agents-0.7.3.tar.gz (379.1 kB view details)

Uploaded Source

Built Distribution

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

bog_agents-0.7.3-py3-none-any.whl (461.3 kB view details)

Uploaded Python 3

File details

Details for the file bog_agents-0.7.3.tar.gz.

File metadata

  • Download URL: bog_agents-0.7.3.tar.gz
  • Upload date:
  • Size: 379.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for bog_agents-0.7.3.tar.gz
Algorithm Hash digest
SHA256 e8714d14ba151e12c7509489150bc7111e3eaf3f1069863c434b2eb7020ec84b
MD5 d5fe9d8bb12a153c8dfd06597f365965
BLAKE2b-256 7eeb31b5da2496e35a508f6f59267827b2c442e4831f5acd5c4dc72cd85f4bab

See more details on using hashes here.

File details

Details for the file bog_agents-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: bog_agents-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 461.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for bog_agents-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 97505f6f09aabf9e3afeb6a8edef2301d30770387c7b42585b55df9a3a3da0d9
MD5 bc35fe8bbffc0dac7f9c142f7105b39d
BLAKE2b-256 0a5e7c2476c9c80cf0fc173f88e29528137ca76f897252787dcb8f1a0ddcb1af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page