Skip to content

agentAI Agent Runtime on the BEAM

Multi-gateway, SQLite-backed, tool-augmented chat with any OpenAI-compatible API — built in Gleam on Erlang/OTP.

~600
Tests
14
Built-in Tools
3
Gatways
12
Services
50
Configurable knobs

What can agent do?

Agent is designed for autonomous operation — it can run as an interactive CLI, a Telegram bot, or a headless daemon processing scheduled tasks.

In a conversation, agent can:

  • Execute shell commands in a sandboxed environment with approval gating
  • Browse the web via Playwright — navigate, click, type, scroll, screenshot
  • Fetch and analyze web pages with SSRF protection and content scanning
  • Store and retrieve memories in SQLite, with deduplication and validation
  • Search past conversations with FTS5 full-text search
  • Manage cron jobs — create, list, update, and delete scheduled tasks at runtime
  • Send Telegram notifications with DND-aware delivery coordination
  • Run code in Python, Node, or Bash

On its own, agent can:

  • Execute scheduled tasks every N minutes via Pulse (time-driven PULSE.md)
  • Reflect on conversations after each turn and consolidate memories automatically
  • Recover from crashes — active sessions resume on daemon restart
  • Auto-title sessions via LLM after the first exchange
  • Compress context when the conversation outgrows the model’s context window

Quick Example

sh
# Set up
git clone https://github.com/p424p424/agent.git && cd agent
echo 'DEEPSEEK_API_KEY=sk-...' > .env

# Interactive chat
$ gleam run
You: What's in this directory?
agent: [runs ls] Here's what I found:
  src/  test/  agent.toml  gleam.toml  README.md

You: Search for the latest Gleam release notes and summarize them
agent: [fetches web page, analyzes content]
  Gleam 1.16 brings improved LSP support, faster compilation, and...

# Daemon mode (Telegram bot + admin TCP)
$ gleam run -m agent_app
# Bot is now live on Telegram

# Admin CLI
$ gleam run -m agent_admin sessions list
$ gleam run -m agent_admin db stats

Project Status

AreaStatus
CLI REPL + Daemon + TelegramProduction-ready
Tool system (bash, web, browser, memory, code, cron, session search)Complete
SQLite persistence (WAL, FTS5, sessions, memories)Complete
Guardrails (circuit breaker, SSRF, safety scanning)Complete
Context compression + tool loop detectionComplete
OTP supervision treeComplete
Structured autonomy (Pulse, Reflection, Cron, Harness)Complete
Notifications + DND coordinationComplete
Parallel tool executionComplete
Multi-provider routingDeferred
Streaming responsesDeferred
Sub-agent delegationDeferred

Ready to try?

Jump to the Getting Started guide to install and run agent in under 2 minutes.

Built with Gleam on the BEAM/Erlang VM.