Developing

Embedding AI filters

Register filters and response-store extensions when embedding Praxis AI.

Praxis AI v0.11.0 (alpha) 2 min read

Switching projects opens that project’s default documentation release.

Versions marked “overview” do not contain this page. Selecting one opens that version’s documentation overview.

On this page

For operators composing YAML pipelines, use the capability overview. This page describes Rust registration and host integration.

Organization

AI filters are organized across two crates:

apis/src/                 Provider API integrations
  anthropic/              Anthropic Messages API
  openai/                 OpenAI Responses and Conversations APIs
  classifier/             Shared request classification
  store/                  Response and conversation persistence

filters/src/              Cross-provider behavior
  agentic/                MCP and A2A
  guardrails/             AI content guardrails
  inference/              Model routing
  prompt_enrich/          Prompt injection
  token_usage/            Token counting, headers, and per-tenant metrics

Praxis AI also inherits all base proxy filters from Praxis core through FilterRegistry::with_builtins(). This includes routing, load balancing, headers, credential injection, JSON-RPC parsing, CORS, compression, IP ACLs, and other general proxy behavior. Those filters are intentionally documented in the Praxis core filter reference, not duplicated here.

Registration

In-tree AI filters are registered by praxis_ai_filters::register_ai_filters. Downstream consumers that only need AI filters (for example an Envoy ExtProc) can depend on praxis-ai-filters without the proxy crate:

use praxis_filter::FilterRegistry;

let mut registry = FilterRegistry::with_builtins();
praxis_ai_filters::register_ai_filters(&mut registry);
// Or: let registry = praxis_ai_filters::build_ai_registry();

praxis-ai-proxy builds the full registry in three ownership layers:

let mut registry = FilterRegistry::with_builtins();
praxis_ai_filters::register_ai_filters(&mut registry);
register_external_filters(&mut registry); // proxy-only

This keeps core filters, in-tree AI filters, and auto-discovered extensions at clear ownership boundaries. External filter auto-discovery stays proxy-only.

Pipelines that use OpenAI store or rehydrate filters must also install the response-store extension:

pipeline.add_pipeline_extension(
    Box::new(praxis_ai_apis::store::ResponseStoreRegistry::new()),
);

The AI proxy does this in server/src/pipelines.rs. Other hosts (such as ExtProc) must do the same.