Complete agent loop
Run iterative tool calling until the agent reaches a final response, with guardrails before and after model calls.
Agent runtime
Adam is a portable C agent runtime with tool calling, memory, sessions, voice, structured output, research mode, and local or cloud LLMs behind one interface.
Adam Agent
Embeddable agent library
Best for
Embeddable and database agents
Repository
GitHubProject
Adam gives applications a complete agent loop in an embeddable C library: configure a provider, keep conversation history, call tools, stream output, save sessions, and attach long-term memory.
It works with cloud APIs and local GGUF models through the same interface, and it can be embedded directly into SQLite or PostgreSQL as SQL functions that query the same database.
Why it matters
Capabilities
Run iterative tool calling until the agent reaches a final response, with guardrails before and after model calls.
Use Anthropic, OpenAI, Google Gemini, compatible APIs, or local GGUF models via llama.cpp behind one interface.
Ship file I/O, shell, calculator, SQL, web fetch/search, HTTP POST, memory, research, and multi-agent tools.
Use hybrid BM25 and vector search through SQLite-Memory and SQLite-Vector for persistent agent context.
Embed Adam inside SQLite or PostgreSQL so agents can inspect schema, generate SQL, and query local data.
Persist conversations, stream tokens, build voice agents, run concurrent jobs, and target native or browser runtimes.
Sample code
Initialize Adam, configure a provider, keep history, run the agent, and clean up the runtime.
#include "adam.h"
int main(void) {
adam_init();
adam_settings_t *s = adam_create_settings();
adam_settings_set_provider(
s,
ADAM_API_ANTHROPIC,
getenv("ANTHROPIC_API_KEY"),
"claude-sonnet-4-20250514"
);
adam_history_t *h = adam_history_create();
adam_run_result_t r = adam_run(
s,
h,
"What changed in the project memory this week?"
);
printf("%s\n", r.final_response);
adam_run_result_free(&r);
adam_history_destroy(h);
adam_settings_destroy(s);
adam_cleanup();
}