Self-Learning System

How Dropstone Agent learns from your projects and improves over time

One of Dropstone Agent's most powerful features is its ability to learn from every interaction. Unlike static tools that always behave the same way, Dropstone Agent adapts to your codebase, learns your patterns, and improves its performance over time.

What Does "Self-Learning" Mean?

Self-learning means the agent:

  • Remembers successful approaches
  • Adapts to your coding style
  • Improves decision-making based on experience
  • Avoids repeating mistakes
  • Discovers project-specific patterns

Think of it like working with a new team member who gradually learns your project, your conventions, and your preferences.


How the Learning System Works

From Day One to Expert Assistant

Week 1: Learning the Basics

You: "Create a new API endpoint for users"
Agent: [Creates endpoint, asks several clarifying questions]
      [Takes 5 minutes, requires multiple approvals]

Week 4: Understanding Patterns

You: "Create a new API endpoint for posts"
Agent: "I'll follow the same pattern as your users endpoint..."
      [Creates endpoint matching your exact conventions]
      [Takes 2 minutes, works autonomously]

Month 3: Proactive Intelligence

You: "Create an API endpoint for comments"
Agent: "Creating endpoint following your established patterns.
       I'll include:
       - Input validation middleware
       - Error handling with your standard format
       - Pagination (since your other endpoints use it)
       - OpenAPI documentation
       Should I also add rate limiting like your other public endpoints?"

What the Agent Learns

1. Your Code Patterns

Structure Patterns:

  • How you organize files and folders
  • Naming conventions for files and variables
  • Import statement organization
  • Code formatting preferences

Example:

// After seeing you use this pattern a few times:
├── features/
│   ├── users/
│   │   ├── users.controller.ts
│   │   ├── users.service.ts
│   │   ├── users.model.ts
│   │   └── users.test.ts

// The agent automatically applies it to new features:
├── features/
│   ├── posts/
│   │   ├── posts.controller.ts  // ← Follows learned pattern
│   │   ├── posts.service.ts
│   │   ├── posts.model.ts
│   │   └── posts.test.ts

2. Your Error Handling Style

Learns Your Approach:

// Pattern the agent observes in your code:
try {
  const result = await apiCall();
  return { success: true, data: result };
} catch (error) {
  logger.error('API call failed', { error, context });
  return { success: false, error: error.message };
}

// Automatically applies to new code:
try {
  const posts = await fetchPosts();
  return { success: true, data: posts };  // ← Matches your style
} catch (error) {
  logger.error('Fetch posts failed', { error, context });
  return { success: false, error: error.message };
}

3. Your Testing Conventions

Testing Patterns:

  • Test file naming (.test.ts vs .spec.ts)
  • Test structure (describe/it blocks)
  • Assertion style (expect vs assert)
  • Mock patterns
  • Test coverage expectations

Example:

// Your existing tests:
describe('UserService', () => {
  it('should return user when found', async () => {
    // Arrange
    const mockUser = { id: 1, name: 'Test' };
    // Act
    const result = await service.getUser(1);
    // Assert
    expect(result).toEqual(mockUser);
  });
});

// Agent generates matching style:
describe('PostService', () => {  // ← Same structure
  it('should return post when found', async () => {  // ← Same naming
    // Arrange  // ← Same comments
    const mockPost = { id: 1, title: 'Test' };
    // Act
    const result = await service.getPost(1);
    // Assert
    expect(result).toEqual(mockPost);  // ← Same assertions
  });
});

4. Your API Design Patterns

REST Conventions:

// Learned pattern from your existing endpoints:
router.post('/users',
  validateInput(userSchema),      // Validation first
  authenticate,                    // Auth second
  async (req, res) => {           // Handler last
    try {
      const user = await userService.create(req.body);
      res.status(201).json({ data: user });  // Your response format
    } catch (error) {
      res.status(400).json({ error: error.message });
    }
  }
);

// Applied to new endpoints automatically

5. Your Documentation Style

Comment Patterns:

/**
 * Fetches a user by ID from the database
 * @param userId - The unique identifier of the user
 * @returns Promise resolving to User object
 * @throws {NotFoundError} If user doesn't exist
 */
async function getUser(userId: string): Promise<User>

// Agent matches this style in new code

Types of Memory

The agent uses three types of memory to learn:

Episodic Memory

What it stores: Specific tasks you've completed together

Example:

Task #47: "Add email validation to registration form"
- Used: validator.js library
- Pattern: Custom validation middleware
- Outcome: Success
- Time: 5 minutes
- Files: src/middleware/validation.ts

How it helps: When you ask for similar validation in the future, the agent remembers this successful approach.

Semantic Memory

What it stores: General knowledge about your project

Example:

Knowledge: "This project uses validator.js for all input validation"
Confidence: 0.95 (very confident)
Evidence: Used in 15 different tasks
Last verified: 2 days ago

How it helps: The agent knows which libraries and approaches are preferred in your project.

Procedural Memory

What it stores: How to accomplish common tasks in your project

Example:

Procedure: "Adding a new database model"
Steps:
1. Create model file in src/models/
2. Define schema with Mongoose
3. Add TypeScript interface
4. Export from models/index.ts
5. Create corresponding service
Success rate: 100% (12 successful uses)

How it helps: The agent can execute multi-step workflows automatically based on proven procedures.


Learning in Action

Scenario: Your First API Endpoint

Task 1: Creating Users Endpoint (Your first time)

You: "Create a CRUD API for users"

Agent: "I'll create the user API. A few questions:
- What fields should the user model have?
- Which HTTP methods? (GET, POST, PUT, DELETE?)
- What validation should I add?
- Which authentication method?
- What response format do you prefer?"

[You provide answers]

Agent: [Creates endpoint with multiple approval requests]
Time: 10 minutes
Approvals needed: 6

What the agent learned:

  • User model structure
  • Your preferred REST patterns
  • Authentication approach
  • Error handling style
  • Response format
  • Validation patterns

Task 2: Creating Posts Endpoint (One week later)

You: "Create a CRUD API for posts"

Agent: "I'll create the posts API following the same pattern as your users API.

Planned structure:
- Model: src/models/Post.ts (matching User.ts structure)
- Routes: src/routes/posts.ts
- Controller: src/controllers/posts.controller.ts
- Service: src/services/posts.service.ts
- Validation: Using Joi schemas like in users
- Auth: JWT middleware
- Response format: { success, data } structure

Should I proceed?"

[You approve]

Agent: [Creates complete CRUD API]
Time: 3 minutes
Approvals needed: 1 (initial approval)

What the agent remembered: ✅ Your project structure ✅ File naming conventions ✅ Joi for validation ✅ JWT authentication ✅ Response format ✅ Error handling patterns


Task 3: Creating Comments Endpoint (One month later)

You: "Add comments API"

Agent: [Works autonomously, high confidence]

"Created comments API with:
✅ Full CRUD operations
✅ Nested under posts (/posts/:postId/comments)
✅ Author validation (users can only edit own comments)
✅ Joi validation for input
✅ JWT authentication
✅ Pagination (50 per page, matching your other endpoints)
✅ Full test coverage (35 test cases)
✅ OpenAPI documentation

All tests passing. Ready for review."

Time: 2 minutes
Approvals needed: 0 (autonomous execution)

What the agent inferred: ✅ Comments belong to posts (relationship) ✅ Need author ownership validation ✅ Should use pagination ✅ Your preferred page size (50) ✅ Test coverage expectations ✅ Documentation requirements


Confidence Levels

The agent tracks confidence for different tasks:

Low Confidence (< 0.6)

Agent behavior:

  • Asks many questions
  • Requests approval frequently
  • Provides multiple options
  • Explains reasoning

When this happens:

  • New technology or library
  • First time implementing a pattern
  • Complex or ambiguous requirements
  • High-risk operations

Medium Confidence (0.6 - 0.8)

Agent behavior:

  • Proposes approach
  • Requests approval for changes
  • Explains key decisions

When this happens:

  • Similar to past tasks but with variations
  • Using familiar technologies in new ways
  • Moderate complexity tasks

High Confidence (> 0.8)

Agent behavior:

  • Works autonomously
  • Minimal approval requests
  • Fast execution
  • Detailed completion reports

When this happens:

  • Nearly identical to past successful tasks
  • Well-established patterns
  • Routine operations
  • Safe, reversible changes

Watching the Agent Learn

Progress Indicators

In Chat, you'll see learning happen:

🧠 Learning: Extracted pattern "form_validation_with_yup"
📊 Confidence improved: TypeScript refactoring (0.75 → 0.82)
✨ New knowledge: Project uses Tailwind for styling
🎯 Strategy refined: "Test-first approach" success rate now 94%

In Settings Panel

View Learning Stats:

  • Patterns learned: 45
  • Knowledge items: 234
  • Success rate: 91%
  • Confidence calibration: 0.89
  • Tasks completed: 328

How to Accelerate Learning

1. Provide Explicit Feedback

Good:

"Perfect! That's exactly the pattern we use. Please apply this same
approach to all similar components."

Also Good:

"Not quite. In our project, we always put validation logic in separate
middleware files, not inline in the routes."

2. Show Examples

You: "@src/components/Button.tsx This is our standard component pattern.
     Use this structure when creating new components."
Agent: "Got it! I'll use this as the template for components:
       - PropTypes at top
       - Styled components below
       - Component with destructured props
       - Export with display name
       Confidence for component creation: 0.95"

3. Confirm Successful Patterns

You: "Great work on that API endpoint. Use this exact pattern for all
     future endpoints."
Agent: "Recorded as preferred pattern for API endpoints.
       Confidence: 0.95
       Will apply automatically to similar tasks."

4. Correct Mistakes Explicitly

You: "That works, but we don't use `any` types. Always define proper
     interfaces, even if it takes more time."
Agent: "Understood. Updated knowledge:
       - Never use `any` type
       - Always create proper TypeScript interfaces
       - Prioritize type safety over speed
       Will apply to all future code."

5. Reference Past Work

You: "Create an orders API similar to what we did for users in Task #47"
Agent: "Referencing Task #47... Found successful user API implementation.
       I'll replicate the structure, validation, and error handling."

Privacy and Data

What's Stored

✅ Stored Locally:

  • Task history
  • Learned patterns
  • Code examples from your project
  • Success/failure metrics
  • Configuration preferences

❌ Never Sent Elsewhere:

  • Your source code
  • Learned patterns
  • Project structure
  • Business logic

☁️ Optional Cloud Sync: If you enable workspace collaboration:

  • Shared task history with team
  • Collaborative learning
  • Workspace-specific patterns

Data Control

You control everything:

  • View all learned patterns (Settings → Learning)
  • Delete specific knowledge items
  • Clear all learning data
  • Export/import learned patterns
  • Disable learning entirely

Learning Limitations

What the Agent Can Learn

✅ Code patterns and conventions ✅ Project structure preferences ✅ Library and framework usage ✅ Error handling approaches ✅ Testing patterns ✅ Documentation styles ✅ API design patterns

What the Agent Cannot Learn (Yet)

❌ Business domain knowledge ❌ Company-specific requirements ❌ Security policies (must be explicitly configured) ❌ Performance budgets ❌ Deployment procedures ❌ Team workflows

For these, you need to provide explicit instructions or configuration.


Troubleshooting Learning

"Agent Isn't Learning My Patterns"

Check:

  1. Is learning enabled? (Settings → Experimental → Learning Engine)
  2. Have you completed enough similar tasks? (Needs 3-5 examples)
  3. Are patterns consistent? (Inconsistent patterns confuse learning)

Try:

  • Explicitly tell the agent: "Remember this pattern"
  • Show multiple examples of the same pattern
  • Confirm when agent uses patterns correctly

"Agent Learned the Wrong Pattern"

Fix:

  1. Correct it explicitly in chat
  2. Go to Settings → Learning → View Patterns
  3. Find the incorrect pattern
  4. Delete or edit it
  5. Provide correct examples

"Agent Is Too Confident / Not Confident Enough"

Adjust:

  • Settings → Advanced → Confidence Threshold
  • Lower threshold = more autonomous
  • Higher threshold = more conservative

Best Practices

1. Be Consistent

Maintain consistent patterns in your own code. Inconsistency confuses the learning system.

2. Confirm Successes

When the agent does something well, confirm it:

"Perfect! That's exactly how we do it."

3. Correct Early

If the agent learns something incorrect, fix it immediately:

"That works but isn't our standard. We always..."

4. Provide Context

Help the agent understand WHY certain patterns are used:

"We use this validation pattern because it provides better error messages
to users and is easier to test."

5. Review Periodically

Check learned patterns monthly:

  • Settings → Learning → View Patterns
  • Delete outdated patterns
  • Reinforce current patterns

Future Improvements

Planned enhancements to the learning system:

  • Cross-Project Learning: Transfer patterns between similar projects
  • Team Learning: Share learned patterns across team members
  • Smart Suggestions: Proactive suggestions based on learned patterns
  • Learning Analytics: Detailed insights into what agent has learned
  • Pattern Library: Export/import pattern libraries
  • Learning Goals: Set specific learning objectives for the agent

Summary

The self-learning system transforms Dropstone Agent from a tool into a true coding partner:

Week 1: Helpful assistant that needs guidance Month 1: Knows your project and basic patterns Month 3: Anticipates your needs and works autonomously Month 6+: Expert in your codebase, proactively improving

The more you use Dropstone Agent, the better it becomes at helping you specifically - learning not just to code, but to code the way you want.


Next Steps


Your agent learns from you, but never shares your code or patterns with anyone else. All learning is private and local to your workspace.