How thepersonalaicompany/amurex-backend works
1. High-level shape
- This repo is a Python 3.11 backend service for Amurex.
- It is not a full product stack by itself; it provides the server-side runtime, database schema, and integrations needed by the Amurex client(s), likely the browser extension referenced in the README.
2. Main application entrypoint
- index.py is the service entrypoint and is the place where request handling / orchestration starts.
- The codebase appears intentionally small: most architectural weight is in external services and database integration rather than many internal modules.
3. Persistence layer boundary
- database/db_manager.py is the main in-repo abstraction for data access.
- The system’s primary persistent store is Supabase Postgres, not a local embedded database.
- This makes Supabase the canonical system of record for user and meeting-related data.
4. Database schema and domain model
- Schema is managed through Supabase migrations under supabase/migrations.
- The migration names indicate these core domain tables:
- users
- meetings
- memories
- tracking
- late_meeting
- Architecturally, this suggests the backend tracks users, meeting metadata, meeting-derived context/memories, and some form of observability or late-meeting state.
5. Meeting-context storage
- The README specifies a Supabase Storage bucket named meeting_context_files.
- That bucket is a separate storage boundary from the Postgres tables and is used for file-based meeting context, attachments, or artifacts related to meetings.
6. AI/model execution boundary
- The backend supports two AI execution modes controlled by CLIENT_MODE:
- ONLINE: uses hosted model APIs such as OpenAI, Groq, and Mistral
- LOCAL: uses Ollama for inference and fast-embed for embeddings
- This is an important architectural switch: the service can run either as a cloud-integrated backend or a mostly local inference backend.
7. Operational dependencies
- Redis is a required runtime dependency.
- The repo does not show the Redis usage code, but its presence in prerequisites means the backend depends on it for transient state, coordination, caching, or background workflow support.
- This is a distinct operational subsystem from Supabase persistence.
8. Notification / outbound messaging
- The backend integrates with Resend via RESEND_API_KEY and RESEND_NOREPLY.
- This implies an outbound email/notification path separate from the main database and AI flows.
9. Configuration and secrets
- Runtime behavior is driven by environment variables in .env / .env.example.
- Key configuration groups are:
- Supabase credentials
- Redis connection details
- AI provider keys
- Resend email settings
- mode selection via CLIENT_MODE
- This repo is therefore strongly environment-configured rather than hard-coded.
10. Deployment topology
- The presence of Dockerfile and compose.yaml indicates the backend is intended to run in containers.
- Docker Compose likely packages the service with its runtime dependencies, making local and hosted deployment symmetric.
11. Repository boundary
- There is no frontend, no large service graph, and no explicit job worker code visible here.
- The repo is best drawn as a backend orchestration layer sitting between:
- external clients
- Supabase/Postgres + Storage
- Redis
- AI providers or local model runtime
- Resend for outbound email
12. What to show in an architecture diagram
- Put index.py / Python service at the center.
- Show Supabase as two parts: Postgres tables and Storage bucket.
- Show Redis as an operational side dependency.
- Show a forked AI path:
- ONLINE → OpenAI/Groq/Mistral
- LOCAL → Ollama + fast-embed
- Show Resend as a separate outbound integration.
- Show schema migrations as the mechanism that defines the persistent domain model, not as a runtime component.
Main entry points: migrations Postgres · .env.example Mode Switch · index.py Service · compose.yaml Compose
Components 19
Runtime
Python service and execution modes
- Service · Main backend entrypoint and orchestration hub
index.py - Mode Switch · Selects ONLINE cloud AI or LOCAL inference mode
.env.example
Data
Persistence and schema
- DB Manager · Repository abstraction over persistent reads and writes
database/db_manager.py - Postgres · Primary relational store backing users, meetings, memories, and tracking
supabase/migrations - File Store · Meeting context files bucket in Supabase Storage
- Users · User identity and account records
supabase/migrations/20250206_init_users_table.sql - Meetings · Meeting metadata and lifecycle records
supabase/migrations/20241201195715_meetings.sql - Memories · Meeting-derived context and persisted memory records
supabase/migrations/20240320000000_memories.sql - Tracking · Operational tracking and observability state
supabase/migrations/20240319000000_tracking_table.sql - Late Meeting · Late-meeting status and related handling
supabase/migrations/20241209115823_late_meeting.sql
Integrations
External services and model providers
- OpenAI · Hosted model provider used in ONLINE mode
- Groq · Hosted model provider used in ONLINE mode
- Mistral · Hosted model provider used in ONLINE mode
- Ollama · Local model runtime used in LOCAL mode
- Fast Embed · Local embedding backend used in LOCAL mode
- Redis · Operational dependency for transient state or workflow support
- Resend · Outbound email and notification delivery
Deploy
Container and compose setup
- Dockerfile · Container image definition for the backend
Dockerfile - Compose · Local multi-service runtime composition
compose.yaml
Connections 20
- Service → DB Manager: uses · Entrypoint delegates persistence work to the DB abstraction
- DB Manager → Postgres: reads/writes · All primary domain data persists in Supabase Postgres
- Postgres → Users: defines · Users schema lives in migrations
- Postgres → Meetings: defines · Meetings schema lives in migrations
- Postgres → Memories: defines · Memories schema lives in migrations
- Postgres → Tracking: defines · Tracking schema lives in migrations
- Postgres → Late Meeting: defines · Late-meeting schema lives in migrations
- Service → File Store: stores files · Service can work with meeting context artifacts in storage
- Service → Mode Switch: selects · Runtime chooses AI path based on environment mode
- Mode Switch → OpenAI: online · ONLINE mode can use hosted providers
- Mode Switch → Groq: online · ONLINE mode can use hosted providers
- Mode Switch → Mistral: online · ONLINE mode can use hosted providers
- Mode Switch → Ollama: local · LOCAL mode uses Ollama for inference
- Mode Switch → Fast Embed: local · LOCAL mode uses local embeddings
- Service → Redis: depends on · Backend requires Redis as an operational dependency
- Service → Resend: sends mail · Outbound email/notification integration
- Dockerfile → Service: packages · Container image runs the Python service
- Compose → Dockerfile: builds · Compose defines the service container setup
- Compose → Redis: includes · Local deployment likely brings up Redis alongside the service
- Compose → Postgres: connects · Deployment expects the backend to reach Supabase persistence