An agentic AI backend that doesn't just store content—it thinks, decides, and acts autonomously.
This isn't a typical CRUD API. When you save content, the system:
- 🔍 Analyzes Deeply - Extracts full content, topics, entities, key insights
- 🧠 Reasons Through Actions - Plans what to do based on your history and patterns
- ⚡ Takes Autonomous Actions - Creates collections, sets reminders, sends notifications
- 📚 Learns Over Time - Improves from your behavior patterns
┌─────────────────┐
│ Mobile App │ → Sends content
└────────┬────────┘
│
↓
┌─────────────────┐
│ FastifyAPI │ → Creates capture, queues for processing
└────────┬────────┘
│
↓
┌─────────────────┐
│ Bull Queue │ → Async processing
└────────┬────────┘
│
↓
┌──────────────────────────────────────────┐
│ AGENT COORDINATOR │
│ ┌──────────┐ ┌─────────┐ ┌──────────┐│
│ │ Analyzer │→ │ Planner │→ │ Executor ││
│ └──────────┘ └─────────┘ └──────────┘│
│ ↓ │
│ ┌──────────┐ │
│ │ Learner │ ← Records outcomes │
│ └──────────┘ │
└──────────────────────────────────────────┘
│
↓
✅ Complete
- Framework: Fastify (TypeScript)
- Database: Supabase (PostgreSQL) + Prisma ORM
- Queue: Redis + Bull
- AI: GPT-4 via Supermemory
- Content Analysis: Jina AI Reader API
- Notifications: Firebase Cloud Messaging (FCM) - NO SMS
- Calendar: Google Calendar API
- Voice: LiveKit SDK
- Node.js 20+
- PostgreSQL (via Supabase)
- Redis
Backend (TypeScript/Node.js):
npm installPython Downloader Tool (optional):
pip install -r requirements.txtSee processes/README.md for more details on the media downloader and AI processor.
Copy .env.example to .env and fill in your credentials:
cp .env.example .envRequired keys:
DATABASE_URL- Supabase PostgreSQL connection stringREDIS_URL- Redis connection stringOPENAI_API_KEY- OpenAI API key (used by Supermemory proxy)OPENAI_BASE_URL- OpenAI-compatible base URL (optional, e.g. Cerebras)OPENAI_MODEL- Default chat model (optional, overrides built-in default)SUPERMEMORY_API_KEY- Supermemory API keyJINA_API_KEY- Jina AI API keyJWT_SECRET- Secret for JWT tokens (min 32 chars)
Optional but recommended:
FIREBASE_*- For push notificationsGOOGLE_*- For calendar integrationLIVEKIT_*- For voice features
# Generate Prisma client
npm run prisma:generate
# Push schema to database
npm run prisma:push
# Or run migrations
npm run prisma:migrateDevelopment (API + Workers):
# Terminal 1: API Server
npm run dev
# Terminal 2: Workers
npm run workerProduction:
npm run build
npm startPOST /api/auth/register- Register new userPOST /api/auth/login- LoginPOST /api/auth/fcm-token- Update FCM token for push notificationsGET /api/auth/me- Get current user
POST /api/captures- Create capture (triggers autonomous processing)GET /api/captures- List capturesGET /api/captures/:id- Get single captureDELETE /api/captures/:id- Delete captureGET /api/captures/search?q=query- Search captures
POST /api/chat- Chat with AI (has access to all your saved content)GET /api/chat/history- Get chat historyDELETE /api/chat/history- Clear chat history
POST /api/reminders- Create reminderGET /api/reminders- List remindersPATCH /api/reminders/:id- Update reminderDELETE /api/reminders/:id- Delete reminder
POST /api/collections- Create collectionGET /api/collections- List collectionsGET /api/collections/:id- Get collection with capturesPOST /api/collections/:id/captures- Add capture to collectionDELETE /api/collections/:id/captures/:captureId- Remove from collectionDELETE /api/collections/:id- Delete collection
GET /api/calendar/auth/url- Get Google OAuth URLGET /api/calendar/auth/callback- OAuth callbackPOST /api/calendar/events- Create calendar eventGET /api/calendar/events- List upcoming events
POST /api/voice/room- Create LiveKit voice room
curl -X POST http://localhost:3000/api/captures \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "LINK",
"content": "https://example.com/article",
"userInput": "Save this for later"
}'What happens next (autonomously):
- Analyzer Agent fetches full content, extracts topics, entities, key insights
- Planner Agent creates action plan based on analysis and your history
- Executor Agent executes actions:
- Adds to relevant collection
- Creates tags
- Sets reminder if needed
- Sends push notification
- Learner Agent records outcome for pattern learning
All of this happens asynchronously in the background!
- Full content extraction (not just metadata)
- Topic extraction
- Entity recognition (people, orgs, technologies, locations)
- Key takeaways and action items
- Date detection
- Difficulty assessment
- Smart Collections: Auto-organizes content into themed collections
- Intelligent Tagging: Adds relevant tags based on topics
- Proactive Reminders: Sets reminders based on urgency and your patterns
- Calendar Integration: Creates events from detected dates
- Context-Aware Notifications: Tells you what it did and why
- Save Time Patterns: Learns when you typically save content
- Content Preferences: Understands your favorite topics and formats
- Notification Timing: Learns best times to notify you
- Runs periodically to find opportunities to help
- Suggests actions: "You've saved 5 articles about React but haven't reviewed them"
- Pattern insights: "You save ML content on weekends"
The system runs background workers for async processing:
- Capture Processor - Processes captures through the agent system
- Reminder Sender - Sends scheduled reminders
- Proactive Agent - Finds opportunities to help users
Start workers with:
npm run workerKey tables:
users- User accountscaptures- Saved content with AI analysistags/collections- Organizationreminders- Scheduled reminderschat_messages- Chat historyaction_outcomes- Learning datauser_patterns- Learned patternsnotifications- Push notification history
See .env.example for all available configuration options.
# Run in development mode
npm run dev
# Run workers
npm run worker
# Build for production
npm run build
# Run tests (if added)
npm test
# Prisma Studio (database GUI)
npm run prisma:studioThis backend is designed to run on:
- API: Railway, Render, Fly.io
- Database: Supabase
- Redis: Upstash, Railway
- Workers: Same service as API or separate dyno
- All keys from
.env.example - Set
NODE_ENV=production
- ✅ All routes except
/healthand/api/auth/*require authentication - ✅ JWT-based authentication
- ✅ Password hashing with bcrypt
- ✅ Row-level security enforced at app level
- ✅ Input validation with Zod
- ✅ Rate limiting enabled
- ❌ NO SMS functionality (only FCM push notifications)
MIT
Built with ❤️ for NexHacks 2026
An autonomous AI system that truly thinks, decides, and acts.