Gregius Data – Hooks

Overview

Gregius Data offers site developers and plugin integrators a controlled orchestration surface — WordPress actions and filters spanning every major subsystem: sync, chunking, search, RAG, interactions, logging, and provider communication. Each extension point ships with a documented signature, a default value, and a stability tier so you know exactly how firmly you can build on it.

Prerequisites

  • WordPress 6.9+ with Gregius Data plugin installed and activated
  • Familiarity with WordPress add_filter and add_action APIs
  • Access to theme functions.php, an mu-plugin, or a custom plugin for your extension code

Understanding Hook Tiers

Every Gregius Data hook is classified into a stability tier that tells you how safe it is to build on. All hooks use the gg_data_ prefix for consistent discovery.

Tier 1 public hooks

Tier 1 hooks are stable, documented extension contracts — tuned for third-party use. Their names, signatures, and default values stay backward compatible within minor releases. Build long-term integrations on Tier 1.

Examples of Tier 1 areas:

  • Sync control — which posts to sync, which meta keys to skip
  • Chunking strategy — custom chunking logic and payload shaping
  • Search tuning — relevance weights, similarity thresholds, rate limits
  • Interaction tracking — custom metadata and post-record callbacks
  • RAG lifecycle — retrieval filtering, LLM response post-processing, tool registration
  • Log governance — retention policy, pre- and post-purge observability
  • Vector operations — batch deletion tuning

Tier 2 semi-public hooks

Tier 2 hooks are in active code and available for advanced integration, but their signatures may evolve more freely. Build on them with defensive guardrails — prefer Tier 1 where a comparable hook exists.

Tier 2 areas include:

  • RAG governance — retrieval policy, rerank policy, threshold profiles, abstain messaging, permission filtering
  • Provider surface — OpenAI, Anthropic, Gemini, DeepSeek request/response filtering
  • Operational controls — batch sizes for clean and orphan operations, CLI batch limits, rate limit tuning
  • Observability — streaming failure, token usage tracking and reset

Tier 3 internal hooks

Tier 3 hooks are implementation internals — not a stable public API. They cover RAG planner internals, comparison pipeline thresholds, and fine-grained policy controls. Do not build critical external integrations on Tier 3 hooks.


Extension Categories

Gregius Data hooks are organized by the subsystem they extend:

CategoryWhat you can controlExample hooks
Configuration and batchTune throughput for sync, embeddings, vector deletiongg_data_post_sync_batch_size, gg_data_vector_delete_batch_size
Sync controlFilter which posts and meta keys are synced, enrich metadatagg_data_should_sync_post, gg_data_metadata_manifest
ChunkingRegister custom chunk strategies, shape chunk outputgg_data_chunking_strategies, gg_data_embedding_chunks
SearchAdjust relevance weights, similarity thresholds, rate limitsgg_data_search_title_weight, gg_data_search_rate_limit
InteractionAdd custom analytics metadata, react to recorded interactionsgg_data_interaction_meta_fields, gg_data_interaction_feedback_received
RAG toolsRegister tools, intercept tool execution, react to completiongg_data_rag_tools, gg_data_rag_complete
RAG lifecycleFilter retrieval queries, pre-retrieval criteria, LLM responses, source relevancegg_data_rag_search_query, gg_data_rag_llm_response
RAG governanceSet retrieval policy, rerank policy, threshold profiles, rate limitsgg_data_rag_retrieval_policy, gg_data_rag_rate_limit
ProviderIntercept API requests and responses per providergg_data_openai_request, gg_data_anthropic_call
Log retentionOverride retention period, observe purge eventsgg_data_log_retention_days, gg_data_after_purge_logs

Getting Started with Hooks

All hooks use standard WordPress add_filter and add_action APIs. Place your extension code in a custom plugin, an mu-plugin, or your theme’s functions.php.

When choosing a hook, check its tier in the developer documentation:

  • Tier 1 — safe for production, backward compatible within minor releases
  • Tier 2 — useful for advanced use cases, test after updates
  • Tier 3 — implementation details, avoid for critical integrations

Each documented hook includes its type (filter or action), parameter signature, default value, and source file location. Filters must return the expected value type; actions are fire-and-forget.

For a complete catalog of every hook with signatures, defaults, examples, and source file references, see the developer documentation.


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.