Kafka Fraud Detector
Score transactions for fraud in real-time on Kafka streams. Uses velocity analysis, geo-anomaly detection, and pattern matching per customer.
connic init my-project --templates=kafka-fraud-detectorOverview
Consumes transactions from a Kafka topic and scores each for fraud risk using velocity analysis, geo-anomaly detection, and knowledge base pattern matching. Conditional tools restrict admin_override access based on context. Concurrency control queues transactions by customer_id to prevent race conditions. High-risk alerts are formatted by a tool agent and published to a Kafka outbound topic.
Use cases
Payment fraud detection
Score every transaction in real-time for fraud signals like impossible travel, velocity spikes, and known patterns.
Risk-based routing
Route transactions to different review queues based on risk level: auto-approve, flag, hold, or block.
Pattern learning
Store novel fraud patterns in the knowledge base so detection improves over time.
Architecture
Scaffolded project structure
Running connic init my-project --templates=kafka-fraud-detector creates this file tree.
kafka-fraud-detector/
agents/
fraud-scorer.yaml
fraud-escalator.yaml
tools/
fraud_tools.py
middleware/
fraud-scorer.py
schemas/
fraud-assessment.json
requirements.txt
README.mdGet started
Install the template, create a Connic project, and deploy. Choose Git (automatic on push) or CLI (works with any provider).
Prerequisites
- Python 3.10+
- A Connic account (create a project first)
- API key for your LLM provider (e.g. Gemini, OpenAI) to add in project variables
Install and scaffold
Install the SDK and create a project from this template.
pip install connic-composer-sdkconnic init my-project --templates=kafka-fraud-detectorThen cd my-project
Deploy
Pick your deployment method. Git auto-deploys on push; CLI works with GitLab, Bitbucket, or no Git.
Git integration
- In Connic: Project Settings → Git Repository, connect your GitHub repo
- Settings → Environments: map branch (e.g.
main) to Production - Push your scaffolded project to that repo
git add .
git commit -m "Add Kafka Fraud Detector template"
git push origin mainCLI deploy
- In Connic: Project Settings → CLI, create an API key and copy project ID
- Run
connic loginin your project folder connic testto try with hot-reload, orconnic deployfor production
connic login
connic test # Ephemeral dev env with hot-reload
connic deploy # Deploy to productionConnect and configure
Add a Kafka inbound connector for the transactions topic and a Kafka outbound connector for fraud alerts. Configure bootstrap servers and optional SASL authentication. Add your LLM provider API key in Project Settings → LLM Provider API Keys.
Template source
Browse the full template, contribute improvements, or fork for your own use.
connic-org/connic-awesome-agents/tree/main/kafka-fraud-detectorExplore other templates
View allResearch Assistant
Break complex research questions into sub-tasks, dispatch specialist agents in parallel, and synthesize web and internal data into structured, scored reports.
SQS Order Processor
Validate and fulfill orders from SQS queues with fraud detection, inventory checks, and concurrency keys. Results publish to an outbound queue.
Telegram Personal Assistant
Multimodal Telegram assistant that processes text, images, voice, video, and documents. Searches the web, saves notes and knowledge, and schedules follow-up reminders with persistent sessions.
Lead Enricher
Enrich and qualify new signups by researching their company and scoring fit against your ideal customer profile. Saves qualified leads.