Telegram bot with pharmaceutical sales system, multiple interface support and local Ollama AI.
Demonstrates capabilities:
├── data/
│ └── products.json # Pharmaceutical products
├── src/
│ ├── config/
│ │ ├── hono.ts # Hono web config
│ │ ├── logger.ts # Logging setup
│ │ ├── swarm.ts # Swarm config
│ │ └── tf.ts # TensorFlow config
│ ├── logic/
│ │ ├── agent/ # Sales and triage agents
│ │ ├── completion/ # Ollama completion
│ │ ├── embedding/ # Ollama embeddings
│ │ ├── storage/ # Pharma storage
│ │ └── swarm/ # Root swarm
│ ├── main/
│ │ ├── hono.ts # Web server
│ │ ├── repl.ts # REPL interface
│ │ └── telegram.ts # Telegram bot
│ └── utils/
│ └── getChatData.ts # Chat utilities
├── public/
│ └── index.html # Web interface
└── logs/ # Application logs
# Install Ollama
curl https://ollama.ai/install.sh | sh
# Download model
ollama pull llama2
# Install dependencies
bun install
# Start Telegram bot
bun run src/main/telegram.ts
# Start Web server (optional)
bun run src/main/hono.ts
# Start REPL (optional)
bun run src/main/repl.ts
Create a .env
file:
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
OLLAMA_API_URL=http://localhost:11434
OLLAMA_MODEL=llama2
WEB_PORT=3000
/newbot
.env
Open http://localhost:3000
for web version
Interactive command line for testing
{
"name": "Аспирин",
"category": "Обезболивающие",
"price": 25.50,
"description": "От головной боли и температуры",
"contraindications": ["Язва желудка", "Беременность"],
"dosage": "1-2 таблетки 3 раза в день"
}
Telegram Bot ←→ Agent Swarm ←→ Ollama
Web Interface ←→ ↑ ←→ Storage
REPL Console ←→ ↓ ←→ Embeddings
Ideal for:
Can be extended with: