Deterministic Content Intelligence Layer
Pattern-based content classifier designed for analytics, moderation, and marketplace teams. Classifies user reviews, descriptions, listings, and comments into categories with clean, deterministic outputs.
- Deterministic - Same input always produces same output
- Explainable - Every classification includes evidence with exact text spans
- Fast - 1000+ texts/second per instance
- Auditable - Full version tracking for compliance
- No ML required - Rule-based, no training data needed
make buildCreate packs/spam.yaml:
id: spam
name: Spam Detection
version: "1.0.0"
rules:
- id: spam-001
path: spam.promotional
severity: high
rationale: Contains promotional spam
type: keyword_token
keywords:
- "buy now"
- "limited offer"
- "click here"
- id: spam-002
path: spam.contact
severity: medium
rationale: Contains contact solicitation
type: regex
pattern: '\b(call|text)\s*me\s*at\s*[\d\-]+'# Generate signing keys (first time only)
./bin/fynx keygen --out fynx
# Compile pack
./bin/fynx pack build packs/spam.yaml -o packs/spam --key fynx.keyFYNX_PACKS_DIR=./packs ./bin/fynx-servercurl -X POST http://localhost:8080/classify \
-H "Content-Type: application/json" \
-d '{"text": "Buy now! Limited offer! Call me at 555-1234"}'Response:
{
"labels": [
{"path": "spam.contact", "severity": "medium"},
{"path": "spam.promotional", "severity": "high"}
],
"evidence": [
{
"path": "spam.promotional",
"rule_id": "spam-001",
"rationale": "Contains promotional spam",
"spans": [{"start": 0, "end": 7}, {"start": 9, "end": 22}],
"pack_id": "spam",
"pack_version": "1.0.0"
},
{
"path": "spam.contact",
"rule_id": "spam-002",
"rationale": "Contains contact solicitation",
"spans": [{"start": 24, "end": 45}],
"pack_id": "spam",
"pack_version": "1.0.0"
}
],
"meta": {
"engine_version": "0.1.0",
"pack_versions": ["spam@1.0.0"],
"trace_id": ""
}
}Classify text content.
Request:
{
"text": "Content to classify",
"request_id": "optional-trace-id",
"include_matched_text": false
}Response:
{
"labels": [{"path": "category.subcategory", "severity": "high"}],
"evidence": [{
"path": "category.subcategory",
"rule_id": "rule-001",
"rationale": "Why this matched",
"spans": [{"start": 0, "end": 10}],
"pack_id": "pack-name",
"pack_version": "1.0.0"
}],
"meta": {
"engine_version": "0.1.0",
"pack_versions": ["pack@1.0.0"],
"trace_id": "request-id"
}
}Liveness probe.
Readiness probe (includes pack status).
Engine and pack versions.
Prometheus metrics.
Fynx includes a built-in web dashboard for monitoring engine health, active packs, and testing rules in real-time.
# Enable dashboard via environment variable
FYNX_ENABLE_DASHBOARD=true ./bin/fynx-serverAccess the dashboard at http://localhost:8080/dashboard.
Update policy packs without restarting the server. Fynx can fetch signed packs from a remote registry and swap them atomically.
# Configure registry and hot-swap interval
FYNX_REGISTRY_URL="https://registry.fynx.ai"
FYNX_HOTSWAP_INTERVAL="10m"Matches whole words (tokens).
type: keyword_token
keywords:
- spam
- scam
case_sensitive: falseMatches substrings anywhere in text.
type: keyword_substring
keywords:
- "buy now"
- "click here"Matches RE2 regular expressions.
type: regex
pattern: '\b\d{1,3}%\s*(off|discount)\b'
case_sensitive: falseinfo- Informational, no action neededlow- Minor issuemedium- Moderate concernhigh- Significant issuecritical- Severe, immediate attention required
| Variable | Description | Default |
|---|---|---|
PORT |
Server port | 8080 |
FYNX_PACKS_DIR |
Directory with compiled packs | ./packs |
FYNX_PUBLIC_KEY |
Public key for signature verification | - |
FYNX_AUTH_TOKENS |
Comma-separated auth tokens | - |
docker build -t fynx-server .
docker run -p 8080:8080 -v ./packs:/packs fynx-serverapiVersion: apps/v1
kind: Deployment
metadata:
name: fynx
spec:
replicas: 3
template:
spec:
containers:
- name: fynx
image: fynx-server:latest
ports:
- containerPort: 8080
env:
- name: FYNX_PACKS_DIR
value: /packs
volumeMounts:
- name: packs
mountPath: /packs
livenessProbe:
httpGet:
path: /healthz
port: 8080
readinessProbe:
httpGet:
path: /readyz
port: 8080See examples/packs/ for ready-to-use policy packs:
- spam.yaml - Spam and promotional content detection
- abuse.yaml - Harassment, threats, and scam detection
- quality.yaml - Content quality assessment
# Run tests
make test
# Run linter
make lint
# Build and run locally
make run
# Build Docker image
make dockerAGPL-3.0. Copyright (c) 2025 KikuAI Lab