HomeCase studiesTool-Gated AI Personal Assistant Platform for Knowledge...

Case study · Austin, United States

Tool-Gated AI Personal Assistant Platform for Knowledge Workers

AI Productivity & Workflow Automation

Busy operators lose hours daily switching between calendars, inboxes, task trackers, and meeting notes, yet unconstrained autonomous agents carry unacceptable risk when acting on external accounts. We engineered a web-based AI personal assistant platform using Python, FastAPI, React, PostgreSQL, Redis, and Celery integrated with external LLM APIs. The system pairs low-latency streaming dialogue with an explicit confirmation ledger, encrypted per-user OAuth vaults, and scoped semantic memory so users delegate routine coordination without surrendering control.

Industry
AI Productivity & Workflow Automation
Solution
A web and API personal assistant platform built with Python, FastAPI, React, and LLM APIs that unifies inbox triage, scheduling, and task drafting behind strict human-approval gates.
Platforms
Web & API
Stack
Python · FastAPI · React · LLM APIs · PostgreSQL · pgvector
Location
Austin, United States · delivered remotely
Role
Engineering, with the team behind for mobile and QA

Delivered remotely for a business based in Austin, United States. Names withheld by agreement.

Project Overview

Professionals coordinating across calendar suites, email threads, issue trackers, and chat channels spend substantial mental energy assembling context before taking simple actions. Early AI chat tools promised relief through natural-language prompts, yet raw chat interfaces break down when asked to inspect live schedules, draft contextual replies, or coordinate multi-step follow-ups across real accounts. Worse, granting an autonomous model unrestricted write access to corporate inboxes creates unacceptable operational risk.

Working remotely with a product group based in Austin, United States, we engineered an AI personal assistant platform powered by Python, FastAPI, React, and external LLM APIs. Rather than building an opaque autonomous bot, the architecture centers on a deterministic tool-execution gateway: the assistant gathers cross-app context, reasons over priorities, and stages structured action proposals that users inspect and approve inside a fast React workspace.

Operational Fragmentation

Building a practical executive assistant required resolving four recurring failure modes common in early agent prototypes:

  • Unchecked tool side effects: Language models occasionally misinterpret ambiguous pronoun references or time zones, making unguarded writes to calendars or email recipients dangerous.
  • Blocking synchronization loops: Polling external mail and calendar APIs synchronously inside a chat request freezes user interfaces whenever third-party endpoints throttle or lag.
  • Context bloat across long days: Stuffing raw email bodies and full meeting histories into every prompt rapidly degrades reasoning quality and inflates inference cost.
  • Fragile token management: Multi-connector assistants must handle expiring OAuth grants, partial scope revocations, and per-provider rate caps gracefully without silently dropping scheduled tasks.

Architectural Strategy

We structured the platform around a two-tier execution boundary enforced in Python and FastAPI. Read-only operations—searching upcoming calendar slots, fetching recent thread summaries, or checking open tasks—run dynamically during reasoning turns under strict per-user OAuth scopes. Any action that alters external state—sending a message, declining an invite, or updating a ticket—must emit a typed action proposal validated by Pydantic schemas and parked in a pending confirmation state.

In the browser, React renders these pending tool invocations as inline, editable cards rather than burying intent inside prose. Users can adjust a subject line, swap an attendee, or cancel an action with one click before FastAPI commits the downstream API call.

Core Capabilities

  • Unified Daily Briefings: Scheduled Celery jobs synthesize overnight inbox priority items, calendar conflicts, and overdue commitments into a scannable morning digest.
  • Interactive Action Staging: Drafted emails, meeting invitations, and task updates appear as structured React preview cards with diffed fields and explicit one-click confirmation.
  • Scoped Semantic Recall: PostgreSQL paired with pgvector indexes distilled meeting notes, recurring scheduling preferences, and contact context for fast hybrid retrieval.
  • Connector Policy Controls: Organization administrators define permitted integrations, data retention ceilings, and mandatory human-review rules per role.
  • Keyboard-First Command Workspace: Operators trigger quick actions, inspect tool execution logs, and jump between active workstreams without leaving the primary React canvas.

Technical Architecture

Every interactive turn enters FastAPI over an authenticated session, streams reasoning tokens via Server-Sent Events (SSE), and delegates heavy background synchronization to Celery queues backed by Redis.

Flow: React Workspace → FastAPI SSE Gateway (Auth & Policy Middleware) → Python Context Assembler (PostgreSQL / pgvector + Redis Window) → LLM API Router (Typed Tool Schemas) → Action Ledger (Auto-Run Reads / User-Approved Writes) → Celery Connector Workers

Splitting interactive inference from background connector ingestion kept response times predictable. Webhooks from connected mail and calendar providers land on dedicated ingestion endpoints, enqueue normalization jobs in Celery, and update structured summaries in PostgreSQL before the user ever opens a new prompt. When a user asks for availability or thread history, FastAPI queries pre-normalized local records first and falls back to live connector fetches only when cache freshness windows expire.

Technology Stack

Category Technology detail
API & Streaming Layer Python with FastAPI async endpoints and Server-Sent Events (SSE)
Frontend Workspace React with TypeScript, optimistic action cards, and keyboard-first command palette
Reasoning & Tool Calling External LLM APIs via typed function schemas and provider fallback routing
Primary & Vector Storage PostgreSQL with pgvector for user preferences, audit logs, and memory embeddings
Session & Throttle State Redis for short-term turn buffers, distributed locks, and rate limiting
Background Orchestration Celery workers for scheduled morning digests and webhook-driven inbox sync
Credential Vault Envelope-encrypted OAuth2 token store with per-connector scope isolation
Observability OpenTelemetry traces capturing prompt latency, tool failures, and token spend

Engineering Trade-offs & Solutions

Engineering Challenge Solution & Trade-off
Balancing automation speed against risky external writes Split tools into autonomous read queries and confirmation-gated write proposals; adds one extra user click on outbound actions while eliminating silent mis-sends.
Handling large raw email threads within model context limits Pre-summarized incoming messages into concise structured digests via Celery upon ingestion, trading verbatim long-tail archiving in prompts for consistent latency and lower token overhead.
Supporting multiple LLM providers without rewriting agent loops Built a unified Python adapter normalizing tool-call JSON schemas and streaming chunks, introducing modest abstraction code in exchange for clean failover during upstream outages.
Preventing concurrent Celery sync jobs from duplicating digest items Coordinated per-user sync mutexes and idempotency keys in Redis, adding minor lock management overhead while keeping morning briefings clean and duplicate-free.

Security & Authorization Boundaries

An assistant holding email and calendar integrations becomes a high-value target if permissions are loosely scoped. Every FastAPI route enforces strict tenant and user ownership checks, ensuring semantic vector queries in pgvector filter by user identity before similarity scoring runs.

External OAuth refresh tokens are stored using envelope encryption with isolated key references, never exposed to browser clients or injected into LLM system prompts. Furthermore, inbound email content fed into summarization pipelines is tagged explicitly as untrusted data inside structured message boundaries, accompanied by server-side schema validation so malicious text inside an incoming message cannot hijack outbound tool parameters.

Performance & Scale

FastAPI's non-blocking event loop sustains concurrent SSE streams cleanly without tying up worker threads while waiting on upstream LLM inference. Redis buffers active conversation turns and enforces per-user token-bucket throttling so runaway loops or burst retries cannot exhaust shared API quotas.

On the frontend, React code-splits connector configuration panels and audit viewers away from the main assistant canvas, keeping initial workspace loads crisp. Database indices on (user_id, created_at) and partial indices on pending action proposals keep ledger queries consistently fast as historical logs grow.

Operational Outcomes

Moving from an unguarded prompt wrapper to a schema-enforced assistant architecture delivered dependable daily utility:

  • Predictable delegation: Operators rely on the assistant to prepare schedules and correspondence because every state-changing operation surfaces a clear, editable preview prior to execution.
  • Resilient multi-provider operation: Typed validation and Redis circuit breakers absorb upstream LLM hiccups without corrupting active threads or dropping pending drafts.
  • Transparent auditability: Security teams and users alike can trace every tool call, retrieved memory record, and approved outbound action in an immutable PostgreSQL ledger.
  • Clean extensibility: Adding new workplace connectors requires implementing a single typed Python adapter and OAuth scope definition without altering the core React workspace.

01 — Questions

asked about this kind of project

How does the assistant avoid sending emails or modifying calendar invites without user consent?

Every tool call is classified in FastAPI as either read-only or state-mutating. Read calls execute automatically within scoped OAuth permissions, whereas mutating actions persist a pending proposal row in PostgreSQL and render an interactive approval card in React before any external API request fires.

Why pair FastAPI with Celery instead of running everything inside async web workers?

FastAPI handles interactive chat streams and low-latency UI reads cleanly, while Celery isolates slow external webhook synchronization, recurring morning digests, and embedding generation. That separation prevents background OAuth polling or provider retries from starving interactive SSE connections.

How does the system remember user preferences without polluting prompts with stale context?

Explicit preferences and recent thread summaries are indexed in PostgreSQL with pgvector alongside timestamps and decay weights. Retrieval filters strictly by user ID and recency, while users can inspect, edit, or delete stored memory entries from a dedicated React settings drawer.

What happens when a primary LLM API experiences degraded latency or schema drift?

An internal Python model router validates structured tool arguments with Pydantic before execution. If an upstream provider times out or emits malformed JSON repeatedly, circuit breakers in Redis reroute non-pinned turns to a secondary provider and surface clean retry states to the client.

How are third-party OAuth tokens protected at rest and during background execution?

Refresh and access tokens are envelope-encrypted using per-tenant data keys before entering PostgreSQL. Celery workers decrypt credentials transiently in memory only for the specific connector call, and revoked scopes immediately invalidate queued actions.

Can teams enforce organizational policies over what external tools individuals connect?

Yes. Workspace administrators configure connector allowlists, retention windows, and mandatory approval rules at the organization tier, and FastAPI policy middleware checks those flags before registering any tool schema into the LLM context.

03 — Similar project?

describe what is different about yours

Build yours.

Tell me what exists, what you need and the deadline. Fixed price for a defined scope, or $55/day (8–9 hours work) with a written plan first.

Solitaire Corporate Park, Makarba, Ahmedabad, Gujarat 380015, India · IST (UTC+5:30) · --:-- IST · Mon–Fri 09:00–18:00 IST · US & EU overlap daily

No newsletter, no CRM. Just a reply.