Monday, June 30, 2025

Why I Chose AI + Rules for Fraud Detection (Instead of Reinventing the Wheel)


“Smart systems don’t always mean new ideas. Sometimes they mean proven ones, applied well.”


๐Ÿงญ Introduction

When I started designing the architecture for Fraud-Free Swarajya, I spent time analyzing how successful real-world payment platforms like Stripe, Razorpay, Adyen, and PayPal combat fraud.

The pattern was clear:

๐Ÿ” They use AI models to detect patterns and Rules to enforce business logic.

It wasn’t a choice between the two — it was both.

That insight changed how I designed the system.


๐Ÿง  Why Not Just Use AI?

There’s no doubt — modern fraud detection depends heavily on machine learning. AI can detect complex, evolving fraud techniques that rules simply can't catch. And that’s what my module tanaji does.

But here’s what these platforms taught me:

AI predicts. Rules enforce.
AI adapts. Rules protect.
AI learns. Rules ensure compliance.

So I didn’t try to invent something fancy.

I used the established combo:
๐Ÿ”น AI (for learning & scoring)
๐Ÿ”น Rules (for deterministic decisions)


๐Ÿค– Tanaji – The AI Fraud Scoring Engine

I built tanaji using Python and FastAPI. It runs a Random Forest model that accepts transaction data and returns:

  • A fraud score between 0 and 1

  • An explanation (e.g., “High amount”, “Risky country”)

  • List of factors that influenced the score

AI is great for:

  • Learning from past fraud trends

  • Handling edge cases and evolving behavior

  • Detecting subtle correlations (e.g., device + merchant + time pattern)

But it’s not perfect.


⚠️ The Limitations of AI (and Why Big Players Use Rules Too)

  1. AI is probabilistic – It predicts likelihood, not certainty

  2. AI needs training data – Rare fraud types may get missed

  3. AI can’t enforce business policies – Like limits, geofencing, KYC rules

That’s where dadoji enters — our Rule Engine module.


๐Ÿงญ Dadoji – Business Rules That Make the System Accountable

Each rule in dadoji is:

  • Independent

  • Explainable

  • Easy to test and extend

For example:

  • HighAmountRule – Flags transactions above ₹50,000

  • RiskyLocationRule – Flags based on IP or country

  • GiftCardLimitRule – Rejects large gift card purchases

These are not data-driven — they’re policy-driven.

๐Ÿ’ก Even Stripe uses this dual approach — using AI to assess risk, but backing it up with strict rules and thresholds that can override decisions.


๐Ÿ”„ How They Work Together

When a transaction hits sindhudurg (our API gateway):

  1. It first goes to tanaji for fraud scoring

  2. Then passes through dadoji for rule evaluation

  3. The final decision is made using both

Example:

  • Score = 0.93 → Suggests FLAG

  • Rules violated: HighAmount & RiskyMethod → Recommendation: REJECT

This way, business certainty and predictive intelligence work hand-in-hand.


๐Ÿ’ฌ Why This Was the Right Decision

  • ✅ It mirrors what industry leaders are already doing

  • ✅ It gives us flexibility to improve either layer independently

  • ✅ It keeps the system transparent and testable

  • ✅ It simplifies compliance and auditing

I didn’t want to reinvent the wheel.

I just wanted to build it with precision and purpose.


⚔️ Why “Tanaji” and “Dadoji”?

Because Tanaji was the fierce warrior — bold, quick, instinctive.

And Dadoji Konddev was the calm strategist — enforcing rules, discipline, and logic.

Every fraud system needs both.


๐Ÿ› ️ What’s Next

  • A Feedback Loop module (santaji) to learn from false positives

  • Notifications & asynchronous workflows

  • Admin dashboard for monitoring and tuning


๐Ÿ”— GitHub

Code & commits: https://github.com/pcm1984/fraud-free-swarajya


Wednesday, June 25, 2025

Dadoji: The Rule Engine That Brings Wisdom to AI

 

๐Ÿงญ Introduction

In the early days of Swarajya, before Shivaji Maharaj raised a sword or won a fort, there was a man guiding him with discipline, vision, and strategy.

That man was Dadoji Konddev — mentor, administrator, and steward of Shivaji’s early years.

In our Fraud-Free Swarajya system, dadoji is our rule engine — the voice of grounded wisdom that complements the instincts of AI (tanaji).
Because not every decision can be made by machine learning — sometimes, you need good old domain knowledge.


๐Ÿง  Why Do We Need Rules When We Have AI?

AI is great at learning patterns.
But AI can also:

  • Be overconfident

  • Miss edge cases

  • Require lots of data to get it right

That’s where business rules come in — to override, validate, or support AI decisions with deterministic logic like:

✅ "Reject any transaction over ₹2,00,000 unless user is verified"
✅ "Flag if payment method is 'gift card' AND location is flagged"
✅ "Approve only if AI score is < 0.3 AND no high-risk indicators exist"


⚙️ How Dadoji Works

The dadoji component is implemented in Java and is integrated with sindhudurg via method calls for now.

๐Ÿงฉ Architecture

  • Rules are modeled as Java interfaces (FraudRule).

  • Each rule implements:

    java

    boolean evaluate(TransactionRequest request); String getExplanation(); RiskIndicator getRiskIndicator();
  • Multiple rules are evaluated by the RuleExecutor, which returns:

    • ✅ A list of triggered RiskIndicators

    • ✅ Additional explanations if any

    • ✅ Final recommendation (APPROVE, FLAG, or REJECT)


๐Ÿงช Sample Rule: High Amount Rule

java

public class HighAmountRule implements FraudRule { private static final BigDecimal THRESHOLD = new BigDecimal("100000"); public boolean evaluate(TransactionRequest request) { return request.getAmount().compareTo(THRESHOLD) > 0; } public String getExplanation() { return "High amount flagged by rule engine."; } public RiskIndicator getRiskIndicator() { return RiskIndicator.HIGH_AMOUNT; } }

๐Ÿง  AI + Rule Engine = Power Combo

Let’s say:

  • tanaji gives a score of 0.92 and recommends REJECT

  • dadoji runs and says "Wait, it’s high amount, but merchant is whitelisted"

→ The system now has explainable override logic
→ Logs every decision
→ Helps humans audit, trust, and refine the system


๐Ÿ›ก️ Trivia: Who Was Dadoji Konddev?

  • ๐Ÿ“œ He was appointed as administrator of Pune Jagir under Shahaji (Shivaji’s father).

  • ๐Ÿง  Played a formative role in Shivaji’s education, strategy, and administrative foundations.

  • ๐Ÿน Ran the estate with fairness and discipline — no emotion, just principle.

  • ๐Ÿ›️ A rare combination of mentor, manager, and tactician.

In our system, Dadoji is the guardian of fairness, applying laws and boundaries before emotions or instinct kick in.


๐Ÿ” When Rules Beat AI

Real-world examples:

  • AI thinks it’s safe? Business says “No international payments on weekends.”

  • AI misses pattern? Rule says “Block transactions from blacklisted IPs.”

By combining these two, we get:

  • Predictability

  • Customizability

  • Trustworthy explainability


✅ What’s Done

  • Java-based modular Rule System

  • Interfaces to add custom rules easily

  • Enum-driven RiskIndicator system

  • Seamless integration with sindhudurg response


๐Ÿงฑ What’s Next?

๐ŸŽฏ We’ll soon work on santaji — the feedback loop.
It will learn from false positives/negatives and feed back into tanaji.

After that:

  • ๐Ÿ“ฉ Real-time alerts (via push/SMS)

  • ๐Ÿ›ก️ Security hardening

  • ๐Ÿ“Š Admin dashboard for observability


๐Ÿง  Want to Try Adding a Rule?

Clone the repo and add your own:

java

public class VelocityCheckRule implements FraudRule { // Flag too many transactions in short time }

We'll even accept solid rule contributions via PR!


๐Ÿ”— GitHub Repo

๐Ÿ“ฆ https://github.com/pcm1984/fraud-free-swarajya


๐Ÿ’ฌ Closing Thought

Shivaji Maharaj needed Tanaji on the battlefield...
...but he needed Dadoji to prepare him for it.


Tuesday, June 17, 2025

Tanaji: Teaching an AI to Fight Fraud Like a Warrior

 

๐Ÿ”ฅ Introduction

If there's one name in Maratha history that embodies courage under pressure, it’s Tanaji Malusare.

When the Kondhana Fort had to be reclaimed, Tanaji didn’t wait. He scaled the cliffs with a monitor lizard ๐ŸฆŽ, led a night raid, and paid the ultimate price — but won the fort.

In the Fraud-Free Swarajya project, Tanaji is our AI fraud scorer — making fast, high-stakes decisions on every incoming transaction.

Just like the real Tanaji, our AI:

  • Works under uncertainty

  • Evaluates risk on the fly

  • Doesn’t wait for permission to act ๐Ÿš€


๐Ÿง  What Tanaji (the AI) Does

The tanaji module is a Python-based microservice powered by:

FastAPI
scikit-learn for ML
pydantic for validation
uvicorn for async web serving
✅ Logging + formatting with loguru and pythonjsonlogger

It receives a transaction like this:

json

{ "transactionId": "txn001", "userId": "user123", "amount": 5000, "paymentMethod": "risky", "location": "risky" }

Then it returns a fraud score, a risk level, and even an explanation.


๐Ÿงช How It Works Behind the Scenes

  1. Feature Extraction:
    We extract meaningful inputs like:

    • Amount

    • Whether the location or payment method is risky

  2. Model Training:
    We trained a basic RandomForestClassifier on synthetic data to:

    • Classify transactions as fraud or not

    • Assign a confidence score (0 to 1)

  3. Scoring Endpoint:
    Exposed at /score, it predicts and responds in milliseconds.

  4. Logging Everything
    Every request and response is structured, logged, and dockerized.


๐Ÿงฑ Why FastAPI?

Because:

  • It’s async by design

  • Lightning fast (even for ML)

  • Auto-generates Swagger docs

  • Works beautifully inside Docker

  • And let’s be honest: It feels like Spring Boot’s cousin — but cooler with Python ๐Ÿ


๐Ÿ”ฅ Tanaji Trivia Time

Here are some legendary facts about Tanaji Malusare:

  • ๐Ÿ’ฅ He led the assault on Kondhana Fort in 1670 with just a handful of soldiers.

  • ๐ŸฆŽ He used a monitor lizard (ghorpad) to scale the vertical walls of the fort at night.

  • ๐Ÿ’” Though mortally wounded in the battle, his mission succeeded — and Shivaji said:
    "Gad aala, pan Sinh gela." (We got the fort, but lost the lion.)

  • ๐Ÿ—ก️ Kondhana was later renamed Sinhagad in his honor.

Like Tanaji, our AI doesn't hesitate. It detects danger, acts swiftly, and protects the digital kingdom.


⚙️ Sample Response from Tanaji

json

{ "transaction_id": "txn001", "fraud_score": 0.97, "explanation": ["High risk score", "High amount"], "risk_indicators": ["HIGH_AMOUNT"] }

Simple. Actionable. Defensible.


๐Ÿงฐ Dockerizing Tanaji

We packaged Tanaji with a clean Docker setup:

  • uvicorn + FastAPI as entrypoint

  • Exposes port 8000

  • Shared volume for fraud_model.pkl

  • Ready to scale with Docker Compose

dockerfile


CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

๐Ÿง  What Makes This Exciting?

  • You can retrain the model (train_model.py) anytime

  • Logs are structured and Prometheus-ready

  • Pluggable with any orchestrator or microservices platform

  • As the Fraud-Free Swarajya grows, Tanaji will evolve — just like his legacy lives on


๐Ÿงญ What’s Next?

In the next post, we’ll meet dadoji — the rule engine who checks the AI’s decisions using wisdom and business rules.

We’ll also show how AI and logic can work together — just like generals and warriors on a battlefield.

Wednesday, June 11, 2025

๐Ÿ”ฅ From Fire to AI - Story of human evolution or towards extinction?

 

๐Ÿ”ฅ From Fire to AI - Story of human evolution or towards extinction?

Let’s get one thing straight:
I’m not here to bash AI. I’m not the “robots are taking over” guy. I love innovation. I geek out over new tech just like the next curious mind.

But every once in a while, it’s good to pause and ask:
Where are we going with all this?
And more importantly—who's coming with us?


๐Ÿงญ A Quick Journey Through Time

Humans have always survived by adapting:

  • We discovered fire and learned to control it. ๐Ÿ”ฅ

  • We crafted tools, hunted in groups, built shelters, and started living in communities.

  • We invented the barter system to exchange what we had for what we needed.

  • Fast forward to the 2000s, many jobs evolved—but the mission stayed clear:
    Get better at what we do, and serve more people.

Efficiency has always been a tool for progress. But today, something feels different.


๐Ÿค– The New Kind of Efficiency

AI isn’t just helping us anymore—it’s starting to replace us.

From writing emails to diagnosing illnesses, from designing logos to driving cars—AI is doing it all. Not just assisting. Replacing.

And what’s the motivation?

Let’s be honest:
It’s not about improving lives.
It’s about improving profit margins.

Machines don’t ask for raises. They don’t take breaks. And as they scale, they only get cheaper.

But that raises a huge question:

Should we let technology replace humans just because it can?


๐Ÿ›️ Should We Be Regulating This?

Think about money for a second.

We don’t just print unlimited currency because we can. We regulate it—because unregulated power leads to collapse.

So why not apply the same thinking to AI?

Should there be a limit to how AI is used?
Should we ask: What kind of work is okay for machines to do, and what must remain human?

Maybe it's time to create ethical frameworks that draw boundaries—especially for large corporations. Because if profit becomes the only metric, people will always lose.

Should governments step in and enforce restraint? Is that even feasible?

Some might argue it kills innovation. But history shows us that responsible innovation is what builds long-lasting progress.


๐Ÿšถ‍♂️ Just Because We Can… Doesn’t Mean We Should

Let’s bring it down to everyday life:

  • We have electric grinders, but still soak and grind lentils the traditional way—because it’s healthier.

  • We have elevators, but choose stairs to stay fit.

  • We have cars, but walk or cycle to feel more alive.

We’ve always had faster options. But we’ve learned that speed isn’t everything.
Health. Balance. Connection. Purpose. These matter more.

So here’s the question:

Shouldn’t we apply the same principle to our minds?

Just because AI can do our thinking—should it?
Or should we keep stretching our brains, solving problems, thinking critically, and staying human?


๐ŸŒฑ What Are We Optimizing For?

Look, tech will keep evolving. There’s no pause button. But we can choose how we use it.

Are we optimizing for speed? Or for meaning?

Are we building systems to replace humans, or to empower them?

Are we using AI to build better societies—or just richer companies?


๐Ÿ’ก The AI We Actually Need

Here’s a radical thought:
Instead of using AI to automate pizza delivery or turn on lights from our phones...

What if we used AI to solve problems we humans can’t?

Like curing cancer.
Did you know that AI models have already discovered potential antibiotic compounds faster than traditional methods—in hours, not years?

Or helping millions with brain disorders and neurodegenerative diseases?
Imagine AI-guided implants that restore memory or language after a stroke.
AI systems that give voice to the voiceless, mobility to the paralyzed, companionship to the lonely.

  • AI that helps doctors predict diseases before symptoms appear.

  • AI that helps detect earthquakes or climate disasters before they strike.

  • AI that helps us explore deep oceans and distant planets.

  • AI that helps visually impaired people "see" the world through sound.

The possibilities are endless—if we choose the right direction.

Let’s not waste humanity’s most powerful invention yet on shortcuts and gimmicks.
Let’s invest in AI that helps humanity thrive, not just survive the next earnings call.


๐Ÿ‘ฃ A New Kind of Responsibility

We need to treat AI like fire, electricity, or nuclear energy:
Incredibly powerful—and needing thoughtful control.

Let’s support:

  • Human-first design – where AI enhances rather than replaces.

  • Tech ethics education – so future leaders know not just how to build, but why.

  • Policies that prioritize well-being over efficiency.

  • Public conversations that include everyone—not just tech billionaires.

Because the real question isn’t whether AI will replace us.

It’s whether we’ll remember why we built tools in the first place:

Not to divide us.
Not to erase us.
But to help us survive and thrive—together.


๐Ÿš€ Final Thought

AI can be our next fire. ๐Ÿ”ฅ
But only if we learn to control it—not get consumed by it.

We’ve come too far to lose ourselves to our own creations.

Let’s not just build smarter machines.
Let’s build a wiser society.

Tuesday, June 10, 2025

Sindhudurg — Building a Scalable API Fortress for Fraud Detection

 

๐Ÿ›ก️ Sindhudurg — Building a Scalable API Fortress for Fraud Detection

When Chhatrapati Shivaji Maharaj built Sindhudurg Fort, he did it not just with stones — but with vision.
Strategically placed on the coast, Sindhudurg was a gateway, a shield, and a statement: “Swarajya watches every entry.”

So when I began building the Fraud-Free Swarajya project, the API Gateway — the place where every transaction first arrives — had to be named Sindhudurg.


๐Ÿ” The Role of Sindhudurg

This is the entry point of the system. A Spring Boot application that:

✅ Accepts payment transaction requests
✅ Calls the AI module (tanaji) over HTTP
✅ Applies fraud rules (dadoji)
✅ Stores the transaction into PostgreSQL (ramchandrapant)
✅ Caches previous scores via Redis (jiva)
✅ Exposes Prometheus metrics for monitoring (kanhoji)

All while returning a real-time fraud risk score with explanation and recommendation.


๐Ÿ—️ Spring Boot Clean Architecture

We followed a layered approach:

  • Controller Layer — Exposes /api/v1/fraud-score

  • Service Layer — Orchestrates logic (AI + Rules + Cache + DB)

  • Client Layer — Uses WebClient to call tanaji (Python FastAPI)

  • DTO Layer — Separate request and response objects

  • Entity Layer — JPA-backed PostgreSQL persistence


๐ŸŒ Talking to AI with WebClient

Instead of embedding ML in the same codebase, we call tanaji over HTTP:


WebClient webClient = WebClient.builder().build(); Mono<FraudScoreResponse> response = webClient .post() .uri("http://tanaji:8000/score") .bodyValue(request) .retrieve() .bodyToMono(FraudScoreResponse.class);

Decoupling AI from business logic makes the system flexible and testable.


๐Ÿง  Redis Integration (Jiva)

To avoid re-scoring the same transaction, we cache responses in Redis:

String cached = redisTemplate.opsForValue().get(transactionId);
if (cached != null) return parse(cached);

Fast, idempotent, and aligns with real-world payment infrastructure.


๐Ÿ“ˆ Monitoring with Prometheus (Kanhoji)

We expose /actuator/prometheus metrics using Micrometer. This includes:

  • API call latency

  • Cache hits

  • Errors

These metrics are pulled into Grafana to visualize fraud scoring patterns.


๐Ÿณ Docker-Ready Microservice

Sindhudurg runs as a container and connects with others via Docker Compose:

services: sindhudurg: build: ./sindhudurg ports: - "8080:8080" environment: - TANAJI_URL=http://tanaji:8000


✅ Sample Request

curl -X POST http://localhost:8080/api/v1/fraud-score \ -H "Content-Type: application/json" \ -d '{ "transactionId": "txn001", "userId": "user123", "amount": 5000, "currency": "INR", ... }'



๐Ÿ“œ Trivia & Legacy: Why the Name Sindhudurg?

Before we wrap up, here are a few fascinating facts about the real Sindhudurg Fort — which inspired the name of this module:

  • ๐Ÿ️ Built on an island!
    Sindhudurg Fort was constructed by Chhatrapati Shivaji Maharaj in 1664 on the island of Kurte in the Arabian Sea, off the Malvan coast in Maharashtra.

  • ๐Ÿงฑ Over 50,000 kg of lead!
    The foundation stones were secured using molten lead to make the fort impenetrable. Think of it as the 17th-century version of bulletproofing!

  • ๐Ÿ‘ฃ Only fort with Shivaji Maharaj’s handprint and footprint.
    This is the only เค•िเคฒ्เคฒा (fort) where Chhatrapati Shivaji Maharaj’s เคชूเคœाเคธ्เคฅเคณ holds his actual handprint and footprint — making the fort not just strategic, but sacred.

  • ๐ŸŽฏ Built for coastal surveillance.
    Sindhudurg wasn’t just a fort — it was a sentinel guarding against naval invasions, much like our API guards digital transactions.

  • ๐Ÿšช Invisible entrance by design.
    The main gate is camouflaged and not visible from outside — a clever architectural move to confuse enemies, mirroring how our service quietly but smartly filters and flags risky traffic.


⚔️ Just like the original Sindhudurg stood between the kingdom and coastal invaders, this API module is the first barrier against fraud in the digital empire.

 


๐Ÿงญ What’s Next

In the next post, we’ll dive deep into tanaji, the AI engine — including model training, scoring logic, feature extraction and a lot of fun facts about Tanaji Malusare a legend himself.

But for now — our digital fortress is operational.


๐Ÿ› ️ Repo: github.com/pcm1984/fraud-free-swarajya
๐Ÿ“– Intro Blog to start with if you are seeing this for the first time: 
Building Fraud-Free Swarajya: My AI Journey Inspired by Shivaji Maharaj

"A kingdom must defend its gates before expanding its reach."
— Inspired by Sindhudurg.

Monday, June 9, 2025

The Quiet Burnout: Rethinking Productivity in the Age of Performance Metrics


A manager once said to me, “I just wanted to let you know that my best wishes are with you.Don’t worry about work and just get home to be with your family. If you need anything from us, just let me know.” That kind of leadership didn’t just retain employees—it built loyalty that no compensation package could match.

“You were quiet in the standup today. Everything okay?”
“Yeah, all good. Just… tired.”
“Cool. By the way, can we deliver that feature two days early?”

And just like that, we miss another opportunity to see the human behind the screen.

Welcome to modern work culture: where we're connected all the time, and yet, increasingly disconnected.


๐Ÿชž The Rise of Metrics, the Fall of Meaning

We’ve built dazzling dashboards to measure every heartbeat of productivity.
Velocity? Tracked.

Pull requests? Counted.

Commits? Counted.

Standups? Attended.

Emotions? …Untracked. Undiscussed. Unwelcome?

In a world obsessed with measurable outcomes, we’ve lost sight of the immeasurable ones: empathy, trust, resilience, mental health, and human connection.


๐Ÿ’ป Remote Work: The Blessing That’s Becoming a Blindspot

Let’s be clear—remote work is amazing in so many ways. Pajama pants and productivity? Yes please. Commute-free days? Glorious. School pickups without calendar drama? Game-changer.

But here's the catch: we’ve swapped coffee machine chats for “Can everyone go on mute, please?”
We meet in 30-minute blocks, talk, close Zoom, and vanish into task silos.

We’ve stopped asking:
“How are you really doing?”
“What’s going on in your life?”
“Need a break or a venting buddy?”

And the result? We miss the signs of struggle. We miss each other.

Remote work isn't the villain—but our robotic approach to it might be.


๐Ÿงพ The Gig-ification of Everything: When Humans Become Line Items

Another trend quietly reshaping workplaces: the contractor boom.

Companies are hiring contractors and freelancers at scale—less liability, more flexibility, and, let’s be honest, easier exits. Full-time roles are shrinking, and with that, so is the emotional investment from both sides.

I will be honest here. I have taken my fare share of benefits of being a contractor. But the time has changed now and the shear goal now is to get away from the liability of a full time employee and flexibility of firing at anytime without a guilt. 

You can’t really do a birthday surprise for someone when you don’t even know their timezone.

But let’s call it out: this disconnection is dangerous.
When team members are treated as puzzle pieces, you can't expect them to build a masterpiece.


๐Ÿง‘‍๐Ÿค‍๐Ÿง‘ So, What Now? The Case for Human Teams (Even If the Company Doesn’t Care)

If employers are chasing profits and ignoring people, the real responsibility falls on us—on teams, individuals, peers.

Let’s not wait for the “organization” to send out a wellness survey or mandate a mental health day.

Let’s check in with each other.
Let’s say, “Hey, your voice sounded off today. Want to talk?”
Let’s remember birthdays, celebrate wins, offer help on off days, and yes—even send memes.

Because when companies start behaving like machines, it’s up to the humans to save the soul of the team.


๐Ÿข Employers, Are You Listening? You Might Be Digging Your Own Grave

Let’s have a heart-to-heart with the leadership bench now.

Dear Employers,
We get it—margins are tight, investor calls are brutal, and competition is fierce. But this short-term thinking? It’s eating away at the very DNA of our culture.

  • Burnt-out employees = low innovation

  • Disconnected teams = high churn

  • KPI obsession = creativity collapse

Big companies aren’t immortal. Ask Kodak. Ask Nokia. Culture collapse is real. You may not notice it immediately, but the slow bleed has already begun when no one wants to build, only ship.

Apathy doesn’t scale. Empathy does.


✅ What Can We Do?

๐Ÿ”ง For Employers:

  1. Balance the dashboard with dialogue. Ask your people how they’re doing, not just what they’re doing.

  2. Don’t outsource your culture. Contractors or FTEs—everyone deserves to feel seen.

  3. Stop ranking people like search engine results. 98% isn’t “underperforming.” It might be your most loyal, emotionally mature teammate.

  4. Train leaders to be more human. Coaching is good. Listening is better.

  5. Create rituals that connect. Virtual coffee rooms, Friday wins, or just a “no-meeting day” can go a long way.

๐Ÿง˜ For Employees:

  1. Check in on each other. Create your own culture within the team.

  2. Share, but don’t overshare. Be honest about life—but also respect boundaries.

  3. Say no when needed. Protect your health like you protect your deadlines.

  4. Journal your wins. Especially the invisible ones.

  5. Find joy in the small stuff. The emoji in a PR comment, the GIF war in Slack, the 2 AM idea that made someone’s day.


๐ŸŒˆ Let’s Make Work… Work Again

Work doesn’t have to be this heavy. It can be meaningful, warm, funny, frustrating, but still human.

Let’s not wait for HR to draft a new policy. Let’s start by asking one simple question today:

“How are you really doing?”

You’d be surprised how powerful that can be.

Tuesday, June 3, 2025

Building Fraud-Free Swarajya: My AI Journey Inspired by Shivaji Maharaj

 

✨ Introduction

“A well-defended kingdom needs strong walls. A digital kingdom needs smarter walls.”

This project was born out of : my love (Let's be honest here - the need of the hour for learning and mastering cutting-edge backend and AI systems, and my deep admiration for Chhatrapati Shivaji Maharaj — a visionary leader, strategist, and a true creator of Swarajya (self-rule).

I’ve rarely come across any software or technology project dedicated to the legacy of Shri Chhatrapati Shivaji Maharaj — the visionary who redefined leadership, strategy, and self-rule.

So I asked myself: Why not me? Why not now?

This project is my humble tribute to the man because of whom we stand tall today — fearless, forward-looking, and free.

"เคฎเคฐाเค ी เคชाเคŠเคฒ เคชเคกเคคे เคชुเคขे..."

And with every line of code, I hope to carry that spirit forward.

In today's world of real-time payments and online commerce, fraud is the enemy lurking at every border. Enemy is smarter than ever before and is ever evolving. Just like Shivaji Maharaj fortified his kingdom with warriors, forts, and intelligent networks, I set out to build a fraud detection system that is scalable, intelligent, and self-improving — but more importantly, one that pays homage to the values of courage, intelligence, and sovereignty.

Welcome to Fraud-Free Swarajya — a modular, open-source fraud detection platform that blends Java microservices, Python-based AI, and modern observability, all wrapped in a metaphor-driven architecture.


⚔️ Why the Name — and the Warriors Behind It




| sindhudurg | Named after the mighty coastal fort Sindhudurg, which protected the kingdom from maritime threats. Just like the fort, this module is the first line of defense — a secure API gateway that screens all transactions entering the system. |


| tanaji | Named after Tanaji Malusare, the fearless commander who reclaimed Kondhana Fort with unmatched courage. Our AI engine carries his name, making split-second decisions under risk, just like Tanaji did under the moonlight. |


| dadoji | Inspired by Dadoji Konddeo, the mentor of young Shivaji. As our rule engine, Dadoji represents wisdom, discipline, and foundational logic — laying down rules that guide decisions even before AI kicks in. |


| ramchandrapant | Named after Ramchandra Pant Amatya, the brilliant finance minister who ran the administration even after Shivaji's time. Our PostgreSQL-backed module stores every transaction — a ledger of the kingdom’s economic pulse. |


| jiva | Named after Jivaji Mahala (Jiva Mahala), who saved Shivaji Maharaj during the infamous encounter with Afzal Khan. Redis caching earns his name — fast, alert, and always ready to guard against repeated attacks. |


| kanhoji | Inspired by Kanhoji Angre, the naval mastermind who controlled the western coast with strategy and surveillance. Like him, our Grafana + Prometheus setup gives us real-time visibility over our digital waters. |


| santaji (planned) | Named after Santaji Ghorpade, the guerrilla warfare expert known for unpredictable, adaptive strikes. The feedback loop module will live up to his name by learning from fraud attempts and evolving continuously. |


| ashtapradhan (planned) | Named after the Ashta Pradhan Mandal — the council of ministers advising the king. This will be our Admin Dashboard, giving stakeholders central control and decision-making authority. |


๐Ÿš€ What’s Built So Far

  1. Spring Boot API (sindhudurg) that accepts a transaction JSON and delegates risk scoring.

  2. AI Scoring Engine (tanaji) built using Python’s FastAPI and RandomForestClassifier.

  3. PostgreSQL Storage (ramchandrapant) that stores every scored transaction for future learning.

  4. Redis Caching (jiva) to avoid redundant AI calls.

  5. Prometheus + Grafana Monitoring (kanhoji) for real-time operational insight.

  6. ✅ All of this runs via Docker Compose for seamless orchestration.

All code is modular, testable, and built using open-source tools.


๐Ÿง  Why Fraud Detection?

Fraud is the modern-day Aurangzeb — relentless, deceptive, and constantly attacking from all sides.

Just as Shivaji Maharaj may not have defeated Aurangzeb in a single battle, it was his strategic brilliance, adaptability, and psychological mastery that laid the foundation for resistance. It was his foresight that empowered Chhatrapati Sambhaji Maharaj to continue the fight and ultimately break Aurangzeb’s spirit, forcing him into a slow retreat — not with brute force, but with endurance and tactical superiority.

In the same way, we may not "eliminate" digital fraud completely. But with the right architecture, AI, and resilience, we can frustrate it, outmaneuver it, and protect our digital Swarajya.


๐Ÿงญ What’s Coming Next

  • ๐Ÿ” More static rules using dadoji (Risky country, IP anomalies, high velocity)

  • ๐Ÿง  Adaptive learning via feedback (santaji)

  • ✉️ Optional notification/alert module

  • ๐Ÿ“Š Custom dashboard (ashtapradhan)

  • ✅ Security hardening and secret management


๐Ÿ“ฃ Why I’m Sharing This Publicly

This is more than a project — it’s a living portfolio, a tribute, and a platform for learning in public. I’ll be sharing:

  • Tech deep-dives

  • Design decisions

  • Coding challenges

  • Architecture blueprints

  • Blog + LinkedIn series

If this interests or inspires you — I invite you to follow along, contribute, and be part of this Swarajya of Code.


๐Ÿ”— GitHub

๐Ÿ› ️ Codebase: https://github.com/pcm1984/fraud-free-swarajya

๐Ÿ“– Documentation and blogs are inside the repo as well (modular + searchable).


๐Ÿ™ Closing Thought

“Shivaji Maharaj didn’t just build a kingdom. He built a system that outlived him.”

I hope I get the courage and energy and continue to get inspiration from him — to create a system that’s resilient, educational, and impactful.

Jai Bhavani. Jai Shivaji.

Monday, March 24, 2025

Handwriting ...are we losing it?

 For the past two months, I’ve been consciously practicing taking notes by hand. It’s not like I never did it before, but let’s just say my relationship with handwriting has been an on-again, off-again kind of thing. This time, though, I’ve really started to appreciate it—not just as a tool, but as something deeply human. And the more I think about it, the more I feel that writing by hand is a lost practice that deserves a serious comeback.

The Magic of Writing—Where It All Began

Imagine a world where thoughts vanished as quickly as they appeared—no wisdom passed down, no "Dadi ke Nuskhe," no lessons from the past. We’d be stuck reinventing the wheel over and over, unaware that someone had already done it before.

But then, someone discovered how to carve into rocks—perhaps through trial and error, a process lost to time. Eventually, they started drawing pictures, capturing moments beyond memory. And then came writing.

Writing changed everything. It freed us from relying on oral tradition alone. No longer did we need an elder to recall the details of a great hunt —now, it could all be recorded, preserved, and passed down. It made laws enforceable, stories timeless, and knowledge immortal. It connected people across generations and geographies, shaping the course of history itself.

And then, computers arrived—revolutionizing history once again, but slowly taking writing away. More on that later... ๐Ÿ˜Š

The Brain’s Love Affair with Handwriting

But beyond history, writing by hand does something truly fascinating: it makes our brains work harder—and better. There’s actual research backing this up. Writing by hand engages different neural pathways than typing does. It forces us to slow down, process information differently, and actually think about what we’re putting on paper. Studies have shown that students who take handwritten notes retain information better than those who type them. I guess that explains why I can vividly remember the weird doodles I used to make next to my notes in school, but not a single bullet point from a digital document I typed last week.

I’ve also noticed that handwriting helps me clarify my own thoughts. When I write something down, it feels more real—like my brain is shaping the thought as I move my pen across the page. It’s a much more deliberate process compared to typing, where it’s easy to keep hitting backspace until the words magically arrange themselves into something semi-coherent.

Last but not the least, it feels great after you have taken 2 pages of your own notes after reading 10 pages or going through a long 1 hour video online. I use colors to further personalize my notes. 

Calligraphy: The Art That We Forgot We Loved

There was a time when writing wasn’t just functional—it was an art form. Calligraphy, whether in ancient Chinese scripts, Arabic calligraphic flourishes, or medieval illuminated manuscripts, was an expression of beauty. Even a simple handwritten letter used to carry a certain personality, a unique fingerprint of the writer. Today, that art is disappearing. I mean, let’s be honest—when was the last time you looked at someone’s handwriting and thought, “Wow, that’s beautiful”?

Handwriting used to be a statement. Now, we’ve reduced it to something that barely gets used unless we’re scribbling a grocery list (and even that is often typed into a phone). We even sign digitally now. But there’s something deeply satisfying about writing neatly and beautifully, even if it’s just for myself. 

Then Came Computers—And We Stopped Writing

Of course, technology changed everything. The typewriter, the computer, the smartphone—all of these made writing faster, more efficient, and more convenient. And hey, I love technology. I can’t imagine drafting this entire piece without some typing, google search and (shoo.... copy paste). But somewhere along the way, we lost our connection with the act of writing itself.

I see kids today (yeah, I sound old, I know) who barely use pens and notebooks. They take notes on tablets, type essays on laptops, and sign documents with digital signatures. And while I get the convenience, I can’t help but wonder—are they missing out on something?

Does Good Handwriting Even Matter Anymore?

What does it mean to have good handwriting in a world where we barely use it? Will it become like Latin—respected, but mostly obsolete? Maybe. But I’d like to think there’s still a place for it. There’s a kind of joy in writing a heartfelt letter, jotting down ideas in a notebook, or even just doodling in the margins. Handwriting gives thoughts a tangible form, something that typing on a screen just doesn’t replicate.

There’s also something deeply personal about handwritten notes. A handwritten journal feels like a real extension of the person writing it. I can always tell when I’m reading my old notes because my handwriting reflects my mood, my energy, even the kind of pen I used that day. You don’t get that with a font.

How Do We Convince Gen-Z to Pick Up a Pen?

This is tricky. I can’t exactly go up to a teenager and say, “Hey kid, you should write by hand more often—it’ll build character.” (I mean, I could, but I’d probably get an eye-roll.) The only real way to convince anyone is to make them experience it.

Maybe the key is to start small. Challenge yourself to write a to-do list instead of typing it. Keep a handwritten journal for a week. Try calligraphy for fun. Just feel what it’s like to let your thoughts flow through a pen instead of a keyboard. If it resonates, you’ll want to do it more. If it doesn’t, well, at least you tried.

Where Do I Go from Here?

For me, handwriting isn’t something I plan to let go of anytime soon. I’ll keep my digital notes for efficiency, but my thoughts, my reflections, and the things that truly matter—I’ll keep writing those down by hand. Because at the end of the day, there’s something deeply human about putting pen to paper. And I don’t want to lose that.

Monday, February 17, 2025

Shorts, Reels & Regret: The Art of Wasting Time - Mastered

I am sure I am not the first or even in the first 10000000 to notice that the short form content we are consuming now a days is decaying our abilities to do almost all things we as humans are supposed to be good at. Yet, we tend to ignore this and keep scrolling. Hence today's blog...

It starts innocently enough—you open your phone to check a quick notification, and before you know it, you’re 37 minutes deep into a black hole of clips that seem to provide valuable information but do they? Have you ever felt that the short you are watching right now is giving you a list of life changing steps yet you cant seem to remember and apply any of it.  We’ve all been there. Social media’s short-form video content—be it Instagram Reels, YouTube Shorts, or TikTok—has redefined how we consume information and entertainment. But is it really consumption when we don't even remember what we just watched?

The Omnipresent Scroll

Gone are the days when people just waited in queues, stared at walls in washrooms and red the funny one liners that made us all laugh, or absentmindedly stirred their cooking. Now, every moment of silence is an opportunity to scroll. Remember the graffiti in the washroom doors? Now even the backbencher do not have time for that.

Let’s break down some common scrolling scenarios:

  • Queues/malls and even Signals: Why people watch when you can watch people's personal life?
  • Washrooms: Nature’s original thinking spot is now a social media binge zone. (Let's not discuss phone hygiene.)
  • Office hours: That "quick break" turns into a deep dive into conspiracy theories about why pigeons are government spies.
  • Cooking: Because why should you focus on not burning your food when you can watch someone else make a 5-minute gourmet meal you'll never try?

What’s Happening to Our Brains?

Short-form videos are like digital junk food—addictive, instantly gratifying, and nutritionally empty. Each quick hit of entertainment triggers dopamine, the brain’s reward chemical, keeping us craving more. But just like junk food leaves us feeling sluggish, endless scrolling leaves us mentally exhausted and oddly unfulfilled.

  • Reduced Attention Span: We now expect everything to be under 60 seconds. If a video dares to be two minutes long, we sigh dramatically. How many of you watch a video on its normal speed?
  • Impaired Deep Thinking: Instead of letting our minds wander creatively, we fill every gap with more content.
  • Instant Gratification Loop: We get used to quick dopamine bursts, making real-life patience (like reading a book or learning a skill) feel painfully slow.
  • Polarized Views: Unlike books that we carefully choose, YouTube and social media algorithms decide what to feed us. This often creates echo chambers where we are served increasingly extreme or one-sided perspectives, reinforcing our existing beliefs rather than challenging them.

The Great Alternative: Ebooks & Mindful Learning

If the problem is mindless consumption, the solution is mindful learning. Instead of scrolling,  we need to try reading an ebook. It has all the benefits of traditional books (minus the need for extra shelf space) and actually engages your brain in a way that scrolling never can.

Videos vs. Books: The Learning Battle

Short videos are great for entertainment and quick tutorials (e.g., "how to chop onions without crying"), but for deep learning, books still reign supreme. I even feel that if you choose a particular video and watch it with the purpose of learning, that still is better as you are focused and mindful rather than endlessly consuming what the algorithm serves you. 

If we can learn to enjoy reading ebooks in our break time, that would really save us.

The Art of Doing Nothing (Yes, Really)

Sometimes, the best thing to do isn’t replacing scrolling with another activity—it’s embracing the boredom.

  • Observe the world: Look at people’s expressions, eavesdrop (discreetly) on conversations, or just be present.
  • Let your mind wander: Some of the best ideas are born when the brain isn’t overstimulated.
  • Enjoy real interactions: Maybe strike up a conversation instead of pretending to be deeply engaged in your phone.
  • The Forgotten Social Skill: In a world of digital disconnect, if two people stop scrolling at the same time, they might just talk to each other out of sheer boredom. Imagine that!

The Screen-Time Dilemma: Eyes & Health

Endless screen consumption isn’t just frying our brains—it’s also affecting our eyes. Staring at screens all day can lead to digital eye strain, headaches, and disrupted sleep cycles. While ebooks offer a more mindful alternative to scrolling, even they can cause strain if read on regular screens. E-readers, however, use e-ink technology, which is much easier on the eyes.

The Impact on Children

Children, the most impressionable of all, are growing up in a world where entertainment is instant and attention spans are shrinking. Overexposure to short-form videos can limit their ability to focus, reduce patience, and create unrealistic expectations for constant stimulation. Encouraging them to read books, play outside, and engage in offline activities is more important than ever.

Conclusion: Take Back Your Time

Social media scrolling isn’t evil, but when it starts hijacking every free moment, it’s time to rethink its place in our lives. Instead of feeding the endless dopamine loop, we can choose activities that truly enrich our minds—reading, observing, learning, or simply doing nothing.

Instead of scrolling, watch a movie ( Still better than the aimless content. Movies tend to have a goal to end.) or go in the balcony and watch the snow. What do you think?

So, the next time I find myself reaching for my phone while waiting in line, I am going to say: maybe, just maybe, it's okay to simply exist without scrolling. But if I do choose to scroll, at least I will make sure it’s something worthwhile—like reading this blog post ;)

Tuesday, January 14, 2025

From Human Touch to Machine Algorithm: The Price of Progress

 In an age where progress is measured by economic growth, technological advancements and possessions, there is a silent transformation happening. Humans are increasingly becoming mechanical in their thought processes, treating every interaction and decision as a business transaction. This shift is visible in many facets of modern life, from corporate practices to individual choices. While we often talk about the risks of artificial intelligence replacing humans, a more pressing issue lies in how humans themselves are becoming machines.

1. Profitable Layoffs: The Business of Efficiency

In recent years, companies have redefined "efficiency" to mean "doing more with fewer people." Layoffs are no longer a last resort for struggling businesses but a calculated strategy to maximize profits. Even companies with soaring revenues and record-breaking profits are cutting jobs, citing "streamlining operations." This isn’t about survival; it’s about greed disguised as growth.

What message does this send to society? That people are dispensable, reduced to numbers on a balance sheet. The human cost of these layoffs—mental health issues, family instability, loss of dignity—is rarely considered. When profit margins dictate decisions, humanity takes a backseat.

2. The Salary Chase: Employees as Free Agents

On the other side of the coin, employees are equally complicit in perpetuating a transactional culture. Job loyalty has dwindled as professionals hop from one company to another in search of higher salaries. The days of building a career with one organization are fading fast.

But can we blame them? When companies treat employees as expendable assets, it’s natural for individuals to prioritize their financial security. However, this constant churn creates a culture where relationships, mentorship, and long-term impact are sacrificed at the altar of immediate gains.

3. The Death of Local Markets: A Race to the Bottom

The convenience of online shopping has revolutionized consumer behavior. Yet, beneath the allure of lower prices lies a harsh reality. Local retailers, who once formed the backbone of communities, are being edged out by global giants. These giants often offer cheaper products at the expense of ethical practices, environmental sustainability, and local economies.

Every time we click "Add to Cart," we contribute to a system that prioritizes cost over conscience. Do we really want globalization to mean that an International corporation monopolizes a developing market, erasing centuries-old local businesses in its wake? If this trend continues, what will be left of our neighborhoods, our culture, our individuality?

4. The Self-Checkout Dilemma: Convenience at a Cost

Self-checkouts at grocery stores and mobile order pickups at coffee shops are celebrated as marvels of efficiency. They save us time and reduce costs for businesses. But what happens to the cashier who loses their job? What about the barista who no longer interacts with regular customers?

These technologies, while convenient, strip away the human connections that make everyday interactions meaningful. They also reinforce a culture where speed and cost-cutting take precedence over community and empathy.

5. Profit Over People: The New Normal

Whether it’s corporate decisions, personal choices, or social interactions, everything seems to revolve around profit. Friendships are built on networking potential. Hobbies are monetized. Even acts of kindness are weighed against what one stands to gain in return.

This relentless focus on profit isn’t just dehumanizing; it’s unsustainable. A society that values profit over people loses its soul, becoming a cold, calculated machine where compassion and ethics are anomalies rather than norms.

6. The Bigger Problem: Humans Becoming Machines

While the world debates the implications of AI, we’re overlooking a bigger issue: humans turning into machines. We’ve become so obsessed with optimization, efficiency, and profitability that we’ve lost touch with what makes us human—empathy, creativity, and the ability to connect deeply with one another.

When we reduce life to a series of transactions, we strip it of meaning. What’s worse, we’re passing these values down to our children. We’re teaching them that success is about saving money, maximizing returns, and cutting corners—ethics and morals be damned. Is this the legacy we want to leave behind?

Final Thoughts

I’ll admit, I often struggle with these same choices. Sometimes, I choose the cheaper online option. Sometimes, I rely on self-checkouts. But these moments leave me wondering—what are we losing in the process?

It’s not about pointing fingers or finding quick fixes. It’s about reflecting on the kind of world we’re creating. Can we balance progress with humanity? Can we teach the next generation that life is more than just a series of profit-driven decisions?

I don’t have all the answers. But perhaps, by asking the right questions, we can start a conversation worth having.