Skip to main content

Thin runtime layer for multi-agent systems — cross-process dedup, TTL cache, single-flight, SQLite backend, and observability

Project description

AgentGlue banner

AgentGlue

Middleware orchestration for multi-agent systems.

GitHub release npm License

HilightsKey featuresHow it worksInstallQuick example

AgentGlue is a middleware layer that sits between your orchestrator and your tools, helping multi-agent systems coordinate overlapping work instead of repeating the same reads, searches, API calls, and state lookups over and over again.

📈 Hilights

Measured on the current 100-test benchmark suite and overlap-heavy multi-agent workloads:

  • 3.7× overall speedup across benchmarked scenarios
  • 73% total time saved (866.4ms → 234.9ms)
  • 76% cache hit rate across repeated shared work
  • 6.8× speedup on overlapping search-heavy scenarios
  • 5.0× speedup in the 10-agent heavy-overlap case
  • ~0.6ms median cache-check latency

More agents + more overlap = bigger wins.

✨ Key features

  • Exact-match dedup on tool name + args/kwargs hash
  • Single-flight / in-flight coalescing for concurrent identical calls
  • TTL result cache for repeated sequential calls
  • SQLite-backed cross-process cache for shared coordination across processes
  • Metrics and event recording for runtime inspection
  • Keep shared work coordinated across agents, tools, and processes
  • Stay framework-agnostic across OpenClaw, AutoGen, CrewAI, LangGraph, and custom systems

🧭 How it works

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃  🤖 Agent A    🤖 Agent B    🎯 Orchestrator       ┃  ← Intelligence Layer
┃                                                   ┃    Autonomous reasoning
┃  "Decide what to do"                              ┃    & task decomposition
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃                 ⚙️  AgentGlue                     ┃  ← Coordination Layer
┃         (Coordination Middleware)                 ┃    The "glue" that binds
┃                                                   ┃    agents to resources
┃  ┌──────────┬──────────┬──────────┬──────────┐    ┃
┃  │ Registry │  Router  │ State    │   Auth   │    ┃    · Registry:  discover tools
┃  │          │          │ Manager  │          │    ┃    · Router:    dispatch calls
┃  └──────────┴──────────┴──────────┴──────────┘    ┃    · StateMgr:  share context
┃                                                   ┃    · Auth:      access control
┃  "Know how to connect"                            ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃  🔧 Tools    📡 APIs    📁 Files    💾 State       ┃  ← Resource Layer
┃                                                   ┃    External capabilities
┃  "Do the actual work"                             ┃    & persistent storage
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

AgentGlue sits in the middle: agents keep their existing orchestration logic, tools keep their existing interfaces, and AgentGlue coordinates repeated work across both.

🛠 Install

1) Install the OpenClaw plugin

openclaw plugins install openclaw-agentglue

After install, restart the gateway:

systemctl --user restart openclaw-gateway

If you want to remove the plugins.allow security warning, add this to ~/.openclaw/openclaw.json:

{
  "plugins": {
    "allow": ["openclaw-agentglue"]
  }
}

Plugin docs: openclaw-agentglue/README.md

2) Clone the repo

git clone https://github.com/brickee/AgentGlue.git
cd AgentGlue

3) Install the Python package

python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e .

⚡ Quick example

from agentglue import AgentGlue

glue = AgentGlue(shared_memory=False, rate_limiter=False, task_lock=False)

@glue.tool(ttl=60)
def search_code(query: str) -> str:
    return f"results for {query}"

print(search_code("sqlite sidecar", agent_id="agent-a"))
print(search_code("sqlite sidecar", agent_id="agent-b"))
print(glue.report())

🔌 Links

⚖️ Disclaimer

This project is a personal open-source project developed in authors' personal capacity. It is not affiliated with, endorsed by, or representing any employer or organization the authors are associated with. All work on this project is performed on personal time and with personal resources.

📄 License

MIT

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

agentglue-0.3.2.tar.gz (34.7 kB view details)

Uploaded Source

Built Distribution

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

agentglue-0.3.2-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file agentglue-0.3.2.tar.gz.

File metadata

  • Download URL: agentglue-0.3.2.tar.gz
  • Upload date:
  • Size: 34.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for agentglue-0.3.2.tar.gz
Algorithm Hash digest
SHA256 6565f79287a2a693af92b88774dd48cd560931c93d74425e5ab090fb4a4459b2
MD5 195dcea40d98e0986da752bce487a83d
BLAKE2b-256 458413173a06d7623dfea725fd503604943bf891451a680e7d37a120213afd98

See more details on using hashes here.

File details

Details for the file agentglue-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: agentglue-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for agentglue-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4c961f7848338890e53e66fb1513fbf24960edb487e4e16fe313d9c4db0f3ec7
MD5 cceaae0e5921f60a7a7d3e168d79077e
BLAKE2b-256 adc074aee18bf0d210d360a7e1c12614c503ed4f37187e8951d1ce0d7f47f307

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