Skip to content

Go-based framework for interruptible multi-agent AI assistants with memory, RAG, and voice

Notifications You must be signed in to change notification settings

disciplinedware/digitwin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

DigiTwin

A production-grade Go framework for text and voice AI assistants — with interruptible multi-agent workflows, real-time orchestration, hierarchical memory/RAG, queue-backed execution, multi-tenancy, and Stripe-based monetization.

What DigiTwin is for

Most “AI chatbot” and agent systems are built on low-code flow editors or Python scripts: state is fragile, flows are not reusable, deployments are ad-hoc, and long-running or interruptible workflows are not supported.

DigiTwin is a backend framework for teams that need reliable, stateful, configurable, and scalable AI assistants running in real production environments. It unifies Telegram and voice interfaces, multi-agent workflows, hierarchical memory, background jobs, and billing into a coherent runtime.

Multi-Tenant, Configurable Core

  • Organizations, bots, workflows, agents, personas, chats, memory banks modeled as catalogs in Postgres
  • Versioned JSONB settings define prompts, LLMs, voice modes, quotas and behavior
  • Runtime picks up configuration changes automatically — no redeploys needed
  • Multiple organizations and bots run on a shared infrastructure with isolated policies

Multi-Agent Runtime

  • Agents are modular components (router, tool-using agent, summarizer, validator, sales dialog, etc.)
  • Workflows define agent ordering, transitions and conditions
  • Personas encode assistant behavior and constraints
  • Deterministic, concurrency-safe execution designed for large parallel workloads

Messaging & Channels

  • Normalized pipeline: Telegram → Processor → Workflow → Agents → Memory → Reply
  • Persistent models for users, chats, bots, states
  • Multi-step dialogs, guided flows, controlled transitions
  • Telegram-based admin console: unified view of all conversations for monitoring and manual actions
  • Voice integrations:
    • OpenAI Realtime for low-latency voice I/O
    • SIP outbound calling via worker pipelines
  • Same workflow/agent abstractions across text and voice

Memory & RAG

  • Three memory layers:
    • organization ROM (shared knowledge)
    • persona long-term memory
    • chat RAM (session state)
  • Embeddings generated by local lightweight models or remote LLMs
  • Background memory manager updates vectors continuously
  • Simple store/search APIs enable RAG and personalization without embedding-coupled business logic

Interruptible Execution

  • New messages arriving mid-workflow cancel the in-flight LLM step
  • Conversation state is updated and workflow restarts with the latest context
  • Assistant reacts to current intent, not outdated intermediate messages
  • Critical for responsive chat UX and real-time voice interactions

Queues, Scheduling, Recovery

  • All heavy processing executed by a persistent, queue-backed worker system
  • Durable asynchronous tasks with scheduling, retries, backoff
  • Worker pools configurable per task type
  • Safe restarts: tasks resume automatically
  • Idempotency where needed; failures are observable, not silent
  • Suitable for long-running production workloads rather than stateless LLM wrappers

Operations, Payments, Observability

  • Stripe for payments, subscriptions, usage quotas
  • Structured logging, Sentry, Loki labels, health endpoints
  • Environment-based secret management compatible with any secret store
  • Docker-based environments for local and production deployment
  • Postgres as the primary data store (tenants, configuration, state, queues, memory)
  • Extend behavior by configuring new organizations/bots/workflows, not rewriting backend code

Documentation & Examples

Contact

For collaboration or enterprise integration: [email protected]
Maintainer: Konstantin Truninhttps://www.linkedin.com/in/ktrunin

About

Go-based framework for interruptible multi-agent AI assistants with memory, RAG, and voice

Resources

Stars

Watchers

Forks