pa-audit-db

Persist WhatsApp messages into a PostgreSQL table for auditing.

5|1|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/netanel-abergel/pa-skills --skill pa-audit-db
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pa-audit-db
Source: https://github.com/netanel-abergel/pa-skills/tree/main/skills/pa-audit-db
Command: npx skills add https://github.com/netanel-abergel/pa-skills --skill pa-audit-db

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Centralizes every inbound and outbound WhatsApp message into a queryable PostgreSQL store so agents and operators can audit conversations, trace costs, and recover message history reliably.

Core Features & Use Cases

  • Production-ready schema with timestamps, sender metadata, tokens and cost fields, and an optional embedding column for semantic search.
  • Search and analytics via full-text indexes, ivfflat embedding index (pgvector), and common query patterns for recent messages, group history, keyword search, daily counts, and cost summaries.
  • Deployment flexibility with local or managed Postgres instructions, environment variable integration (PA_DB_URL), and troubleshooting guidance for common setup issues.
  • Use Case: Run this during agent provisioning to enable message auditing, conversation recall, and token/cost monitoring for WhatsApp-based PAs.

Quick Start

Set PA_DB_URL to your Postgres connection string and restart the OpenClaw gateway to begin persisting WhatsApp messages.

Frequently Asked Questions about pa-audit-db

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I store and audit WhatsApp messages in a PostgreSQL database?

Storing and auditing WhatsApp messages in PostgreSQL involves persisting inbound and outbound messages into a dedicated messages table. This provides reliable storage, conversation tracing, and token cost monitoring for agent operations.

Can I perform semantic search on WhatsApp message history using pgvector?

Yes, you can perform semantic search on WhatsApp message history using pgvector. The database schema includes an optional embedding column and an ivfflat embedding index to support semantic queries alongside standard keyword search and group conversation lookups.

What database schema is needed for tracking WhatsApp message tokens and costs?

Tracking WhatsApp message tokens and costs requires a production-ready PostgreSQL schema with specific fields for timestamps, sender metadata, tokens, and cost data. This structure enables accurate cost summaries and daily message count analytics.

Does this message logging approach work with local and managed Postgres instances?

Yes, this message logging approach works with both local and managed Postgres instances. It uses the PA_DB_URL environment variable for connection configuration and provides troubleshooting guidance for resolving common database setup issues.

Why do I need to configure PA_DB_URL for OpenClaw agents?

You need to configure PA_DB_URL for OpenClaw agents to establish a connection to your PostgreSQL database. Setting this environment variable and restarting the OpenClaw gateway activates message persistence for conversation recall and auditing.