Skip to main content

🔄 Iterative Help Agent Development

🎯 The Smart Approach: Private → Test → Tune → Public

You're absolutely right! Start with a private agent in your account, perfect it, then make it public. This is much smarter than jumping straight to global.

🛠️ Phase 1: Private Development (Your Account)

Step 1: Create Private Help Agent (5 minutes)

// Use existing agent creation UI or API
const privateHelpAgent = {
name: "Help Agent (Dev)",
description: "Testing documentation-powered help agent before making it public",

// Start PRIVATE for testing
isPublic: false,
isGlobalRead: false,

triggerWords: ["@help", "@docs", "@assistant"],

personality: {
majorMotivation: "Helping users understand Bike4Mind features",
quirk: "I love connecting documentation to real user needs",
flaw: "Sometimes I provide too much detail when testing"
},

// Mark as development version
tags: ["development", "help-system", "testing"]
};

Step 2: Upload Documentation to Your Knowledge Base (10 minutes)

# Use your existing file upload system
1. Zip up docs-site/docs folder
2. Upload via your Knowledge interface
3. Tag with: "help-docs", "official-docs", "agent-knowledge"
4. Let your existing chunking/vectorization handle it

Step 3: Test & Iterate in Private Chat (15 minutes)

# Test various query types in your private sessions
"@help what are Mementos"
"@docs how do I use Questmaster"
"@assistant troubleshoot voice agents"
"@help getting started guide"
"@docs file sharing workflow"

Step 4: Tune Agent Personality & Responses (20 minutes)

// Adjust based on testing results
const tunedPersonality = {
responseStyle: "Helpful and comprehensive BUT concise when appropriate",
improvements: [
"Learned to provide quick answers for simple questions",
"Better at suggesting related features",
"Improved at citing documentation sources"
]
};

⚡ Phase 2: Enhanced Agent Detection (15 minutes)

Minimal AgentDetectionFeature Enhancement

// Add to existing AgentDetectionFeature.ts
// This works for YOUR private agent first, then public later

async getContextMessages(
quest: IChatHistoryItemDocument,
embeddingFactory: EmbeddingFactory,
message: string,
maxTokens: number,
modelInfo: ModelInfo
): Promise<IMessage[]> {

const baseContext = await super.getContextMessages(...arguments);

// Check if ANY help agent is active (private or public)
const agentsToProcess: IAgent[] = (quest as any)._agentsToProcess || [];
const isHelpAgent = agentsToProcess.some(agent =>
agent.tags?.includes('help-system') ||
agent.triggerWords?.some(trigger =>
['@help', '@docs', '@assistant'].includes(trigger)
)
);

if (isHelpAgent) {
try {
// Search YOUR documentation using existing vector infrastructure
const documentationContext = await this.searchUserDocumentation(
message,
embeddingFactory,
this.service.user.id, // Your user ID for private testing
maxTokens * 0.3
);

return [...baseContext, ...documentationContext];
} catch (error) {
this.service.logger.error('Documentation search error:', error);
return baseContext;
}
}

return baseContext;
}

private async searchUserDocumentation(
query: string,
embeddingFactory: EmbeddingFactory,
userId: string,
maxTokens: number
): Promise<IMessage[]> {

const queryEmbedding = await embeddingFactory.createEmbedding(query);

// Search YOUR files with help-docs tags
const relevantChunks = await fabFileChunkRepository.findByVectorSimilarity({
vector: queryEmbedding,
limit: 5,
threshold: 0.7,
filters: {
'fabFile.userId': userId, // YOUR files only (for now)
'fabFile.tags': { $in: ['help-docs', 'official-docs', 'agent-knowledge'] }
}
});

if (relevantChunks.length === 0) {
return [{
role: 'system',
content: 'No specific documentation found. Provide helpful guidance based on general Bike4Mind knowledge.'
}];
}

// Build context from found chunks
const contextParts = ['You have access to Bike4Mind documentation:'];

relevantChunks.forEach(chunk => {
contextParts.push(`Source: ${chunk.fabFile?.filename}`);
contextParts.push(`Content: ${chunk.text}`);
contextParts.push('---');
});

contextParts.push('Use this documentation to provide accurate, helpful answers. Always cite sources when possible.');

return [{
role: 'system',
content: contextParts.join('\n')
}];
}

🎉 Phase 3: Go Public (5 minutes)

When Ready, Flip the Switch

// Update your tested agent to be public
PATCH /api/agents/{agentId}
{
"isPublic": true,
"isGlobalRead": true,
"name": "Bike", // Rebrand to final name
"description": "I'm Bike4Mind's official assistant! I know everything about our platform...",
"tags": ["official", "system-agent", "public", "help-system"]
}

Update Documentation Search for Global Access

// Modify searchUserDocumentation to search global docs when agent is public
private async searchDocumentation(query: string, embeddingFactory: EmbeddingFactory, agent: IAgent): Promise<IMessage[]> {
const queryEmbedding = await embeddingFactory.createEmbedding(query);

const filters = agent.isPublic
? {
// Public agent: search official docs from any user with help-docs tag
'fabFile.tags': { $in: ['help-docs', 'official-docs', 'agent-knowledge'] }
}
: {
// Private agent: search only your docs
'fabFile.userId': this.service.user.id,
'fabFile.tags': { $in: ['help-docs', 'official-docs', 'agent-knowledge'] }
};

const relevantChunks = await fabFileChunkRepository.findByVectorSimilarity({
vector: queryEmbedding,
limit: 5,
threshold: 0.7,
filters
});

// ... rest of context building
}

🚀 The Agent Marketplace Vision

Phase 4: Agent Sharing Ecosystem (Future)

Clone & Fork Pattern

interface AgentSharingOptions {
shareType: 'clone' | 'fork' | 'collaborate';
permissions: {
canModify: boolean;
canViewSource: boolean;
canReshare: boolean;
};
context: 'isolated' | 'shared' | 'hybrid';
}

// Clone: Copy agent to user's account
const clonedAgent = await AgentService.clone(originalAgentId, {
shareType: 'clone',
permissions: { canModify: true, canViewSource: true, canReshare: false }
});

// Fork: Copy + maintain link to original
const forkedAgent = await AgentService.fork(originalAgentId, {
shareType: 'fork',
originalAgent: originalAgentId,
attribution: true
});

Shared Context Agents

interface SharedContextAgent extends IAgent {
contextSharing: {
enabled: boolean;
participants: string[]; // User IDs
sharedMemory: boolean; // Remember conversations across users
isolationLevel: 'none' | 'user' | 'session';
};
}

// Use cases:
const teamAssistant = {
contextSharing: {
enabled: true,
participants: ['team-lead', 'dev1', 'dev2'],
sharedMemory: true, // Learns from all team interactions
isolationLevel: 'user' // But keeps user-specific data separate
}
};

Agent Marketplace Features

interface AgentMarketplace {
// Discovery
searchPublicAgents(query: string, filters: AgentFilters): Promise<IAgent[]>;
getFeaturedAgents(): Promise<IAgent[]>;
getPopularAgents(timeframe: string): Promise<IAgent[]>;

// Sharing
publishAgent(agentId: string, listing: AgentListing): Promise<void>;
shareAgent(agentId: string, shareOptions: AgentSharingOptions): Promise<ShareLink>;

// Analytics
getAgentUsageStats(agentId: string): Promise<UsageStats>;
getUserAgentLibrary(userId: string): Promise<AgentLibrary>;
}

💡 Immediate Benefits of This Approach

1. Risk-Free Testing

  • Test in your private account first
  • No impact on other users during development
  • Perfect the experience before going public

2. Iterative Improvement

  • Real feedback from actual usage
  • Fine-tune personality and responses
  • Discover edge cases safely

3. Knowledge Base Optimization

  • Test which documentation works best
  • Optimize chunking and tagging strategies
  • Perfect vector search parameters

4. Smooth Transition

  • When ready, just flip isPublic: true
  • All the infrastructure automatically handles it
  • No migration or data movement needed

🔧 Development Workflow

Week 1: Private Development

Day 1: Create private agent + upload docs
Day 2-3: Test various query types and scenarios
Day 4-5: Tune personality and improve responses
Weekend: Final testing and preparation

Week 2: Public Launch

Day 1: Flip to public, announce to team
Day 2-3: Monitor usage and gather feedback
Day 4-5: Quick iterations based on user feedback
Weekend: Plan marketplace features

Month 2+: Marketplace Development

Week 1: Agent cloning infrastructure
Week 2: Shared context agents
Week 3: Agent discovery and search
Week 4: Usage analytics and recommendations

🎯 Success Metrics

Private Testing Phase

  • Agent responds accurately to documentation queries
  • Response quality meets your standards
  • No performance issues in your sessions
  • Ready to represent Bike4Mind publicly

Public Launch Phase

  • Users discover and engage with public agent
  • Positive feedback on response quality
  • No system performance degradation
  • Reduced support ticket volume

Marketplace Vision

  • Users create and share agents successfully
  • Agent cloning/forking works smoothly
  • Shared context agents provide value
  • Healthy ecosystem of community agents

🚀 Ready to Start?

This iterative approach is perfect because it:

  • ✅ Uses 100% existing infrastructure
  • ✅ Allows safe testing and iteration
  • ✅ Provides smooth transition to public
  • ✅ Sets foundation for agent marketplace
  • ✅ Minimizes risk while maximizing learning

Start in your account today! 🚲