A self-healing development loop system that automatically ingests bug reports from multiple sources, clusters them using AI, and generates code fixes that are opened as GitHub pull requests.
Flow: Reddit/Sentry/GitHub Issues → Clustered Issues → Human Triage Dashboard → One-Click Fix → GitHub PR
Soulcaster is an open-source feedback triage and automated fix generation system. It monitors multiple sources for bug reports and user feedback, intelligently clusters similar issues together, and uses AI to generate code fixes that can be reviewed and merged via GitHub PRs.
-
Multi-Source Ingestion: Automatically collects feedback from:
- Reddit (via polling configured subreddits)
- Sentry (via webhooks)
- GitHub Issues (via manual sync or webhooks)
- Manual feedback submission
-
AI-Powered Clustering: Backend-owned async jobs embed feedback with Gemini and automatically deduplicate similar reports into clusters
-
Multi-Tenant Projects: Support for multiple projects per user with project-level isolation for feedback and clusters
-
Authentication & Authorization: GitHub OAuth integration via NextAuth
- Users sign in with their GitHub account
- PRs are created from the user's account (personalized attribution)
- Secure token management with encrypted session storage
- Future: GitHub App support for bot-based PRs
-
Automated Fix Generation: LLM-powered coding agent that:
- Analyzes clustered issues
- Selects relevant files to modify
- Generates code patches
- Opens GitHub pull requests from the authenticated user's account
- Runs in E2B sandboxes
-
Job Tracking: Monitor agent fix generation jobs with status updates, logs, and PR links
-
Web Dashboard: Next.js dashboard for:
- Reviewing clusters and feedback
- Managing multiple projects
- Triggering fixes with one click
- Configuring Reddit sources per project
- Viewing PRs and job status
The system consists of three main components:
- Backend (FastAPI): Python service handling ingestion, clustering, and agent orchestration
- Dashboard (Next.js): Web interface for triage and management
- Python 3.12+
- Node.js 20+
- Redis instance (Upstash recommended for serverless)
- PostgreSQL database (for dashboard authentication and project management only)
- GitHub account with repository access
- LLM API key (Gemini recommended for embeddings and fix generation)
git clone https://github.com/altock/soulcaster.git
cd soulcaster# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r backend/requirements.txt
# Copy environment variables
cp .env.example .env
# Edit .env with your configuration (see Configuration section)cd dashboard
npm install
# Setup Database
npx prisma migrate dev
# Copy environment variables
cp .env.example .env.local
# Edit .env.local with your configurationBackend (from project root):
uvicorn backend.main:app --reloadReddit Poller (optional, from project root):
python -m backend.reddit_pollerDashboard (from dashboard directory):
npm run devThe dashboard will be available at http://localhost:3000 and the backend API at http://localhost:8000.
See .env.example for all available environment variables. Key configuration includes:
Backend (.env):
UPSTASH_REDIS_REST_URL- Redis REST API URL (Upstash)UPSTASH_REDIS_REST_TOKEN- Redis REST API tokenGEMINI_API_KEYorGOOGLE_GENERATIVE_AI_API_KEY- Required for embeddings + backend-owned clusteringGITHUB_ID- GitHub OAuth app client IDGITHUB_SECRET- GitHub OAuth app client secretE2B_API_KEY- Required for E2B sandbox provisioning (default coding agent runner)KILOCODE_TEMPLATE_NAME- E2B template name (e.g.,kilo-sandbox-v-0-1-dev)
Dashboard (.env.local):
UPSTASH_REDIS_REST_URL- Same Redis credentialsUPSTASH_REDIS_REST_TOKEN- Same Redis tokenGITHUB_ID- GitHub OAuth app client ID (same as backend)GITHUB_SECRET- GitHub OAuth app client secret (same as backend)NEXTAUTH_URL- Your app URL (e.g.,http://localhost:3000)NEXTAUTH_SECRET- Random secret for NextAuth (generate withopenssl rand -base64 32)DATABASE_URL- PostgreSQL connection string for NextAuth and projectsBACKEND_URL- Backend API URL (defaults tohttp://localhost:8000)GEMINI_API_KEY/GOOGLE_GENERATIVE_AI_API_KEY- Only required if you opt into the deprecated dashboard-run clustering flow (seeENABLE_DASHBOARD_CLUSTERING)
How GitHub Authentication Works:
- Users MUST sign in with GitHub OAuth (required for all environments - local and production)
- GitHub redirects user to authorization page where they grant
repoandread:userscopes - Access token is stored securely in encrypted NextAuth session
- When user triggers a fix, their token is passed to the backend
- PRs are created from the user's GitHub account (e.g., @username), not a bot
- No fallback to personal access tokens - consistent behavior everywhere
- Future: GitHub App support coming for bot-based PRs (soulcaster[bot])
Backend:
REDDIT_SUBREDDITS- Comma-separated list of subreddits to monitor (e.g.,"claudeai,programming")REDDIT_SORTS- Listing sorts to pull (new,hot,top) - defaults to"new"REDDIT_POLL_INTERVAL_SECONDS- How often to poll Reddit - defaults to300REDIS_URLorUPSTASH_REDIS_URL- Alternative Redis connection string (if not using REST API)
Dashboard:
GITHUB_OWNER- Default GitHub repository owner (for new issues)GITHUB_REPO- Default GitHub repository name (for new issues)ENABLE_DASHBOARD_CLUSTERING- (defaultfalse) temporarily re-enable deprecated dashboard-run clustering APIs for dev-only experiments; production setups should keep this unset so clustering remains backend-owned
Backend:
pytest backend/tests -q --cov=backendDashboard:
npm run test --prefix dashboardBackend:
black backend && ruff backendDashboard:
npm run lint --prefix dashboardPlatform Settings:
- Build path:
./backend/ - Start command:
uvicorn main:app --host 0.0.0.0 --port ${PORT:-8080} - Health probe:
GET /(recommended for readiness checks)
Environment Variables: Configure all required variables from the Configuration section above (Redis, Gemini API key, etc.).
Vercel is recommended for the Next.js dashboard. Set the root directory to dashboard/ and configure all required environment variables.
Note: When deploying the backend with build path ./backend/, the working directory is already inside the backend folder, so use main:app (not backend.main:app) in the uvicorn command.
soulcaster/
├── backend/ # FastAPI backend service
│ ├── main.py # API endpoints
│ ├── models.py # Data models
│ ├── store.py # Redis storage layer
│ ├── reddit_poller.py # Reddit polling service
│ └── tests/ # Backend tests
├── dashboard/ # Next.js dashboard
│ ├── app/ # Next.js app router pages
│ ├── components/ # React components
│ ├── lib/ # Utility libraries
│ └── __tests__/ # Dashboard tests
└── documentation/ # Additional documentation
└── operations/ # Runbooks, monitoring, and backups
- Setup: Create a project in the dashboard and configure your GitHub repository
- Ingestion: The system monitors configured sources (Reddit, Sentry, GitHub) for new feedback
- Reddit: Background poller checks configured subreddits periodically
- GitHub: Manual sync or webhook integration
- Sentry: Webhook integration
- Manual: Direct submission via dashboard
- Clustering: New feedback items are queued in the backend and clustered asynchronously:
- Feedback is embedded using Gemini and grouped via the backend's clustering runner
POST /cluster-jobskicks off a job, while/cluster-jobs*and/clustering/statusexpose job progress + pending counts- Resulting clusters automatically deduplicate similar reports and refresh the dashboard view
- Triage: Clusters are displayed in the dashboard with:
- AI-generated summaries and titles
- Feedback count and source breakdown
- Links to original feedback items
- Fix Generation: When you click "Generate Fix":
- A job is created and tracked
- The coding agent (E2B sandbox) is triggered
- Agent analyzes the cluster context and generates code patches
- Creates a branch and opens a GitHub PR
- Job status updates with logs and PR link
- Review: Review and merge the PR through GitHub as normal
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Contributions are welcome! Please read the project guidelines and submit pull requests for any improvements.
For issues, questions, or contributions, please open an issue on GitHub.
For operational guides, see: