Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/estebanrfp/gdb/llms.txt

Use this file to discover all available pages before exploring further.

Audit Option Documentation

Overview

The audit option is a lightweight, audit parameter for GenosDB.
When enabled, it scans the oplog for recently added or updated nodes, and deletes any nodes that violate the audit policy.
The process is fully asynchronous, uses a debounced trigger to avoid flooding the API, and can be configured with a custom prompt.
When you activate the audit option, the module is loaded dynamically at that moment—no manual import or setup is required.

Key Features

FeatureDescription
List-driven policy enforcementUses a language list to evaluate node content against a user-defined prompt.
Debounced executionPrevents excessive API calls by waiting 500 ms after the last change.
Automatic cleanupDeletes nodes that match the audit criteria directly from the database and oplog.
Customizable promptPass a prompt string when initializing the database to tailor the audit logic.
Graceful error handlingLogs API errors and continues operation without crashing the application.

Installation

The audit option is included with GenosDB.
To enable it, simply initialize your database with the audit parameter y un prompt personalizado:
import { gdb } from "genosdb";

const db = await gdb("my-db", {
  rtc: true,
  audit: { prompt: "detect offensive or inappropriate language, spam [find closely spaced timestamps] or prohibited content" }
});

Example

You can see a practical implementation in the following example: Open Todo List Audit Example

Build docs developers (and LLMs) love