The friend who listens, understands, and remembers.
Comrade AI is an AI journaling companion that learns from your writing and provides personalized emotional support through intelligent journaling, voice conversations, text chat, and emotional insights.
Rich markdown editor (Milkdown) with auto-save, mood tagging, and a searchable archive. Journal entries are semantically indexed via SuperMemory so the AI understands your history and emotional patterns over time.
Real-time voice calls powered by LiveKit. Choose from multiple AI speaker personas (Abhimanyu, Arjuna, Mira, Gargi, Karna, Kavya). A separate Python agent (voice-agent/) runs the speech pipeline entirely on Groq's free tier — no paid speech provider needed. Includes a per-user quota system (5 minutes free).
Text-based conversations backed by memory-aware context (Groq openai/gpt-oss-120b). The AI recalls relevant journal entries and your profile to provide personalized responses. Conversations are persisted with auto-generated titles.
Visual knowledge graph of your memories and emotional patterns using SuperMemory's memory graph component.
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router), React 19, TypeScript |
| API | tRPC 11 with React Query |
| Database | PostgreSQL (Neon serverless) + Drizzle ORM |
| Auth | Clerk (custom flows + bot sign-up protection) |
| LLM | Groq (openai/gpt-oss-120b) |
| Memory | SuperMemory (semantic storage & retrieval) |
| Voice | LiveKit Cloud + voice-agent/ (Groq STT whisper-large-v3-turbo, LLM gpt-oss-120b, TTS Orpheus) |
| Editor | Milkdown (markdown) |
| Payments | Dodo Payments |
| Styling | Tailwind CSS 4, shadcn/ui |
- Bun runtime
- Python 3.10+ (only for the voice agent)
- PostgreSQL database (recommended: Neon)
- Account keys for Clerk, Groq, SuperMemory, and LiveKit
- Clone the repo and install dependencies:
git clone <repo-url>
cd comrade-ai
bun install- Copy the example env file and fill in your keys:
cp .env.example .envRequired variables:
| Variable | Description |
|---|---|
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY |
Clerk frontend key |
NEXT_PUBLIC_CLERK_SIGN_IN_URL |
/sign-in |
NEXT_PUBLIC_CLERK_SIGN_UP_URL |
/sign-up |
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL |
/chat |
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL |
/onboarding |
CLERK_SECRET_KEY |
Clerk backend key |
CLERK_WEBHOOK_SECRET |
Clerk webhook signing secret (only needed if you deliver webhooks) |
SUPERMEMORY_API_KEY |
SuperMemory API key |
DATABASE_URL |
PostgreSQL connection string |
GROQ_API_KEY |
Groq API key (chat + voice) |
CRON_SECRET |
Secret for cron job endpoints |
LIVEKIT_URL |
LiveKit Cloud WSS URL |
LIVEKIT_API_KEY |
LiveKit API key |
LIVEKIT_API_SECRET |
LiveKit API secret |
FEEDBACK_WEBHOOK_URL |
Discord feedback webhook URL |
DODO_PAYMENTS_API_KEY |
DODO Payments API key |
DODO_PAYMENTS_WEBHOOK_KEY |
DODO Payments webhook key |
DODO_PAYMENTS_RETURN_URL |
http://localhost:3000 |
DODO_PAYMENTS_ENVIRONMENT |
test_mode or development |
- Push the database schema:
bun run db:push- Start the dev server:
bun devThe app will be available at http://localhost:3000.
The /talk feature requires a separate Python worker that joins LiveKit rooms and runs the speech pipeline. See voice-agent/README.md for full setup and the character → voice mapping.
Quick start:
bun run voice:setup # create venv + install deps
# fill voice-agent/.env (LIVEKIT_* — must match root .env — and GROQ_API_KEY)
bun run voice:dev # run the agent in hot-reload dev modeRun everything together: bun run dev:all (Next.js + voice agent via concurrently).
One-time setup: Groq's Orpheus TTS requires accepting the model terms at
https://console.groq.com/playground?model=canopylabs%2Forpheus-v1-englishwhile logged in, otherwise TTS fails withmodel_terms_required.
bun dev # Start dev server (Next.js + Turbo)
bun run build # Production build
bun run start # Serve production build
bun run typecheck # tsc --noEmit
bun run test # Vitest
bun run db:push # Push schema to database
bun run db:studio # Drizzle Studio
bun run db:generate # Generate migration
bun run db:migrate # Run migrations
bun run voice:setup # Set up the voice agent venv
bun run voice:dev # Run the voice agent (dev mode)
bun run voice:console # Run the voice agent in console mode
bun run dev:all # Run Next.js + voice agent togetherPrivate.