A Telegram bot for creating professional notes with AI enhancement, stored in SQLite.
- AI Enhancement: Notes are automatically summarized and tagged using OpenAI-compatible APIs
- Authorized Access: Only specified chat IDs can use the bot
- SQLite Storage: Notes are stored locally in a SQLite database
- Search & Organize: Search notes by content, title, or tags
- Node.js 18+
- Telegram Bot Token (get from @BotFather)
- OpenAI-compatible API endpoint (LM Studio, LiteLLM, etc.)
-
Install dependencies:
npm install
-
Configure the bot: Edit
config/default.json:{ "telegram": { "botToken": "YOUR_BOT_TOKEN" }, "ai": { "endpoint": "http://localhost:1234/v1", "model": "gpt-3.5-turbo", "apiKey": "your-api-key" }, "auth": { "allowedChatIds": ["123456789"] }, "database": { "path": "./database/notes.db" } } -
Start the bot:
npm start
| Command | Description |
|---|---|
/start |
Welcome message |
/help |
Show available commands |
/note <text> |
Create a new note with AI enhancement |
/list |
List all your notes |
/search <query> |
Search notes by title/content/tags |
/delete <id> |
Delete a note by ID |
/tags |
Show all tags you've used |
/note Meeting with team today. Discussed Q4 goals, assigned tasks, and set follow-up for next week.
The bot will respond with:
- Auto-generated title
- AI summary
- Relevant tags
npm testtelegram-notes-bot/
├── src/
│ ├── index.js # Entry point
│ ├── config.js # Configuration loader
│ ├── bot/
│ │ ├── commands.js # Command handlers
│ │ └── middleware.js # Auth middleware
│ ├── services/
│ │ ├── ai.js # AI client
│ │ ├── notes.js # Note operations
│ │ └── database.js # SQLite operations
│ └── utils/
│ └── logger.js
├── tests/ # Test suite
├── config/
│ └── default.json # Configuration
├── database/
│ └── schema.sql # Database schema
└── package.json
MIT