DEV Community

Seyed Alireza Alhosseini
Seyed Alireza Alhosseini

Posted on

Serendipity Maps: An Open Protocol for Engineering Human Coincidence

What if the next great friendship, collaboration, or idea didn't come from a recommendation algorithm?

What if it came from a place, a moment, and two people whose paths were already converging?

That is the question behind Serendipity Maps.

๐Ÿ”— GitHub: https://github.com/modarresi1913/serendipity-maps


We Have Optimized Discovery. We Haven't Optimized Coincidence.

Most social platforms are built around the same primitive:

Search โ†’ Profile โ†’ Match โ†’ Message

The assumption is that meaningful human connection should happen digitally first.

Serendipity Maps explores the opposite direction:

Pattern โ†’ Proximity โ†’ Encounter โ†’ Reveal

Instead of asking:

"Who should I meet?"

the system asks:

"Where are the people whose paths naturally intersect with mine?"

This is not another social network.

It is an experiment in spatial computing for human connection.


The Core Idea

Every person has a hidden spatial rhythm.

You may visit the same cafรฉ every Tuesday.

Someone else may work from the same neighborhood every morning.

Another person may regularly visit the same bookstore.

Individually, these patterns look meaningless.

Together, they create something interesting:

overlap.

Serendipity Maps attempts to discover these overlaps without turning someone's location history into a public social graph.

The goal is not to expose where people are.

The goal is to detect when paths naturally converge.


The Serendipity Engine

The conceptual architecture looks like this:

             USER BEHAVIOR
                   โ”‚
                   โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚ Behavioral          โ”‚
        โ”‚ Fingerprint         โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
                  โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚ Spatial + Temporal โ”‚
        โ”‚ Overlap Engine     โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
                  โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚ Ambient Signal     โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
                  โ–ผ
             REAL WORLD
              ENCOUNTER
                  โ”‚
                  โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚ Serendipity Card   โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Enter fullscreen mode Exit fullscreen mode

The important design decision is that the system does not need to immediately reveal identity.

The system can first detect the possibility of coincidence.

Identity can come later โ€” and only when appropriate.


1. Behavioral Fingerprinting

The first layer attempts to represent a user's recurring behavior as an abstract fingerprint.

Not:

User A was at:
51.1234, 13.5678
08:42
Enter fullscreen mode Exit fullscreen mode

but something closer to:

Pattern:
weekday_morning
coffee_shop
high_recurrence
creative_area
Enter fullscreen mode Exit fullscreen mode

The important distinction is between:

raw location data

and

behavioral patterns derived from it.

A production implementation should minimize the amount of raw location information that ever leaves the user's device.


2. The Overlap Engine

The next question is:

Do two behavioral patterns have a meaningful probability of intersecting?

This requires more than geographic distance.

The engine can consider:

  • spatial proximity
  • temporal proximity
  • recurrence
  • duration
  • location type
  • behavioral similarity
  • confidence
  • privacy constraints

Conceptually:

Overlap Score =
    Spatial Similarity
  ร— Temporal Similarity
  ร— Recurrence
  ร— Context Compatibility
  ร— Privacy Constraints
Enter fullscreen mode Exit fullscreen mode

This is not intended to become a creepy "people near you" ranking system.

The objective is fundamentally different:

detect meaningful convergence without unnecessary surveillance.


3. Ambient Signals

Once a meaningful overlap exists, Serendipity Maps does not necessarily send:

"John is 20 meters away."

That would destroy the entire concept.

Instead, the system can provide an ambient signal.

For example:

"There may be an interesting coincidence nearby."

The user can continue doing what they were already doing.

No forced interaction.

No swipe.

No notification demanding attention.

The technology creates the possibility.

Humans decide what happens next.


4. The Encounter

This is where the project becomes fundamentally different from conventional recommendation systems.

The algorithm is not the final product.

The real world is.

The system attempts to create the conditions for an encounter.

Two people may discover that they:

  • visit the same places
  • share similar routines
  • work in related areas
  • attend the same events
  • repeatedly cross the same physical paths

The algorithm disappears into the background.

The human experience becomes the interface.


5. The Serendipity Card

After an appropriate interaction or confirmed encounter, the system can reveal the hidden pattern.

For example:

SERENDIPITY DISCOVERED

You crossed paths 4 times.

โ˜• Cafรฉ โ€” Tuesday
๐Ÿ“š Bookstore โ€” Saturday
๐ŸŒณ Park โ€” Thursday

Shared interests:
AI ยท Design ยท Open Source

You were already moving through
similar parts of the city.
Enter fullscreen mode Exit fullscreen mode

The important UX principle is:

Reveal the pattern, not the surveillance.


Privacy Is Not a Feature

Privacy is part of the architecture.

A system based on location and behavioral patterns can become dangerous if designed incorrectly.

Serendipity Maps therefore explores mechanisms such as:

On-device processing

Whenever possible, sensitive behavioral processing should happen locally.

Differential privacy

Aggregate or noisy signals can reduce the ability to reconstruct individual trajectories.

Ghost Mode

Users should be able to disappear from the system.

Invisible Zones

Users should be able to define places that should never participate in matching.

Selective Visibility

Different contexts may require different levels of participation.

The goal is simple:

The system should know less about you than it needs to create the experience.

Not more.


The Repository Is a Contract

The GitHub repository is not just a collection of source files.

It is intended to become the engineering contract for the project.

The repository defines the conceptual boundaries between:

User Signals
     โ†“
Privacy Layer
     โ†“
Behavioral Representation
     โ†“
Overlap Engine
     โ†“
Ambient Interaction
     โ†“
Encounter
     โ†“
Reveal
Enter fullscreen mode Exit fullscreen mode

Each layer should eventually have a clear interface.

That matters because Serendipity Maps is intentionally designed as an open experiment.

Developers should be able to replace components without rewriting the entire system.

For example:

Fingerprint Provider
        โ”‚
        โ”œโ”€โ”€ Mobile ML
        โ”œโ”€โ”€ Local LLM
        โ””โ”€โ”€ Custom Model
                โ”‚
                โ–ผ
         Overlap Engine
                โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚                โ”‚
   Rule-based        ML-based
        โ”‚                โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                โ–ผ
        Privacy Layer
Enter fullscreen mode Exit fullscreen mode

The architecture should allow experimentation rather than locking the project into one implementation.


What Makes This Technically Interesting?

Serendipity Maps sits at the intersection of several difficult problems:

Spatial AI

Understanding patterns in physical movement.

Temporal modeling

Understanding recurring human routines.

Privacy-preserving computation

Finding overlap without creating a surveillance database.

Edge AI

Moving sensitive inference closer to the user.

Human-computer interaction

Designing interactions that do not feel like notifications or recommendation feeds.

Graph discovery

Representing relationships between people, places, times, and repeated encounters.

Probabilistic inference

Because an overlap is never a guarantee.

It is a probability.

And that uncertainty is actually part of the product.


From Social Graph to Serendipity Graph

Traditional social networks primarily model:

Person โ†’ Person
Enter fullscreen mode Exit fullscreen mode

Serendipity Maps explores a richer graph:

             PERSON
                โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ–ผ       โ–ผ        โ–ผ
      PLACE    TIME    INTEREST
        โ”‚       โ”‚        โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                โ–ผ
             PATTERN
                โ”‚
                โ–ผ
             OVERLAP
                โ”‚
                โ–ผ
             ENCOUNTER
Enter fullscreen mode Exit fullscreen mode

This creates a fundamentally different data model.

The most interesting relationship may not be:

"Alice knows Bob."

It may be:

"Alice and Bob repeatedly occupied the same behavioral space before they ever knew each other."

That is the graph we want to explore.


The Near-Miss Graph

One of the most interesting extensions is the concept of near misses.

Imagine the system discovers:

You almost met 7 times.

Cafรฉ       ร— 3
Bookstore  ร— 1
Park       ร— 2
Conference ร— 1
Enter fullscreen mode Exit fullscreen mode

Suddenly, the system is not simply recommending people.

It is revealing hidden structure in your life.

This could become one of the most unique interfaces in the product:

Your life contains encounters you never noticed.


Why Start With a Small Community?

A global launch would be the wrong first experiment.

Serendipity requires density.

A better approach is a closed Serendipity Zone:

  • university
  • coworking space
  • conference
  • festival
  • creative community
  • neighborhood

The smaller environment creates enough repeated interaction for the system to demonstrate its value.

The first question is not:

"Can this work for 100 million people?"

It is:

"Can we create one genuinely magical encounter?"

If the answer is yes, scale becomes interesting.


Current State

The repository currently represents a strong product prototype and architectural exploration.

The next engineering layers include:

  • production overlap computation
  • on-device behavioral modeling
  • privacy-preserving matching
  • real-time spatial events
  • native mobile clients
  • encounter verification
  • scalable backend infrastructure
  • evaluation datasets
  • privacy/security auditing

The important point is that these components should be developed as replaceable modules, not as one monolithic system.


What I Want Developers to Build

Serendipity Maps is intentionally open to contributions.

Some of the most interesting problems are still unsolved:

๐Ÿง  Behavioral Modeling

How can recurring human behavior be represented without storing unnecessary raw location data?

๐Ÿ“ Spatial Algorithms

What actually constitutes a meaningful spatial overlap?

โฑ Temporal Patterns

How do we distinguish a coincidence from a routine?

๐Ÿ” Privacy

Can useful serendipity be generated while dramatically reducing the information available to the server?

๐Ÿค– Edge AI

Can modern models learn behavioral fingerprints directly on consumer devices?

๐Ÿ•ธ Graph Algorithms

Can we discover hidden communities and repeated near-misses?

๐ŸŽจ Interaction Design

How do we notify someone about a possible coincidence without turning coincidence into another notification feed?


The Bigger Question

The deeper idea behind this repository is not about maps.

It is about the relationship between algorithms and human unpredictability.

Modern technology has become exceptionally good at prediction.

It predicts:

  • what we will watch
  • what we will buy
  • who we may know
  • what we may click
  • where we may go

But perhaps there is another role for AI.

Instead of constantly predicting the next thing we will do, AI could sometimes create the conditions for something we could not have predicted.

That is the philosophy behind Serendipity Maps.


Don't Optimize Away the Unknown

Recommendation engines try to eliminate uncertainty.

Serendipity requires uncertainty.

A perfect recommendation says:

"Here is exactly what you should do."

A serendipitous system says:

"Something interesting might happen here."

And then gets out of the way.


The Experiment

Serendipity Maps is ultimately an open-source experiment around one question:

Can artificial intelligence help humans discover each other without turning human connection into another optimization problem?

If you are interested in:

AI ร— Spatial Computing ร— Privacy ร— Human Connection ร— Open Source

come build the experiment with us.

The repository is the starting point:

๐Ÿ”— https://github.com/modarresi1913/serendipity-maps

The goal isn't to build another platform that tells people who to meet.

The goal is to build technology that makes coincidence possible.


Serendipity Maps

Don't match people.
Match their paths.

created by Seyed Alireza Alhosseini Almodarresieh

And maybe the most interesting person you meet tomorrow is already somewhere along yours.

Top comments (0)