Skip to content

Continuous AI

Continuous AI keeps MyDeskBot engaged with your development workflow, providing proactive assistance throughout your coding session.

What is Continuous AI?

Continuous AI is MyDeskBot's ability to maintain context and provide ongoing assistance without requiring explicit prompts. It watches your coding patterns, anticipates needs, and offers relevant suggestions automatically.

How Continuous AI Works

1. Active Monitoring

MyDeskBot monitors your coding activities:

  • File changes: Tracks modifications across files
  • Cursor position: Knows what you're working on
  • Edit patterns: Learns your editing habits
  • Error occurrences: Notices mistakes and corrections

2. Proactive Suggestions

Offers help before you ask:

// You just wrote a function that returns data
function getUsers() {
  return db.query('SELECT * FROM users');
}

// MyDeskBot proactively suggests:
"You might want to add error handling here since database queries can fail."

3. Context Retention

Remembers your session:

  • Recent edits: Remembers what you just changed
  • Pending tasks: Tracks incomplete work
  • Related code: Knows what's connected
  • Your preferences: Adapts to your style

Features

1. Auto-Complete with Context

Suggestions that understand the bigger picture:

python
# You've been working on user authentication

# When you type:
def login

# MyDeskBot suggests:
def login(email, password):
    user = get_user_by_email(email)
    if user and verify_password(password, user.password_hash):
        return create_session(user)
    raise InvalidCredentialsError()

# Instead of a generic function
def login():
    pass

2. Error Detection and Fix

Catches errors and suggests fixes:

javascript
// You type:
const users = getUserList();
users.map((user) => user.name);

// MyDeskBot notices:
("users might be null, you should add a null check");

// Suggestion:
const users = getUserList();
users?.map((user) => user.name) || [];

Suggests related code you might need:

typescript
// You create an interface:
interface User {
  id: number;
  name: string;
  email: string;
}

// MyDeskBot suggests:
("You might want to create validation for User:");
interface UserValidation {
  nameMinLength: number;
  emailPattern: RegExp;
}

// And a validator:
function validateUser(user: User): boolean {
  return user.name.length >= 2 && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(user.email);
}

4. Pattern Recognition

Recognizes and suggests patterns:

java
// You write:
public class UserRepository {
    private final Database db;

    public UserRepository(Database db) {
        this.db = db;
    }
}

// MyDeskBot recognizes the repository pattern
// And suggests completing it:
public class UserRepository {
    private final Database db;

    public UserRepository(Database db) {
        this.db = db;
    }

    public User findById(Long id) {
        return db.query("SELECT * FROM users WHERE id = ?", id);
    }

    public List<User> findAll() {
        return db.query("SELECT * FROM users");
    }

    public User save(User user) {
        if (user.getId() == null) {
            db.insert("INSERT INTO users ...", user);
        } else {
            db.update("UPDATE users ...", user);
        }
        return user;
    }
}

5. Progressive Assistance

Helps progressively through tasks:

// Step 1: You create a User model
class User { ... }

// Step 2: MyDeskBot suggests creating a controller
"Want to create a REST controller for User?"

// Step 3: MyDeskBot suggests creating tests
"Shall I create tests for the User controller?"

// Step 4: MyDeskBot suggests documentation
"Generate API documentation?"

Enabling Continuous AI

Configuration

json
{
  "mydeskbot.continuousAI": {
    "enabled": true,
    "proactiveSuggestions": true,
    "errorDetection": true,
    "patternRecognition": true,
    "contextRetention": {
      "enabled": true,
      "duration": 1800 // 30 minutes
    }
  }
}

Sensitivity Settings

Control how proactive MyDeskBot is:

json
{
  "mydeskbot.continuousAI.sensitivity": {
    "low": {
      "suggestionsDelay": 5000,
      "errorCheckInterval": 30000
    },
    "medium": {
      "suggestionsDelay": 2000,
      "errorCheckInterval": 10000
    },
    "high": {
      "suggestionsDelay": 500,
      "errorCheckInterval": 5000
    }
  }
}

Continuous AI Modes

1. Passive Mode

Watches and waits for you to ask:

json
{
  "mode": "passive",
  "autoComplete": true,
  "proactiveSuggestions": false
}

2. Active Mode

Offers suggestions actively:

json
{
  "mode": "active",
  "autoComplete": true,
  "proactiveSuggestions": true,
  "errorDetection": true
}

3. Adaptive Mode

Adjusts based on your activity:

json
{
  "mode": "adaptive",
  "learnFromFeedback": true,
  "adjustFrequency": true
}

Use Cases

1. Building a Feature

// You create:
const User = { name: string; email: string; }

// MyDeskBot suggests step-by-step:
// 1. "Create validation for User?"
// 2. "Create a form to input User?"
// 3. "Create API endpoint for User?"
// 4. "Create tests for User API?"

2. Fixing Bugs

// You encounter an error:
TypeError: Cannot read property 'name' of undefined

// MyDeskBot immediately suggests:
// "The object is undefined. You might want to add:
// user && user.name or user?.name"

3. Refactoring

// You refactor a function:
function getData() {
  // old code
}

// MyDeskBot notices related code:
// "These 3 other functions use getData. Should I update them too?"

4. Learning a Codebase

// You explore a new project
// MyDeskBot provides context:
// "This follows the Repository pattern. The data layer is in /repositories"
// "Authentication is handled by the AuthMiddleware class"
// "APIs are defined in /routes"

Best Practices

1. Provide Feedback

Help MyDeskBot learn:

// When MyDeskBot suggests something:
// 👍 - Accept (teaches MyDeskBot you like this)
// 👎 - Reject (teaches MyDeskBot to avoid this)

2. Set Boundaries

Define what MyDeskBot should and shouldn't do:

json
{
  "mydeskbot.continuousAI.boundaries": {
    "suggestRefactoring": true,
    "suggestTests": false,
    "suggestDocumentation": true,
    "suggestOptimizations": false
  }
}

3. Use Focused Mode

Disable distractions when needed:

// Toggle "Focus Mode" to pause proactive suggestions
// Still get inline completions when you ask

4. Review Suggestions

Always review before accepting:

javascript
// MyDeskBot suggests:
const result = data.filter((x) => x.active).map((x) => x.value);

// But you might prefer:
const result = data.filter((x) => x?.active).map((x) => x?.value || 0);

Performance Optimization

1. Reduce Context Window

json
{
  "mydeskbot.continuousAI.context": {
    "maxFiles": 5,
    "maxLinesPerFile": 100
  }
}

2. Throttle Suggestions

json
{
  "mydeskbot.continuousAI.throttle": {
    "suggestionsInterval": 2000,
    "errorCheckInterval": 10000
  }
}

3. Cache Results

json
{
  "mydeskbot.continuousAI.caching": {
    "enabled": true,
    "cacheSize": 100
  }
}

Continuous AI Readiness

Assess if your codebase is ready for Continuous AI:

See Continuous AI Readiness Assessment

Integration with Other Features

1. With Instinct

Instinct: Learns your codebase patterns
Continuous AI: Applies them proactively

2. With Code Review

Continuous AI: Catches errors as you type
Code Review: Comprehensive review of changes

3. With Code Completion

Code Completion: Complete your current line
Continuous AI: Suggest what to do next

Troubleshooting

Too Many Suggestions

Solution:

  • Lower sensitivity
  • Increase suggestion delay
  • Enable specific suggestion types only

Suggestions Not Relevant

Solution:

  • Re-index project
  • Provide more feedback (accept/reject)
  • Adjust context window size

Performance Issues

Solution:

  • Reduce context files
  • Increase throttling
  • Disable some proactive features

See Also