Sherlock

Read‑only database access for AI agents.

A pixel-art robot dressed as Sherlock Holmes draws data up cables from five databases and reads it through a magnifying glass.

Install

Install the binary for macOS on Apple silicon, Linux x64 or Linux arm64

curl -fsSL https://raw.githubusercontent.com/michaelbromley/sherlock/main/install.sh | bash

Install the agent skill

npx skills add michaelbromley/sherlock -g

Ask your agent

Set up a sherlock connection to my staging Postgres database and show me the tables.

See it in action

Slow query

“Why is checkout slow?”

sherlock -c prod-db indexes orders
sherlock -c prod-db query "EXPLAIN ANALYZE SELECT * FROM orders WHERE customer_id = 42"

No index on orders.customer_id, so every checkout scans 2.3M rows. Add one.

Report

“Compare Q4 sales by month.”

sherlock -c prod-db query "SELECT date_trunc('month', created_at) AS month, sum(total) FROM orders WHERE created_at >= '2025-10-01' GROUP BY 1"

October £142k, November £219k, December £195k. November was up 54%.

Account

“Why can’t jane@example.com check out?”

sherlock -c prod-db query "SELECT status, suspension_reason FROM users WHERE email = 'jane@example.com'"

Her account was suspended over a payment dispute that was resolved three days ago, and never reinstated.

Redis

“Is our cache actually helping?”

sherlock -c redis-prod info --section stats
sherlock -c redis-prod slowlog

The hit rate is 60%, and a health check runs KEYS * every 10 seconds. Switch it to SCAN.

Built paranoid