I've reached another milestone in EdgeFit, my open-source, privacy-first fitness companion built with React Native, TypeScript, HealthKit, and SQLite.

The latest feature is Adaptive Activity Goals.

This feature builds on two earlier milestones:

  1. A 30-Day Activity Calendar to visualize historical activity.
  2. Personal Activity Insights to explain trends and consistency.

Now EdgeFit can use that history to suggest personalized daily step goals.

Why adaptive goals?

Many fitness applications use a fixed daily step target.

But a single target doesn't reflect everyone's activity patterns, routines, or starting point.

I wanted to explore a different approach: suggest goals based on the user's own recent activity rather than assuming everyone should aim for the same number.

The challenge isn't simply calculating an average. It's deciding when a recommendation is supported by enough data, how quickly a goal should change, and how to keep users in control.

The approach: Explainable rules first

For this phase, I chose deterministic recommendations instead of introducing machine learning.

The design focuses on several principles.

1. Use recent activity history

Recent step data provides a starting point for a personalized recommendation.

A goal can be informed by a person's recorded activity rather than an arbitrary universal target.

2. Account for missing data

Missing HealthKit data should not automatically be treated as zero steps.

Otherwise, incomplete history could produce an artificially low recommendation.

Data coverage matters as much as the calculation itself.

3. Avoid sudden changes

A single unusually active day shouldn't necessarily result in a substantially higher daily goal.

Recommendations should reflect meaningful activity patterns rather than isolated spikes.

4. Explain the recommendation

Users should be able to understand why a goal was suggested.

This is one reason deterministic rules are valuable: the inputs and decision logic can be inspected and tested.

5. Preserve user control

A recommendation should remain a recommendation.

Users need the ability to decide which goals work for them instead of being forced to follow an algorithm.

Keeping the architecture privacy-first

EdgeFit uses HealthKit for activity data and SQLite for local persistence.

Adaptive Activity Goals extends this local-first approach, rather than introducing a cloud-based recommendation service.

The aim is to make personal health data useful without making remote processing a prerequisite.

Why not use machine learning yet?

I'm interested in on-device AI, but I don't want to add ML simply to label a feature intelligent.

First, I want a reliable rule-based baseline.

Then I can experiment with a lightweight on-device model and evaluate:

  • Does it produce more useful recommendations?
  • Is the improvement measurable?
  • How much latency does inference introduce?
  • What is the memory and energy cost?
  • Can the recommendation still be explained?

If a deterministic algorithm works just as well, that's a useful engineering finding too.

What's next?

My next goal is to investigate on-device machine learning for activity pwersonalization.

EdgeFit is open source, and feedback is welcome.

GitHub: https://github.com/raviseta/edgefit

If you're building health, fitness, or privacy-first mobile applications, I'd love to hear how you approach adaptive recommendations and incomplete sensor data.

reactnative #ios #healthtech #privacy