Commit Graph

8 Commits

Author SHA1 Message Date
Claude
cf33065315 Add SWOT Analysis Expert + streamline agent creation process
- Add SWOT Analysis Expert direct access agent (free, JotForm integration)
- Use existing 'analysis' category instead of creating new category
- Remove 10+ redundant create_* management commands for cleaner codebase
- Update CLAUDE.md with simplified JSON + populate_agents workflow
- Emphasize using existing categories to avoid proliferation
- Clean up agent creation architecture for Railway scalability
- All agents now follow unified JSON config approach

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 08:49:53 +05:30
Claude
2aea35f2d9 Add Lean Six Sigma Expert agent with Railway integration
- Add Business Consulting category to Railway config
- Create System 2 direct access agent with JotForm integration
- Add dedicated template with full-screen iframe layout
- Implement view functions for payment processing and form display
- Update marketplace template with special Try Now routing
- Add URL routes for agent access and display pages
- Create JSON config for Railway deployment compatibility
- Ensure identical database state between local and production

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 08:56:56 +05:30
Claude
d8b8420319 🧠 Add AI Brand Strategist embedded interface with Quantum Tasks header
- Create dedicated template with header + JotForm iframe
- Add ai_brand_strategist_view() and ai_brand_strategist_access() functions
- Add dedicated URL routes /ai-brand-strategist/ and /ai-brand-strategist/access/
- Update marketplace buttons to use dedicated routes for consistent UX
- Both CyberSec Career Navigator and AI Brand Strategist now show embedded forms
- Follows established direct access agent architecture pattern

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-04 23:36:35 +05:30
Claude
6fae2686c5 🚀 Implement scalable direct access architecture for 100+ agents
## Complete Scalable Architecture Implementation

**Problem Solved**: CyberSec Career Navigator was broken (empty form → JotForm URL webhook)
**Solution**: Built generic direct access architecture for unlimited external form agents

## New Architecture Features

**🎯 Direct Access Agents (External Forms):**
- Generic view functions work for ANY direct access agent
- Database-driven routing via access_url_name/display_url_name fields
- Template automatically detects and redirects to external forms
- Zero code changes needed for new direct access agents

**🔧 Webhook Agents (Dynamic Processing):**
- Existing webhook agents work exactly as before (unchanged)
- Dynamic form generation and N8N processing preserved
- Zero impact on current functionality

## Files Added/Modified

**Views** ():
- `direct_access_handler()` - Generic payment & access processing
- `direct_access_display()` - Generic external form display

**URLs** ():
- Generic routing: `<slug>/access/` and `<slug>/display/`
- Works for any agent with access_url_name configured

**Template** ():
- Conditional logic: `{% if agent.access_url_name %}`
- Direct access → "Start Consultation" button → External form
- Webhook → Dynamic form (unchanged)

**Migration** ():
- Adds access_url_name and display_url_name fields to Agent model

**Agent Config** ():
- Updated to use generic direct access URLs

## Scalability Achievement

**Ready for 100+ Agents:**
-  New webhook agent: Database record with empty access_url_name
-  New direct access agent: Database record with generic access_url_name
-  Zero code changes needed for new agents
-  Template automatically handles both types
-  Database-driven routing eliminates hardcoded URLs

## Expected Results

**After Railway Deployment:**
- CyberSec Career Navigator: "Start Consultation (FREE)" → Direct JotForm
- All webhook agents: Continue working exactly as before
- System ready for unlimited agents of both types

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-04 22:46:00 +05:30
Claude
641d676f2f 🎉 Complete 5 Whys agent enhancements with session management and UI improvements
## Major Features Added:

### 🕒 Session Time Limits (2hr → 30min)
- Updated ChatSession model: expires_at, extend_session methods
- Changed session creation and extension logic
- Updated JavaScript timing calculations
- Fixed timing indicator functionality with real-time server data

### 💬 Message Limits (50 → 20)
- Added message_limit field to Agent model with migration
- Implemented auto-completion when message limit reached
- Only count user messages (not agent responses) toward limit
- Enhanced error messaging for limit exceeded

### 📥 Chat Download System
- Added PDF and TXT export functionality using ReportLab
- Download buttons in chat header for active sessions
- Comprehensive export with session metadata and formatting
- New API endpoints: /agents/api/chat/export/{session_id}/

### 📋 Previous Sessions Management
- Created Previous Sessions widget showing last 5 non-active sessions
- Download access for all completed sessions with messages
- Session status indicators ( Completed,  Expired,  Abandoned)
- Clean sidebar organization with session history

### 🎨 UI/UX Improvements
- Moved session info from main chat to sidebar for cleaner interface
- Increased chat height: 600px → 800px (mobile: 500px → 650px)
- Added Current Session widget with status, ID, and start time
- Enhanced sidebar layout with proper component stacking
- Responsive design with mobile optimizations

### 🔧 Session Indicators System
- Real-time session status API with server-side data
- Progress bars for time remaining and message usage
- Warning notifications for approaching limits
- Automatic updates every 30 seconds

### 💰 Payment Flow Fixes
- Fixed charging system to actually deduct wallet balance
- Each new session charges 15 AED for 20 messages + 30 minutes
- Proper error handling for insufficient balance
- Session cleanup on payment failures

## Technical Implementation:

**Backend Changes:**
- Enhanced ChatSession model with 30-minute duration
- Message counting logic (user messages only)
- Auto-completion on limit reached
- Session status API endpoint
- PDF/TXT export with ReportLab

**Frontend Changes:**
- Comprehensive sidebar widget system
- Real-time indicator updates with server sync
- Download functionality with loading states
- Session history display with status icons
- Responsive layout improvements

**Database:**
- Added message_limit field to Agent model
- Updated ChatSession expiration logic
- Efficient queries for session history

## User Experience:
 Clear session limits (20 messages, 30 minutes)
 Automatic session completion with preserved history
 Easy download access for all previous sessions
 Transparent pricing (15 AED per session)
 Clean, organized interface with more chat space
 Real-time feedback on session progress

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 13:28:39 +05:30
Claude
3fac20fe28 🎯 Complete dual integration architecture with JotForm and digital branding
- Add CyberSec Career Navigator with JotForm white-label integration
- Implement direct access agent system alongside webhook agents
- Add digital branding services page with SOSTAC+RACE methodology
- Create dual integration patterns: webhook vs direct access flows
- Clean up unused form API endpoints for streamlined architecture
- Add career navigator management command and templates
- Update marketplace with conditional logic for different agent types
- Fix UI consistency issues (remove category labels, fix animations)
- Update documentation to reflect new dual architecture

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 10:47:16 +05:30
Claude
ab2360a91d 💬 Implement complete chat-based agent system with 5 Whys Analysis
🏗️ **Database Extensions:**
- Add agent_type field to Agent model (form/chat distinction)
- Create ChatSession model for conversation management
- Create ChatMessage model for message storage with metadata
- Add database indexes for performance optimization

🎨 **Frontend Implementation:**
- Create agent_chat.html template with modern chat interface
- Implement real-time messaging UI with message bubbles
- Add typing indicators and loading states
- Responsive design for mobile and desktop
- Empty states and error handling

🔧 **Backend Logic:**
- Extend agent_detail_view to route chat vs form agents
- Implement chat_agent_view for chat interface rendering
- Add start_chat_session API endpoint with session management
- Add send_chat_message API endpoint with webhook integration
- Add get_chat_history and end_chat_session endpoints
- Session-based fee charging system

🤖 **5 Whys Agent:**
- Create "Analysis & Problem Solving" category
- Implement 5 Whys Analysis chat-based agent (15 AED)
- Interactive problem-solving methodology guidance
- N8N webhook integration for AI responses

 **Interactive Features:**
- JavaScript ChatInterface class for real-time communication
- Auto-session creation and management
- Message validation and error handling
- Automatic scrolling and UI state management
- CSRF protection and security measures

🔗 **API Integration:**
- Chat-specific API endpoints with RESTful design
- Webhook payload formatting for N8N integration
- Session ID tracking and conversation continuity
- Metadata storage for webhook responses

🛡️ **Security & UX:**
- Login required for chat agents
- Wallet balance validation before session creation
- Session isolation per user and agent
- Comprehensive error handling and user feedback

**New URLs:**
- /agents/api/chat/start/ - Start new chat session
- /agents/api/chat/send/ - Send chat message
- /agents/api/chat/history/<session_id>/ - Get chat history
- /agents/api/chat/end/ - End chat session
- /agents/five-whys-analysis/ - 5 Whys chat interface

**Backward Compatibility:**
- Existing form-based agents (Social Ads, Job Posting, PDF) unchanged
- Admin interface updated to show agent types
- Marketplace displays both agent types seamlessly

🚀 Ready for interactive 5 Whys problem-solving conversations\!

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 09:39:43 +05:30
Claude
5eba8fee84 🚀 Complete agents app implementation with social ads frontend
- Create complete REST API-based agents system for scalability
- Implement Social Ads Generator with dynamic form rendering
- Add agents marketplace with search and category filtering
- Build real-time wallet balance updates after execution
- Fix URL routing conflicts and API endpoint issues
- Add comprehensive N8N webhook integration with proper payload format
- Create dynamic template system for 100+ agent scalability

Features:
- Database-driven agent management via Django admin
- JSON schema-based dynamic form generation
- Real-time wallet balance deduction and display updates
- Comprehensive error handling and validation
- Mobile-responsive marketplace UI
- Complete API endpoints for frontend integration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-31 19:05:09 +05:30