Skip to content

Lightweight LLM hub designed for agentic workflows. It comes with built-in concurrency, tool execution, rate limiting, and conversation persistence.

Notifications You must be signed in to change notification settings

TolgaOk/agentgate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgentGate

Go 1.25 v0.1.0 macOS | Linux

aga (short for Agent Gate) is a lightweight LLM hub designed for agentic workflows (human usage welcome too). It comes with built-in concurrency, tool execution, rate limiting, and conversation persistence.

Install

curl -fsSL https://raw.githubusercontent.com/TolgaOk/agentgate/main/scripts/install.sh | bash

Or with Go:

go install github.com/TolgaOk/agentgate/cmd/aga@latest

Usage

aga ask "What files are in this directory?"           # create conversation
aga ask --json "summarize this project"               # JSON output (for agentic call)
aga ask --context /tmp/session.json  "now fix it"     # continue a conversation (or start a new one)
aga ask --skill ./skills "say hi in whatsapp"         # with custom skill directory

aga auth openai                                       # sign in with ChatGPT (subscription)
aga auth status                                       # check token status

aga metrics                                           # llm usage summary

See aga ask --help for more options.

How it works

Agent Loop

  ┌──────────┐   ┌────────┐   ┌──────────┐   ┌──────────────┐
 ┌──────────┐│   │        │──▶│ LLM API  │──▶│ text,        │
┌──────────┐││   │        │   │(+context)│   │ context.json │
│ aga ask  ││───▶│        │   └────┬─────┘   └──────────────┘
│ "prompt" │┘    │ SQLite │  tool? │
└──────────┘     │        │        ▼
                 │        │   ┌──────────┐
                 │        │◀──┤ tool exec│
                 │        │   │(+context)│
                 │        │   └──────────┘
                 └────────┘
                     ▲ 
                     └── limit concurrent requests, usage tracking

Persistency: Each conversation is saved.

aga preserves the chat history in context.json for each conversation, updated incrementally with each LLM and tool call.

Concurrency: Limit parallel API calls.

Concurrent LLM calls are queued and executed with a limit per provider (or globally) via SQLite. A heartbeat mechanism automatically frees slots from crashed processes.

Tools: Extend the tools by adding skill.md that describes a CLI tool.

Tools can be registered as special skills that describe the CLI tool within the frontmatter inside the metadata attribute. For example:

skills/ls.md

---
name: ls
description: List directory contents
metadata:
  command: ls
  args:
    path:
      type: string
      position: 1
      desc: directory to list
    all:
      type: boolean
      flag: "-a"
      desc: show hidden files
---
<!-- No body is needed for tool skills -->

Skills with metadata.command in the frontmatter are registered as tools.

Note: aga comes barebones with no tools or skills. You can add bash tool to cover most use cases or each CLI tool individually (including aga itself).

Providers

  • openai
    • Use subscription: aga auth openai (primary)
    • Requires API key: OPENAI_API_KEY (fallback)
  • anthropic (subscription is not supported)
    • Requires API key: ANTHROPIC_API_KEY
  • openrouter
    • Requires API key: OPENROUTER_API_KEY

AG_PROVIDER overrides the provider (e.g. AG_PROVIDER=anthropic). AG_MODEL overrides the model (e.g. AG_MODEL=claude-sonnet-4-20250514).

Configuration

~/.config/agentgate/
  config.toml
  system.md         # system prompt
  tokens.json       # OAuth tokens (auto-managed)
  skills/           # skill folder

~/.agentgate/
  aga.db            # SQLite

config.toml

provider = "openai"                # openai, anthropic, openrouter
model = "gpt-5.2"                  # model name for the provider
max_tokens = 8192                  # max output tokens per LLM call
max_steps = 20                     # max agent loop iterations
concurrent_global_limit = 3        # max concurrent LLM calls across all providers
concurrent_per_provider_limit = 1  # max concurrent LLM calls per provider

[policy]                           # tool execution policy 
timeout = "30s"                    # default timeout for tool execution
allowed = ["ls"]                   # auto accept
blocked = ["sudo"]                 # always reject

Policy: Tools not in allowed require y/N confirmation. Tools in blocked are always rejected.

Use --auto-accept to skip confirmations for agentic use (blocked tools are still rejected).

About

Lightweight LLM hub designed for agentic workflows. It comes with built-in concurrency, tool execution, rate limiting, and conversation persistence.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors