Agentic

Elixir VersionLicensePackage

A composable AI agent runtime for Elixir. Provides a complete agent loop with skills, working memory, knowledge persistence, and tool use. Drop it into any Elixir project to get a fully functional AI agent.

Features

Installation

Add Agentic to your dependencies in mix.exs:

def deps do
  [
    {:agentic, "~> 0.1.0"}
  ]
end

Database Backend

Agentic uses Recollect for knowledge persistence. Recollect supports two database backends:

Option A: libSQL (Recommended for new projects) Single-file SQLite with native vector support. Zero configuration.

def deps do
  [
    {:agentic, "~> 0.1.0"},
    {:ecto_libsql, "~> 0.9"}
  ]
end

Configure Recollect:

config :recollect,
  database_adapter: Recollect.DatabaseAdapter.LibSQL,
  repo: MyApp.Repo,
  embedding: [
    provider: Recollect.Embedding.OpenRouter,
    dimensions: 768
  ]

Option B: PostgreSQL (For existing installations) Traditional server-based database with pgvector extension.

def deps do
  [
    {:agentic, "~> 0.1.0"},
    {:postgrex, "~> 0.19"},
    {:pgvector, "~> 0.3"}
  ]
end

Configure Recollect:

config :recollect,
  database_adapter: Recollect.DatabaseAdapter.Postgres,
  repo: MyApp.Repo,
  embedding: [
    provider: Recollect.Embedding.OpenRouter,
    dimensions: 1536
  ]

Quick Start

result = Agentic.run(
  prompt: "Create a README.md file for my project",
  workspace: "/path/to/your/project",
  callbacks: %{
    llm_chat: fn params -> MyLLM.chat(params) end
  }
)

{:ok, %{text: response, cost: 0.05, tokens: 150, steps: 3}}

Architecture

Agentic uses a stage pipeline architecture. Each stage wraps the next, receiving the context and a next function to call downstream:

ContextGuard → ProgressInjector → LLMCall → ModeRouter → ToolExecutor → CommitmentGate

Profiles

Profile Behavior
:agentic Full pipeline with tool use, progress tracking, context management (default)
:agentic_planned Two-phase: plan → execute with tracking and verification
:turn_by_turn LLM proposes changes, human approves before execution
:conversational Simple call-respond, no tools

Callbacks API

The callbacks map connects Agentic to your LLM provider and external systems:

Required

Optional

Core Tools

Agentic ships with built-in tools for file operations:

Extend via the skills system or custom callbacks.

Storage Backends

All backends have a :local file-based implementation.

Configuration

Agentic.run(
  prompt: "...",
  workspace: "/path",
  callbacks: %{llm_chat: &my_llm/1},
  profile: :agentic,          # which profile to use
  mode: :agentic,            # shorthand for profile
  system_prompt: "...",      # custom system prompt
  history: [...],            # prior messages
  model_tier: :primary,      # which model tier to use
  cost_limit: 5.0,          # per-session cost limit in USD
  session_id: "agx-...",     # custom session ID
  user_id: "user-123",       # for API key resolution
  plan: %{...}               # pre-built plan (for agentic_planned)
)

Development

mix deps.get          # Install dependencies
mix setup             # Setup database
mix test             # Run tests
mix format           # Format code
mix dialyzer         # Type check

License

BSD-3-Clause — See LICENSE for details.

Contributing

Contributions welcome. Please ensure tests pass and dialyzer is clean before submitting PRs.