Alex66

Alex66

AlexClaw is a single-user autonomous AI agent built on Elixir/OTP. It accumulates knowledge in PostgreSQL, executes workflows on schedule and on demand, and communicates via Telegram. Every task is routed to the cheapest available LLM that satisfies the required reasoning tier — including fully local models via Ollama or LM Studio.

This is a personal agent, not a platform. One operator, one codebase, fully auditable.
Actual version v0.3.3

Core components

Workflow engine — Workflows are composable DAGs stored in PostgreSQL. Each step specifies a skill, config, optional LLM tier/provider overrides, and conditional routes. Skills declare their possible outcomes via a routes/0 callback (e.g. [:on_items, :on_empty, :on_error]) and return a triple tuple {:ok, result, :branch_name} — the executor matches the branch to determine the next step. Steps without routes fall through linearly (backward compatible). The input_from field enables fan-in patterns — a step can pull its input from any earlier step rather than the immediately preceding one. Loop protection via visited set prevents infinite cycles. Steps support on_circuit_open and on_missing_skill policies (halt / skip / fallback) for resilience. A SchedulerSync GenServer keeps Quantum cron jobs in sync with DB-configured schedules at runtime, without restart.

LLM Router — Every LLM call declares a tier (light, medium, heavy, local). The router resolves the enabled provider with the lowest priority value for that tier from PostgreSQL, with ETS caching. Falls back to local if no cloud provider is available. Supports openai_compatible, ollama, gemini, anthropic, and custom provider types. Daily usage limits per provider, tracked in ETS and persisted across restarts. Provider selection can be overridden at three levels (most specific wins): step-level llm_tier/llm_model fields, workflow-level default_provider, or the global tier-based fallback chain.

Memory — PostgreSQL + pgvector knowledge store. Each entry has a kind (fact, summary, news_item, conversation, security_review, etc.), a source, an optional TTL, and a 768-dimension embedding (HNSW index, cosine distance). Embedding generation is async — Memory.store/3 inserts immediately, a TaskSupervisor child generates the vector and updates the row. Hybrid search runs vector similarity and keyword queries in parallel. Falls back to keyword-only when no embedding provider is configured.

Circuit breaker — Per-skill OTP process under a DynamicSupervisor. ETS for lock-free state reads on the hot path, Process.send_after for reset timers. Three consecutive failures open the circuit; Telegram notification on open and recovery. Zero external dependencies.

Config system — All settings live in PostgreSQL, cached in ETS, editable from the admin UI without restart. Sensitive values (API keys, tokens, OAuth secrets) are encrypted at rest with AES-256-GCM; the key is derived from SECRET_KEY_BASE via HKDF-SHA256. Changes broadcast via Phoenix PubSub so all processes pick them up immediately.

Web automator sidecar — Python/Playwright FastAPI service for browser automation. Supports recording sessions (with noVNC for interactive use), replaying saved steps headlessly, and single-shot scrape/screenshot. Called from the WebAutomation skill over HTTP.

Resources — Shared data objects assignable to workflows, stored in PostgreSQL. Types: rss_feed, website, document, api, automation (recorded browser sessions). Skills access assigned resources via args[:resources] in run/1. The feeds management page is a convenience wrapper over resources filtered by type rss_feed.

Admin UI — Phoenix LiveView, fully server-rendered (no JS hooks). 13 pages: dashboard, interactive chat (semantic memory search, pick any LLM provider), workflows, workflow run history (step-level output and duration), skills, scheduler, LLM providers, feeds, resources, memory, DB browser, config, and a real-time log viewer with severity filtering powered by an in-memory ring buffer attached to the Erlang Logger.

Security — Session auth with ETS-based rate limiting on login. Optional TOTP 2FA (per-workflow, not global). HMAC-SHA256 GitHub webhook verification using a CachingBodyReader plug to preserve the raw body for signature checks. Telegram chat_id filtering.


Built-in skills

rss_collector, llm_transform, telegram_notify, research, web_search, web_browse, web_automation, github_security_review, google_calendar, google_tasks, api_request, conversational

New skills implement a single @behaviour AlexClaw.Skill with a run/1 callback. The SkillRegistry discovers them at startup via module introspection. Skills can also be created dynamically at runtime — new skill modules are compiled and hot-loaded into the running BEAM without restart, and become immediately available to workflows and the dispatcher.


Dependencies

Phoenix 1.7, Ecto/Postgrex, pgvector, Req, Quantum, NimbleTOTP, SweetXml, Floki, Jason. No external dependencies for the circuit breaker or config encryption.


License

Apache 2.0

https://github.com/thatsme/AlexClaw

Showing Posts 1 to 4

Alex66

Alex66 OP

In the mean time, i’m testing next release with clustering capabilities between agents/workflows ..

Alex66

Alex66 OP


Graphic rapresentation of Hub Maps made by Giulia.

Alex66

Alex66 OP

For the community.
I’ve been building AlexClaw using Giulia, my own BEAM code intelligence platform, as the primary development pair — alongside Claude as AI assistant. The workflow is iterative: Giulia analyzes the codebase, I review, I push back, we refine.

I chose Elixir deliberately: OTP supervision for agent fault tolerance, the process model for skill isolation, pattern matching for workflow branching. These weren’t arbitrary choices.

But I use AI extensively in my development workflow, and I won’t pretend otherwise. If something feels off with conventions, idioms, or OTP patterns — I want to know. Honest feedback only. I’m here to improve the code, not defend it.

Alex66

Alex66 OP

Latest documentation of project

— All posts loaded —

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews