laplaced

module
v0.1.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2025 License: MIT

README

Laplaced

Go Report Card

English | Русский

A smart Telegram bot for family use. Powered by Google Gemini via OpenRouter.

What it does:

  • Chats using LLM with long-term memory (RAG)
  • Transcribes voice messages (Yandex SpeechKit)
  • Understands images and PDFs
  • Has a web dashboard for stats

Quick Start

Requirements: Go 1.24+, Docker (optional)

git clone https://github.com/runixer/laplaced.git
cd laplaced

# Option 1: Docker
cp .env.example .env
# Edit .env with your tokens
docker-compose up -d --build

# Option 2: Local
go run cmd/bot/main.go

# With custom config file
go run cmd/bot/main.go --config /path/to/config.yaml

Configuration

Two ways to configure:

  1. Environment variables (recommended) — copy .env.example to .env
  2. YAML config — see internal/config/default.yaml for all options

Key variables:

LAPLACED_TELEGRAM_TOKEN=your_bot_token
LAPLACED_OPENROUTER_API_KEY=your_api_key
LAPLACED_ALLOWED_USER_IDS=123456789,987654321

Telegram Modes

Two modes available:

  • Long Polling (default) — simpler, works behind NAT, no public URL needed
  • Webhook — lower latency, better for production
# For webhook mode, set public URL:
LAPLACED_TELEGRAM_WEBHOOK_URL=https://your-domain.com/webhook

Voice Messages

The bot transcribes voice messages using Yandex SpeechKit. To enable:

LAPLACED_YANDEX_API_KEY=your_key
LAPLACED_YANDEX_FOLDER_ID=your_folder_id

Without these — voice messages are ignored.

Debug Interface

There's a built-in web UI for debugging. Disabled by default.

To enable:

LAPLACED_WEB_ENABLED=true
LAPLACED_WEB_PASSWORD=your_password  # if not set — random password is generated

Useful for understanding how RAG works, inspecting memory, and debugging.

⚠️ Warning: The interface exposes sensitive data — conversation history, extracted facts, memory contents. Don't expose it publicly.

Project Structure

cmd/bot/          — entry point
internal/bot/     — message handling
internal/rag/     — vector search, memory retrieval
internal/memory/  — facts extraction
internal/storage/ — SQLite

Contributing

See CONTRIBUTING.md. PRs welcome!

License

MIT — see LICENSE.

Directories

Path Synopsis
cmd
bot command
import_history command
reset_user command
internal
bot
rag
ui
web

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL