CabreraDTM/repdix-telegram-database-bot
About
Repdix Telegram Database Bot - Community-Driven SQL Orchestrator with Local LLM Power
Data & AnalyticsWhat you can do
- 🗣️ Ask in plain language, get real answers — Type a question the way you'd say it out loud, and Repdix turns it into a working SQL query, runs it, and explains the result in a friendly, readable reply. No query syntax memorized, no dashboards to click through.
- 🔌 One bot, many databases — MySQL, PostgreSQL, and SQLite all live happily side by side. Switch between them with a quick command and keep your whole data landscape a single chat away.
- 🧠 Your own local brainpower — Powered by local models through LM Studio or Ollama, so your data never has to leave your machine to get an answer. Point it at the model you trust and let it think.
- 🛠️ Smart tool calling — The model doesn't just guess — it knows when to reach for the database, builds the query, checks it, and brings back the goods. It's a genuine assistant, not a fancy search box.
Measured star growth
- in 24h
- -45
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalRepdix is a community-driven Telegram bot that turns plain-language questions into real answers from your MySQL, PostgreSQL, or SQLite databases — no SQL expertise needed. It runs entirely on local LLMs through LM Studio or Ollama, complete with Tool Calling and a full audit trail, so your data stays close to home. Built with an open, extensible architecture, it welcomes contributors and tinkerers alike to shape where the project goes next.
📋 System Requirements
- Windows 10 or Windows 11
- PowerShell 5.1 or newer (already available on Windows)
- Active network connection
- No admin rights needed
Features
Here's what makes Repdix a joy to use every day:
🗣️ Ask in plain language, get real answers — Type a question the way you'd say it out loud, and Repdix turns it into a working SQL query, runs it, and explains the result in a friendly, readable reply. No query syntax memorized, no dashboards to click through.
🔌 One bot, many databases — MySQL, PostgreSQL, and SQLite all live happily side by side. Switch between them with a quick command and keep your whole data landscape a single chat away.
🧠 Your own local brainpower — Powered by local models through LM Studio or Ollama, so your data never has to leave your machine to get an answer. Point it at the model you trust and let it think.
🛠️ Smart tool calling — The model doesn't just guess — it knows when to reach for the database, builds the query, checks it, and brings back the goods. It's a genuine assistant, not a fancy search box.
🛡️ Guardrails that respect your data — Read-only validation, SQL auditing, and security logging mean curious questions never turn into accidental changes. Peace of mind is built in, not bolted on.
📚 Context that remembers — Conversations are cached and carried across restarts, so you can pick up right where you left off. Compact, clear, or inspect your history whenever you like.
🔄 Bring your own models — Swap between models on the fly, list what's available, and tailor the setup to your hardware and your needs — all without touching a config file mid-chat.
🐳 Docker-ready, community-friendly — Spin it up in containers, extend it to new chat platforms through clean adapters, and shape it to fit your workflow. Built by the community, for the community — and genuinely open to everyone who wants to explore their data.
Commands
Here's where Repdix really comes alive. Whether you're a casual explorer or a power user, these commands give you full control over your database conversations — no SQL wizardry required. Type them anytime in the chat, and the bot will pick up on context from your previous messages.
/db— See which database you're currently connected to. Your friendly "you are here" marker./db <name>— Switch to any connection defined indatabases.yaml. MySQL, PostgreSQL, SQLite — Repdix juggles them all./model— Check which LLM is currently doing the thinking for you./model <name>— Swap to a different model frommodels.yaml. Smaller for speed, larger for deeper reasoning — your call./models— Browse every model you have configured, so you always know your options./sql <query>— Run a handcrafted SELECT query yourself (safe, read-only validation applies). Great for when you want precision over conversation./history— Peek at the current conversation history — roles plus the first 200 characters of each message./compact— Ask the LLM to compress your conversation into a tidy summary. Perfect for long sessions where tokens matter./tokens— Get an approximate token count for your current context. Stay lean, stay sharp./clear— Wipe the slate clean — history is cleared from both memory and the Redis-backed store.
✨ Pro tip: Every command plays nicely with the natural-language workflow. Switch databases, change models, then just keep chatting — the bot remembers where you left off (for up to 24 hours, thanks to the Redis context store). The whole point is to keep the community exploring data together, without friction and without barriers.
Configuration
Setting up Repdix is meant to feel like a conversation, not a chore. Everything lives in a handful of friendly YAML files inside config/, and a single .env holds your secrets — no sprawling config mazes, no guesswork. Whether you're wiring up your first SQLite file or juggling MySQL and PostgreSQL side by side, the structure stays the same, so your muscle memory carries over.
🗂️ The config folder at a glance
databases.yaml— describe each connection (type, host, port, credentials, database, and whether it's read-only). Point Repdix at as many as you like and swap between them on the fly with/db <name>.models.yaml— list the local models you want to talk to (LM Studio, Ollama, or any compatible endpoint) and pick one with/model <name>. The full menu is always a/modelsaway.relations.yaml— optional, but beloved by the community. Add foreign keys and business notes so the assistant understands how your tables relate, and watch complex questions get sharper answers.users.yaml— optional allow-list for keeping your instance in trusted hands.
🔐 Environment variables
Keep your tokens and passwords out of the config files and let .env do the heavy lifting — the bot reads it automatically on startup. A typical setup includes your Telegram token, an allow-list of user IDs, the adapter you want to run (cli for local tinkering, telegram for the real deal), any database passwords referenced from databases.yaml, and your Redis host and port.
🧠 Context and caching
Conversation history is remembered per user and mirrored into Redis with a 24-hour lifetime, so a restart won't wipe the thread you were in the middle of. If Redis isn't reachable, Repdix keeps working gracefully — it simply forgets between restarts and logs the hiccup instead of falling over. Tune how much history is carried forward, and lean on /compact and /clear whenever you want a fresh slate or a lighter token bill.
🐳 Docker, when you want it
The included Docker setup bundles the app and Redis together, so one compose file gives you a self-contained stack. Prefer to run things bare-metal? The local start script gets you going just as happily. Either path reads the same config/ and .env, so you can hop between them without rewriting anything.
💡 Community tips worth stealing
Start with one database and one model, then grow. Keep readonly: true on anything you don't want touched. When a query comes back oddly, add a note to relations.yaml — it's the single most underrated file in the project. And if you discover a configuration trick that makes your life easier, share it — the best parts of Repdix's setup guide started life as a fellow user's late-night discovery.
FAQ
Q: Do I need a powerful machine to run Repdix? Not at all — Repdix is built to be lightweight and welcoming. You can run it on modest hardware with a small local model through LM Studio or Ollama, and scale up to bigger models whenever you want richer analysis. The bot adapts to whatever resources you have available.
Q: Which databases are supported?
Right now Repdix speaks fluently with MySQL, PostgreSQL, and SQLite. You describe each connection in config/databases.yaml, and the bot builds a schema map automatically so the LLM understands your tables, columns, and relationships.
Q: Can I trust it with my data?
Absolutely — safety is baked in. Every generated query passes through a strict validator that permits only read-style statements, and anything suspicious lands in logs/security.log. You can also keep a curated allow-list of users in config/users.yaml so only trusted folks ever reach the database.
Q: What happens to my conversation history? History is kept in Redis for a full day, so the bot remembers your context even if it restarts. You stay in control with a friendly command set: peek at what's stored, compress it into a tidy summary, check your token footprint, or wipe it clean whenever you like.
Q: Do I have to use a specific LLM provider? No lock-in here. Repdix works with anything OpenAI-compatible, so LM Studio, Ollama, and OpenRouter all play nicely. Swap between them on the fly with a quick model switch — perfect for experimenting with different sizes and styles.
Q: Why does the bot sometimes miss the mark on tricky analytical questions?
Smaller local models shine at straightforward lookups but can wobble on multi-step reasoning. If you need deeper insight, try a larger model or enrich config/relations.yaml with business notes and foreign-key hints — the extra context works wonders.
Q: My database has dozens of tables — will the prompt explode? For very large schemas, the auto-generated description can get lengthy. A handy tip: trim the schema snapshot to the tables you actually query most, or split work across multiple named connections. Keeps things snappy and focused.
Q: What if Redis isn't running? No drama — the bot simply carries on without persistent memory between restarts. Errors get logged quietly in the background rather than crashing anything, so you can still chat with your data uninterrupted.
Q: Is Repdix open to community contributions? Wholeheartedly yes! This project grows through shared ideas, bug reports, and pull requests. Whether you're polishing docs, adding a new adapter, or suggesting a clever workflow, your voice shapes where Repdix goes next. Jump in and make it yours.
Support
Support
We're building Repdix together with you, and the community is what keeps it evolving. Every bit of feedback, every question, and every idea helps shape what comes next.
💬 Where the conversation happens
- Telegram community chat — the liveliest place to ask quick questions, share your setup, or just hang out with other Repdix users. Drop in, say hi, and see how others are wiring the bot into their own workflows.
- Discussion threads — got a broader idea, a feature request, or an interesting use case worth mapping out? Start a thread so we can talk through it together.
- Issue tracker — if something's broken or behaving oddly, this is the place to flag it. A short description of the steps that triggered it goes a long way toward a speedy fix.
🐛 Reporting bugs the friendly way
A great report makes half the work disappear. When you file something, include:
- What you expected — the outcome you had in mind.
- What actually happened — the surprising result, with any relevant log lines from
logs/. - Your environment — which adapter (Telegram or CLI), which database flavour (MySQL, PostgreSQL, SQLite), and which model you had loaded.
- A minimal example — the smallest prompt or command sequence that reproduces it.
If you're sharing config snippets or query text, give sensitive values a quick scrub first: tokens, passwords, table names you'd rather keep private. Safety first, always.
✨ Feature ideas & feedback
Repdix is meant to feel like a natural extension of your data — and that means the roadmap belongs to you. Whether it's support for a new database engine, a smarter context workflow, a nicer audit log format, or just a tweak that would make your daily routine smoother, we want to hear it. Post it in the discussion threads or open an issue tagged as an enhancement.
🌱 Contributing
You don't need to be a seasoned developer to make an impact:
- Translate or clarify docs — if a section of the README tripped you up, improving it for the next person is a real contribution.
- Share clever prompts and workflows — the best ideas often come from real usage. Show us how you're getting the most out of Repdix.
- Test the latest changes — early eyes catch early issues. Running through new builds with your own databases surfaces edge cases we might miss.
- Tune models and configs — if you find a model that nails Tool Calling on your hardware, or a
relations.yamlpattern that helps the bot reason about complex schemas, tell us about it.
For code contributions, please keep the project's structure in mind: business logic stays in app/core/, messenger-specific code in app/interfaces/. The ports-and-adapters pattern isn't just style — it's how Repdix stays flexible across chats and databases. A quick note in the discussion threads before a larger change saves everyone a round of rework.
⏱️ What to expect from us
We're a small, community-minded crew, so replies might take a bit — but nothing gets ignored. Confirmed bugs get prioritised, thoughtful feature requests get discussed openly, and every contributor gets a friendly nod in the changelog.
💙 Thank you
Repdix exists because people like you showed up, asked good questions, and pushed it further than we could have on our own. Whether you're a first-time user or a regular in the chat, your presence makes this project better. Welcome aboard — we're glad you're here.
This project follows the spirit of the MIT License: it's open, accessible to everyone, and built to be shared. See the LICENSE section for the full details.
License
This project is released under the MIT License, so you're welcome to use, adapt, and build on Repdix in your own setups — whether that's a small personal deployment or a larger community-driven rollout. We believe in keeping the door open: the source is available for anyone to inspect, extend, and shape to their needs.
In practice, that means you can spin up Repdix for your, tailor the LLM prompts to your schema, add new database adapters, or wire it into your own tooling without asking permission. If you improve something, we'd love to hear about it — pull requests and thoughtful feedback are what keep the project moving forward.
A few friendly expectations:
- Keep the copyright notice. If you redistribute Repdix or a substantial portion of it, please carry the original MIT notice along with your copy.
- No warranty. Repdix is provided as-is. We test it, we use it, but we can't guarantee it'll be a perfect fit for every environment — especially since it can execute SQL against your databases. Review the validator, scope your read-only credentials carefully, and treat your data with the care it deserves.
- Attribution is appreciated, not mandatory. If you fork it or build something cool on top of it, mentioning the original project is a nice gesture, though the license doesn't require it.
The spirit here is simple: build freely, share generously, and help make Repdix better for everyone who picks it up next.
Explore related projects
Loading…

