DEV Community

Adithya Krishnan
Adithya Krishnan

Posted on

I Stopped Putting AI Inside My App — I Made AI a Client of My API

I wanted to build a personal dashboard that could understand my data.

Expenses. Movies. Books. Investments.

The obvious approach would have been to build an AI layer directly into the application.

I decided to do the opposite.

What if AI wasn't part of the application at all?

What if it was simply another client consuming the same API as the web application?

That idea became Continuum.

The architecture

Instead of:

Web App
   ↓
AI Layer
   ↓
Database
Enter fullscreen mode Exit fullscreen mode

I built:

                 ┌─────────────┐
                 │   Web App   │
                 └──────┬──────┘
                        │
                        ▼
ChatGPT ──────► ┌─────────────┐
Gemini ────────►│ Continuum   │
Other Clients ─►│     API     │
                └──────┬──────┘
                       │
                       ▼
                   Database
Enter fullscreen mode Exit fullscreen mode

The API owns the actual application logic.

The AI doesn't.

That means ChatGPT can create an expense, update a watchlist, or retrieve data, but it doesn't get special access to my application's internals.

It's just another authenticated client.

What does that actually look like?

I can tell ChatGPT:

I spent ₹225 on petrol today.

The request goes through the same API that my web application uses.

ChatGPT
   ↓
OAuth
   ↓
Continuum API
   ↓
Authentication
   ↓
Business Logic
   ↓
Database
Enter fullscreen mode Exit fullscreen mode

The expense gets created.

I can then open the dashboard and see it there.

The interesting part isn't that ChatGPT can create an expense.

The interesting part is that the AI doesn't need to know how the application works.

It only needs to know what the API allows it to do.

Why build it this way?

I wanted the AI integration to remain replaceable.

If tomorrow I decide I don't want to use ChatGPT, I shouldn't have to redesign the application.

The API remains the source of truth.

Today I can have:

             ┌── Web App
             │
             ├── ChatGPT
Continuum ───┼── Gemini
    API      │
             ├── Mobile App
             │
             └── Custom Client
Enter fullscreen mode Exit fullscreen mode

Every client interacts with the same underlying system.

That also means I can build new interfaces without duplicating business logic.

It's not just an AI experiment

Continuum started as a personal dashboard.

It currently brings several parts of my digital life into one place:

  • Expense tracking
  • Movie and TV watchlists
  • Books
  • Investments
  • Personal data
  • AI-powered interaction through the API

The goal isn't to build another generic "AI productivity app."

It's closer to a personal data layer that different interfaces can consume.

Security

Since this deals with personal data, I didn't want the API to simply expose everything.

The architecture uses authentication and authorization to make sure clients only have access to the data they're supposed to access.

Sensitive data is encrypted server-side before being persisted.

The important principle is:

AI gets access to capabilities, not direct access to the database.

For example, an AI client can call:

createExpense(...)
Enter fullscreen mode Exit fullscreen mode

rather than getting a database connection and being told:

"Good luck."
Enter fullscreen mode Exit fullscreen mode

That distinction becomes increasingly important as AI agents get more capable.

Why not just build everything around an AI agent?

Because I don't think the agent should own the application.

An AI model is replaceable.

Your data isn't.

Your business logic shouldn't depend on a particular model either.

If the application API is designed properly, the AI becomes another interface on top of it.

That gives you a cleaner separation:

                    Interfaces
                        │
        ┌───────────────┼────────────────┐
        │               │                │
      Web App         ChatGPT          Gemini
        │               │                │
        └───────────────┼────────────────┘
                        ▼
                   API Layer
                        │
                 Business Logic
                        │
                     Data
Enter fullscreen mode Exit fullscreen mode

The part I'm still experimenting with

This architecture raises some interesting questions.

How much functionality should an AI client actually be allowed to access?

Should AI clients get exactly the same API permissions as normal applications?

How should destructive operations be handled?

Should sensitive operations require explicit confirmation?

And eventually:

Does an API designed for humans also make a good API for agents?

I don't have all the answers yet.

That's actually one of the reasons I built this.

I wanted to have a real application where I could experiment with these ideas instead of just talking about them.

It's open source

Continuum is self-hostable and the source is available on GitHub.

If you're interested in API-first applications, self-hosting, AI integrations, or building your own personal data layer, I'd be interested in hearing what you'd change about the architecture.

GitHub: https://github.com/fal3n-4ngel/Continuum-Home

Live demo: https://continuum-home.vercel.app/

If you build something similar, I'd also love to see how you're approaching the AI/API boundary.

Top comments (0)