A semantic search and AI-powered intelligence platform that monitors community activity across Discord, Reddit, X, and LinkedIn. The system uses Chroma vector database for semantic search and Claude 4.5 Sonnet for intelligent analysis, providing real-time insights and automated trend detection for the Weavy team.
- Semantic Search: Search community content using natural language queries
- AI-Powered Analysis: Ask Claude questions about community feedback with context
- Automated Intelligence: Hourly background job that monitors and creates actionable tasks
- Task Management: Track and complete tasks generated from community insights
- Version Control: Full version history for AI agent instructions with diff comparison
- Email Notifications: Automated alerts for high-priority items
- User Management: Admin panel for user and role management
- Monaco Editor: Rich Markdown editor for agent instruction configuration
- Backend: Node.js with Express
- Frontend: EJS templates with Tailwind CSS and Shoelace Web Components
- Database: MongoDB (user management, tasks, configurations)
- Vector DB: Chroma (community content storage)
- AI: Claude 4.5 Sonnet API
- Email: SendGrid
- Authentication: JWT with email verification
- Node.js v16 or higher
- MongoDB Atlas account (or local MongoDB)
- Chroma API access
- Claude API key (Anthropic)
- SendGrid API key
-
Clone the repository
git clone <repository-url> cd community_intel_platform
-
Install dependencies
npm install
-
Configure environment variables
The
.envfile is already configured with:- MongoDB Atlas connection
- Chroma API credentials
- Claude API key
- SendGrid API key
Update the following if needed:
SESSION_SECRET=your-session-secret-here JWT_SECRET=your-jwt-secret-here BASE_URL=http://localhost:3000
-
Start the application
Development mode:
npm run dev
Production mode:
npm start
-
Access the application
Open your browser and navigate to
http://localhost:3000
-
Register an account
- Navigate to
/register - Use a
@weavy.comemail address (domain restriction) - Check your email for verification link
- Navigate to
-
Verify your email
- Click the verification link in your email
- You can now log in
-
Promote to admin (if needed)
- Connect to MongoDB directly
- Update your user document:
{ role: 'admin' }
-
Configure AI agents
- Navigate to Admin > Ask Agent Configuration
- Review and customize the instructions
- Navigate to Admin > Background Agent Configuration
- Configure notification settings and keywords
community_intel_platform/
├── src/
│ ├── config/ # Configuration files (DB, Chroma, Claude, SendGrid)
│ ├── models/ # MongoDB models
│ ├── controllers/ # Request handlers
│ ├── services/ # Business logic (Chroma, Claude, Email, Background Agent)
│ ├── middleware/ # Authentication and authorization
│ ├── routes/ # API and view routes
│ ├── views/ # EJS templates
│ └── jobs/ # Scheduled jobs
├── public/ # Static assets (CSS, JS)
├── server.js # Main application entry
├── package.json
└── .env # Environment variables
-
Semantic Search
- Enter a query in natural language
- Filter by platform, date range, or author
- View relevance scores and source metadata
-
Ask Claude
- Ask questions about community feedback
- Claude provides insights based on relevant content
- Sources are automatically included
-
View Tasks
- Filter by status, priority, platform
- Mark tasks as complete
- View source links and metadata
-
Task Sources
- AI-generated tasks (from background agent)
- High/medium/low priority classification
- Platform and intent categorization
-
User Management
- View all registered users
- Change user roles (admin/user)
- Monitor verification status
-
Agent Configuration
- Ask Agent: Configure how Claude responds to user questions
- Background Agent: Configure automated monitoring and task creation
- Version control with full history
- Compare versions side-by-side
- Restore previous versions
-
Manual Agent Execution
- Run background agent on-demand
- View execution statistics
- Test new configurations
The background agent runs automatically every hour:
- Queries Chroma for new content from the last hour
- Analyzes content using Claude with configured instructions
- Creates tasks based on priority thresholds
- Sends email notifications for high-priority items
- Prevents duplicate task creation
Edit src/jobs/intelligenceJob.js:
// Hourly execution (production)
cron.schedule('0 * * * *', ...)
// Every 5 minutes (testing)
cron.schedule('*/5 * * * *', ...)POST /api/auth/register- Register new userPOST /api/auth/login- User loginGET /api/auth/verify/:token- Email verificationPOST /api/auth/forgot-password- Request password resetPOST /api/auth/reset-password/:token- Reset passwordGET /api/auth/me- Get current user
POST /api/search- Semantic searchPOST /api/ask- Ask Claude with contextGET /api/search/filters- Get available filters
GET /api/tasks- Get all tasks (with filters)GET /api/tasks/count- Get uncompleted task countPUT /api/tasks/:id/complete- Mark task as completePUT /api/tasks/:id/reopen- Reopen task
GET /api/admin/users- List all usersPUT /api/admin/users/:id/role- Update user roleGET /api/admin/agent-config/:type- Get agent configurationPUT /api/admin/agent-config/:type- Update agent configurationGET /api/admin/agent-config/:type/versions- Get version historyPOST /api/admin/agent-config/:type/restore/:versionNumber- Restore versionPOST /api/admin/agent/run- Manually run background agent
- JWT authentication with httpOnly cookies
- Email verification required
- Domain restriction (@weavy.com only)
- Rate limiting on API endpoints
- Helmet.js security headers
- Input validation and sanitization
- CSRF protection via session tokens
Email notifications are sent for:
- User registration (verification link)
- Password reset requests
- High-priority tasks from background agent
Configure notification settings in the Background Agent admin panel:
- Enable/disable notifications
- Set minimum priority threshold
- Configure keywords to monitor
- Specify intent categories
- Verify MongoDB URI in
.env - Check network access in MongoDB Atlas
- Ensure IP whitelist includes your IP
- Verify Chroma API key and tenant ID
- Check Chroma host configuration
- Ensure collection exists or gets created
- Verify SendGrid API key
- Configure sender authentication in SendGrid
- Check email quota limits
- Verify Claude API key
- Check API rate limits
- Monitor token usage in logs
- Create models in
src/models/ - Add business logic in
src/services/ - Create controllers in
src/controllers/ - Define routes in
src/routes/ - Create views in
src/views/
Connect to MongoDB and run migration scripts as needed:
// Example: Add new field to all users
db.users.updateMany({}, { $set: { newField: defaultValue } })-
Environment Variables
- Set
NODE_ENV=production - Generate strong secrets for JWT and session
- Configure production MongoDB URI
- Set
BASE_URLto production domain
- Set
-
Security
- Enable HTTPS/SSL
- Configure CORS allowed origins
- Set secure cookie flags
- Review Helmet.js CSP policies
-
Monitoring
- Use PM2 for process management
- Set up error logging (Winston, Sentry)
- Monitor background job execution
- Track API usage and performance
-
Backups
- Configure MongoDB automated backups
- Export agent configuration versions
- Backup environment variables securely
Proprietary - Weavy Internal Use Only
For questions or issues, contact the Weavy development team.