chatbotreadme.mdβ’7.71 kB
# MARM v2.0 - Memory Accurate Response Mode
**Production-ready AI chatbot with persistent memory, modern glassmorphism UI, and professional testing infrastructure.**
*Memory Accurate Response Mode v2.0* - Build smarter AI conversations with structured memory and transparent logic.
## π Quick Start
### Local Development
```bash
cd webchat
npm install
npm start
```
Open `http://localhost:8080` - the modern glassmorphism interface will load with floating message cards.
### Testing
```bash
npm test # Run 74 comprehensive tests
npm run lint # Code quality checks
```
---
## β¨ What's New in v2.0
### π§ **LLaMA 4 Maverick Integration**
- **Complete migration** from Google Gemini to Replicate LLaMA 4 (400B parameters)
- **95% cost reduction** while improving response quality and speed
- **10M token context limit** for extensive conversation histories
- **Advanced streaming** with real-time response delivery
### π¨ **Modern Glassmorphism UI**
- **Floating message cards** on transparent glass background
- **Color-coded conversations** - White user cards, gold AI responses
- **2025 aesthetic** - Single-layer design, no nested windows
- **Perfect contrast** - Readable text with beautiful visual hierarchy
### π§ͺ **Professional Testing Infrastructure**
- **74 comprehensive tests** covering Voice, UI, State, Commands, and Security
- **GitHub Actions CI/CD** with automated testing on push/PR
- **42% test coverage** with browser API mocking and edge case validation
- **Jest configuration** supporting ES modules and modern JavaScript
### π **Enterprise Security**
- **XSS protection** with comprehensive input sanitization
- **Content security** smart filtering preserving functionality
- **Session isolation** with proper data validation
- **File upload security** supporting 15+ file types with syntax highlighting
---
## π Project Architecture
```text
webchat/
βββ src/
β βββ replicateHelper.js # LLaMA 4 Maverick API integration
β βββ chatbot/
β β βββ server.js # Express proxy server for API calls
β β βββ chatbot.js # Main entry point and orchestration
β β βββ commands.js # Command handling (/start marm, /deep dive, /notebook, etc.)
β β βββ core.js # Input validation and main chat loop
β β βββ state.js # Centralized state management
β β βββ ui.js # Modern glassmorphism UI rendering and interactions
β β βββ voice.js # Text-to-speech with Google Voice integration
β β βββ sessionUI.js # Session management interface
β βββ logic/
β β βββ constants.js # MARM protocol constants and configuration
β β βββ docs.js # Documentation loading and help system
β β βββ marmLogic.js # Core MARM v2.0 protocol implementation
β β βββ notebook.js # User notebook with key-value storage
β β βββ session.js # Session persistence and context management
β β βββ storage.js # LocalStorage operations with validation
β β βββ summary.js # Session compilation and memory synthesis
β β βββ utils.js # Validation, debounce, and utility functions
β βββ security/
β βββ xssProtection.js # Comprehensive security filtering
βββ style/
β βββ animations.css # Bouncing dots, hover effects, transitions
β βββ base.css # Core glassmorphism styling and CSS variables
β βββ chat.css # Floating message cards and conversation styling
β βββ command-menu.css # Modern command popup interface
β βββ components.css # Reusable UI components (buttons, modals, forms)
β βββ main.css # Main stylesheet coordination
βββ tests/ # Professional test suite
β βββ chatbot.test.js # Voice and Commands module tests (29 tests)
β βββ logic.test.js # Session and State management tests (30 tests)
β βββ security_replicate_html.test.js # Security and UI tests (15 tests)
βββ data/ # Documentation and help content
β βββ chatbotreadme.md # This file
β βββ description.md # Protocol overview and features
β βββ faq.md # Frequently asked questions
β βββ handbook.md # Complete user guide and command reference
β βββ roadmap.md # Development roadmap and future features
βββ index.html # Main MARM v2.0 web application
```
---
## π― Core Features
### **Memory System**
- **Session Context & Recall** - Structured memory that builds across conversations
- **Folder-style organization** with named sessions (`/log session: [name]`)
- **Manual knowledge library** via notebook commands (`/notebook add: [key] [data]`)
- **Context preservation** - Mid-session MARM activation imports existing conversation
### **Advanced Commands**
- `/start marm` - Activate structured memory mode
- `/deep dive: [topic]` - Detailed analysis with reasoning transparency
- `/notebook add: [key] [data]` - Store persistent user information
- `/log entry: [YYYY-MM-DD-topic-summary]` - Create organized memory entries
- `/summary: [session]` - Generate transferable session summaries
### **Modern Interface**
- **File upload support** (π) - Analyze 15+ file types with syntax highlighting
- **MARM toggle** (π€) - Switch between structured and free conversation modes
- **Voice synthesis** (π) - Text-to-speech for all AI responses
- **Command menu** - Contextual popup interface next to input field
- **Glassmorphism design** - Floating cards on transparent glass background
---
## π§ͺ Testing & Quality
### **Comprehensive Test Coverage**
```bash
npm test # Run all 74 tests
npm test -- --coverage # Generate coverage report (42% coverage)
npm test -- --watch # Watch mode for development
```
### **CI/CD Pipeline**
- **GitHub Actions** automated testing on every push/PR
- **Multi-environment testing** (Node.js 18.x & 20.x)
- **Test status badge** visible on repository homepage
- **Coverage reports** with detailed line-by-line analysis
### **Code Quality**
- **ES module architecture** with proper imports/exports
- **Browser API mocking** for comprehensive testing
- **Security validation** with XSS protection testing
- **Error handling** with comprehensive edge case coverage
---
## π Documentation
- **[User Handbook](handbook.md)** - Complete guide to MARM commands and features
- **[FAQ](faq.md)** - Common questions and troubleshooting
- **[Protocol Description](description.md)** - Technical overview and architecture
- **[Development Roadmap](roadmap.md)** - Future features and enhancement plans
---
## π§ Development
### **Requirements**
- Node.js 18+
- Modern browser with ES module support
- 15MB disk space for dependencies
### **Environment Variables**
```bash
REPLICATE_API_TOKEN=your_token_here # Required for LLaMA 4 integration
NODE_ENV=development # Optional: enables debug logging
```
### **Development Workflow**
1. `npm install` - Install dependencies
2. `npm start` - Start development server (port 8080)
3. `npm test` - Run test suite before commits
4. Edit files - Hot reload enabled for CSS/JS changes
---
## π License
MIT License - See [LICENSE](../LICENSE) for details.
---
**MARM v2.0** - Where AI conversations become lasting memories. π§ β¨