Coding

Show HN: Adam – An embeddable cross-platform AI agent library

A new embeddable AI agent library, Adam, has emerged, leveraging SQLite's database expertise to integrate machine learning models with relational data. By utilizing SQLite's query language, Adam enables developers to query and manipulate AI-driven data in a familiar, SQL-like syntax. This novel approach could simplify the integration of AI and data storage, potentially accelerating the development of AI-powered applications.

Adam is an embeddable AI agent library that integrates machine learning models with relational data using SQLite's database expertise. It enables developers to query and manipulate AI-driven data in a familiar, SQL-like syntax.

Overview

Adam provides a complete agent loop, including tool calling, memory, sessions, voice, streaming, and structured output, all in one #include. It works with cloud APIs, such as Anthropic, OpenAI, and Google Gemini, as well as local models like llama.cpp, through the same interface. Adam compiles on various platforms, including macOS, Linux, Windows, iOS, Android, and WASM.

Features

Adam's features include:

  • Agent loop with tool calling and automatic iteration until final response
  • Support for multiple providers, including Anthropic, OpenAI, and Google Gemini
  • Local vision with multimodal image understanding via llama.cpp and mmproj
  • Image generation with native image output via Gemini image models
  • Database extensions for SQLite and PostgreSQL
  • 13 built-in tools, including file I/O, shell, calculator, SQL, web fetch/search, and HTTP POST
  • Long-term memory with hybrid BM25 + vector search via SQLite
  • Session persistence with save/load conversations using UUIDv7 keys
  • Telegram bot integration with text, voice, images, tools, and memory
  • Voice support with STT, TTS, and full audio pipeline
  • Streaming with real-time token delivery via callback
  • Structured output with validation and retry
  • Evolution loop for self-improving agents
  • Research mode for autonomous multi-iteration information gathering
  • Multi-agent support with independent settings and tools
  • Guardrails with pre-send and post-receive validation callbacks
  • Response cache with LRU hash table keyed on model and message history
  • History management with clone, summarize, and token estimation
  • Thread pool for concurrent agent execution
  • Filesystem sandbox with tools restricted to explicitly allowed directories
  • Cross-platform support with arena allocator for zero-leak per-iteration memory

Database Extensions

Adam can be embedded directly inside SQLite and PostgreSQL as a SQL extension. The agent can query the same database it's loaded in, allowing for natural language queries and answers from the data. The database extensions provide functions such as adam_config, adam, adam_ask, adam_sql, adam_create_session, adam_get_session, and adam_clear_session.

The MIT-licensed Adam library is available on GitHub, with a comprehensive API reference and examples for various use cases, including simple conversations, tool calling, local models, and database queries.

Similar Articles

More articles like this

Coding 2 min

Vibe coding and agentic engineering are getting closer than I'd like

As developers increasingly blur the lines between code and cognition, a new wave of "vibe coding" techniques is emerging, leveraging techniques like diffusion-based text synthesis to craft AI models that can intuitively grasp and manipulate the emotional resonance of digital artifacts. This trend is converging with agentic engineering, where AI systems are designed to autonomously generate and adapt to user interfaces, raising concerns about the erosion of human agency in digital interactions. The stakes are high, with implications for everything from user experience to social control.

Coding 1 min

The next great software company won't sell software

A new breed of "service-as-a-software" startups—like LayerX—is dismantling the traditional SaaS model by embedding AI agents directly into enterprise workflows, charging per transaction rather than per seat. By abstracting away the software layer entirely, these companies monetize outcomes (e.g., automated invoice processing, fraud detection) while letting clients bypass licensing, integrations, and even UI. The shift threatens legacy SaaS incumbents by turning software from a product into an invisible, pay-per-use utility.

Coding 1 min

What makes a good smartphone camera?

Advances in multi-frame noise reduction and optical zoom capabilities are redefining the smartphone camera landscape, as evidenced by recent flagship models boasting 1/1.3" sensors and 5x hybrid zoom. However, the true differentiator lies in the implementation of AI-driven autofocus and real-time HDR processing, which can significantly enhance low-light performance and color accuracy. This convergence of hardware and software innovations is driving a new era of smartphone photography.

Coding 3 min

GLM 5.1 offers a low-cost alternative to Claude Opus for developers

Zhipu AI's GLM 5.1 is emerging as a budget alternative to Anthropic's Claude Opus 4.6, priced at $18 per month—three times cheaper than Opus. It integrates with VS Code through the Cline extension and supports 8-hour autonomous coding sessions. Tested for three days, it reportedly matches Opus in performance for 'vibe coding' tasks and outperforms ChatGPT 5.4 and Gemini. Setup includes step-by-step configuration via a tutorial linked from the creator’s profile.

Coding 3 min

Claude Code vs. Codex/GPT-5.5: When to Use Which AI Coding Assistant

Claude Code and Codex/GPT-5.5 excel in different coding scenarios, with Claude handling complex architecture and refactoring while Codex shines in UI, prototyping, and security testing. Token efficiency and task-specific strengths make both tools complementary rather than competitive. Here’s how to integrate them into your workflow for maximum productivity.

Coding 2 min

Optimizing Claude Code with Graphify

Graphify is a plugin that turns raw files into a knowledge graph, mapping connections between files and providing context to Claude Code without burning tokens. This solution was inspired by Andrej Karpathy, co-founder of OpenAI, and has gained 39K stars in a couple of weeks. By using Graphify, users can save 70 times on token per search and get better answers. The plugin creates a knowledge graph and preemptively creates semantic relationships between files, allowing Claude Code to understand the relationships between them.