Gregius Data – Interactions

Overview

Gregius Data automatically captures every search and RAG conversation turn as an interaction record — a complete, inspectable history of AI-driven activity on your WordPress site. Site administrators can access and extend these records for analysis, troubleshooting, and downstream workflow integration.

Prerequisites

  • WordPress 6.9+ with Gregius Data plugin installed and activated
  • At least one AI model registered and active on the site
  • At least one data connection configured and active

Understanding Interaction Records

Interaction records capture what happened during a search or RAG conversation turn. Each record is stored as a gg_interaction post with typed meta fields and a canonical JSON payload that preserves full context.

Search interactions

A search interaction records the query, connection used, whether the search returned zero results, and the source context (frontend, rest, wpcli, or mcp). Exactly one record is created per completed search event.

RAG conversation interactions

RAG interactions group turns by conversation UUID. The first turn creates a new conversation record; subsequent turns with the same UUID append to the existing record. Each turn preserves the query, response, model chain, latency, and source documents.

Key fields

FieldDescription
Typesearch or rag
SourceWhere the interaction originated — frontend, rest, wpcli, or mcp
ConnectionThe data connection used for the request
Conversation IDUUID identifying the RAG conversation (RAG only)
Zero resultsWhether a search returned no results (search only)
JSON payloadFull interaction context including query, model metadata, sources, and latency

Accessing Interactions Through the REST API

Interaction records are available through the gg-data/v1/interactions REST endpoint family. All requests require authentication.

List and read interactions

Administrators can list and read all interaction records on the site. Non-admin users are scoped to their own records only.

RouteMethodDescription
/interactionsGETList interactions
/interactions/{id}GETRead a single interaction

Create, update, and delete interactions

Creating interaction records directly through the REST API is restricted to administrators. Non-admins create interactions through the RAG and search lifecycle (chat endpoints or search integrations).

RouteMethodDescription
/interactionsPOSTCreate interaction (admin only)
/interactions/{id}PUT / PATCHUpdate interaction
/interactions/{id}DELETEDelete interaction (soft-delete by default; use force=true for hard delete)

Multisite behavior

In multisite, administrators see records from their own site by default. Super administrators can supply an explicit site_id parameter to access interaction records on another site within the network. Non-super-admin requests that include site_id are denied.


Customizing Interactions Through Hooks

The interaction subsystem exposes hooks — extension points that let integrators enrich metadata, shape log context, and react to newly recorded interactions.

HookTypePurpose
gg_data_interaction_meta_fieldsFilterRegister additional meta fields for interaction records
gg_data_interaction_log_contextFilterAdd or modify context data written to the operational log
gg_data_interaction_recordedActionReact to newly recorded interactions (analytics, notifications, external sync)

Next Steps

View on GitHub: You can review, fork, and inspect the entire codebase and core logic over at the repository on GitHub.

Gregius Data is the open-source AI orchestration layer for WordPress.