npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agent-smith/feat-sqlite

v0.0.2

Published

Sqlite features for Agent Smith cli

Downloads

98

Readme

pub package

@agent-smith/feat-sqlite — SQLite Database Integration for AI Agents

A plugin that provides SQLite database integration for Agent Smith, enabling AI agents to read and write data through natural language queries with schema awareness. Part of the Agent Smith toolkit.

Features

  • 🗄️ Schema-Aware Queries — Automatic schema introspection for intelligent query generation
  • 🔒 Safe Read Operations — Readonly database connections for read-only access
  • ✍️ Protected Writes — Write operations require user confirmation via interactive prompts
  • 🔄 Atomic Transactions — Query execution wrapped in transactions for data integrity
  • 🤖 AI Agents — Pre-built agents for full read/write and read-only database interactions
  • 🌐 Natural Language — Ask questions in plain English and get structured results

Documentation

For AI Agents

  • Codebase Summary — Architecture, key files, and patterns for the @agent-smith/feat-sqlite plugin
  • SQLite Plugin — Complete plugin documentation with actions, tools, and agents

For Humans

Installation

npm i -g @agent-smith/feat-sqlite

Add the plugin to your config.yml file and run the conf command:

plugins:
  - "@agent-smith/feat-sqlite"
lm conf

Quick Start

Create a minimal agent with SQLite read-only access:

description: Sqlite read only agent
model: qwen4b
toolsList:
  - sqlreadquery
variables:
  required:
    dbpath:
      description: The database path

Usage

Database Operations

The plugin provides two main tools for interacting with SQLite databases:

| Tool | Description | Access Level | |------|-------------|--------------| | sqlquery | Read data or write in the database. Schema-aware and can read/write everything | Full (read + write) | | sqlreadquery | Read data by asking a question in natural language. Schema-aware read-only access | Read-only |

Both tools require the dbpath variable to be set, pointing to your SQLite database file.

AI Agents

The plugin provides two pre-built agents:

Full Read/Write Agent (runsqliteagent)

A complete SQLite database assistant that decomposes user questions and delegates tasks to tools.

  • Uses sqlquery tool for schema-aware read and write operations
  • Requires user confirmation for any write operations
  • Best for: Database administration, data manipulation, schema changes

Read-Only Agent (runsqlitereadagent)

A safe SQLite database reader that analyzes questions and executes read queries only.

  • Uses sqlreadquery tool for schema-aware read-only queries
  • No write operations possible — maximum safety
  • Best for: Data analysis, reporting, research queries

Security Model

  • Read operations use readonly database connections for safety
  • Write operations require user confirmation via interactive prompts (@inquirer/prompts)
  • Query execution is wrapped in transactions via better-sqlite3's transaction API for atomicity

API Reference

Available Tools

sqlquery

Execute schema-aware SQL queries with full read/write access.

// The agent automatically handles:
// 1. Schema introspection
// 2. Query generation from natural language
// 3. Transaction wrapping for writes
// 4. User confirmation prompts for modifications

Parameters:

  • dbpath (required): Path to the SQLite database file
  • query: Natural language description of the operation or SQL query

sqlreadquery

Execute read-only SQL queries using natural language questions.

// The agent automatically handles:
// 1. Schema introspection
// 2. Query generation from natural language
// 3. Readonly connection enforcement

Parameters:

  • dbpath (required): Path to the SQLite database file
  • question: Natural language question about the database

Agent Configuration

Full Agent Example

description: Sqlite full access agent
model: qwen4b
toolsList:
  - sqlquery
variables:
  required:
    dbpath:
      description: The database path

Read-Only Agent Example

description: Sqlite read only agent
model: qwen4b
toolsList:
  - sqlreadquery
variables:
  required:
    dbpath:
      description: The database path

Important Notes

  • 🔑 The dbpath variable is required for all operations — always specify the database path
  • 📝 Write operations will prompt for user confirmation before executing
  • 🔒 Read-only agents cannot perform any write operations, even if requested
  • ⚡ All operations are wrapped in transactions for data integrity
  • 🌐 Compatible with Node.js environments (uses better-sqlite3 native module)

Dependencies

  • better-sqlite3 — Fast SQLite bindings for Node.js
  • @inquirer/prompts — Interactive prompts for user confirmation

License

MIT