DEV Community

RagLeap
RagLeap

Posted on

I Made My AI Manager Work Across Telegram, WhatsApp, Web, and Phone Call — With Shared Memory

The hardest part of building RagLeap wasn't the RAG pipeline or the voice integration. It was making the owner's AI Manager feel like ONE continuous brain across four completely different channels.
Here's how I solved it.
The problem
An owner starts a conversation on Telegram: "Connect my PostgreSQL database."
Then the next day they call the Twilio number and say: "What automations did you suggest for my database?"
The voice call should remember the Telegram conversation. They're the same person. One memory.
The solution: ManagerConversation
pythonclass ManagerConversation(models.Model):
workspace = models.OneToOneField(Workspace, ...)
user = models.ForeignKey(User, ...)
# Persistent memory across ALL platforms

class ManagerMemory:
def add_action(self, action, platform, result, params):
# Stores what was done and on which platform

def add_knowledge(self, fact, source, confidence, tags):
    # Stores facts learned about the business

def search_actions(self, action_type=None, limit=20):
    # Retrieve relevant past actions for context
Enter fullscreen mode Exit fullscreen mode

Every action the Manager takes — configuring WhatsApp, connecting a database, sending an email — gets stored with platform context. The next conversation starts with this memory loaded.
Platform routing
python# Telegram handler
@csrf_exempt
def telegram_personal_bot_webhook(request):
message = extract_telegram_message(request)
response = process_manager_message(
workspace=workspace,
message=message,
platform='telegram',
memory=load_manager_memory(workspace)
)
send_telegram_reply(response)

Voice handler

def owner_voice_inbound(request):
speech = request.POST.get('SpeechResult')
response = process_manager_message(
workspace=workspace,
message=speech,
platform='voice',
memory=load_manager_memory(workspace) # Same memory!
)
return twiml_say(response)
Same process_manager_message. Same memory. Different input/output format.
The system prompt
The Manager AI has a ~7,500 token system prompt that includes:

Current workspace status (documents, channels, credits)
Recent actions from memory
Known facts about the business
Full list of 50+ executable actions

This makes every conversation context-aware without any manual session management.
What this enables
Owner on Telegram: "Set up order status checker on WhatsApp"
→ Manager connects DB, generates SQL, deploys to WhatsApp
Next day, owner calls:
→ "Did my WhatsApp automation get deployed?"
→ Manager: "Yes, I deployed order status checker to WhatsApp yesterday at 2:34 PM. 12 customers have used it."
One brain. Four channels.
ragleap.com

Top comments (0)