A Discord bot that captures, stores, and retrieves team knowledge using Mem0 AI for persistent memory storage.
- Overview
- Features
- System Architecture
- Setup and Installation
- Usage
- Command Examples
- Example Results
- Customization
- Troubleshooting
- Contributing
- License
Team Knowledge Memory Bot transforms team conversations into a searchable knowledge base. It monitors Discord channels, extracts important information, and makes it easily retrievable using natural language queries. By connecting to Mem0 AI's memory system, it provides persistent storage of team knowledge across time.
Built in collaboaration with Bear Brown and Co, and Stellis Labs.
- π€ Automatic Knowledge Extraction: Identifies important information from team conversations
- π§ Cloud-Based Memory Storage: Leverages Mem0 AI for reliable knowledge persistence
- π Vector-Based Semantic Search: Finds information based on meaning, not just keywords
- π Knowledge Classification: Organizes information by type (decisions, blockers, etc.)
- π¬ Natural Language Queries: Ask questions in plain language to retrieve information
- π Context Preservation: Maintains the context in which information was shared
- π Manual Saving: Explicitly save important information with simple commands
The Team Knowledge Memory Bot features a modular architecture with five key components:
- Discord Bot Layer: Handles all user interactions and command processing through Discord.py, managing message events and command routing.
- Knowledge Processing Pipeline: Extracts and classifies important information from messages, turning unstructured conversations into structured data.
- Memory System: Integrates with Mem0 AI to provide persistent storage of team knowledge with contextual metadata.
- Vector Search Engine: Enables semantic search capabilities through either Pinecone (cloud-based) or an in-memory implementation.
- Query Engine: Processes natural language questions, retrieves relevant information, and generates concise, informative responses.
This design prioritizes modularity and extensibility, allowing components to be developed and tested independently while maintaining clean interfaces between layers.
- Python 3.10 or higher
- A Discord bot token (from Discord Developer Portal)
- A Mem0 AI API key
- [Optional] A Pinecone API key for enhanced vector search
Clone the repository:
git clone https://github.com/rkarwankar/team-memory-bot
cd team-memory-botCreate a virtual environment:
python -m venv venvvenv\Scripts\activatesource venv/bin/activateInstall dependencies:
pip install -r requirements.txtCreate a .env file with your configuration:
# Discord Configuration
DISCORD_BOT_TOKEN=your_discord_bot_token_here
DISCORD_GUILD_ID=your_guild_id_here
MONITORED_CHANNELS=123456789012345678,234567890123456789
# Mem0 Configuration
MEM0_API_KEY=your_mem0_api_key_here
# Vector Database (Choose one)
VECTOR_DB=in_memory # or "pinecone"
# If using Pinecone
PINECONE_API_KEY=your_pinecone_api_key_here
PINECONE_ENVIRONMENT=your_pinecone_environment
PINECONE_INDEX_NAME=team-memoryInvite the bot to your server using the OAuth2 URL generator in the Discord Developer Portal (require bot permissions including read/send messages)
team-memory-bot/
βββ .env
βββ .gitignore
βββ README.md
βββ requirements.txt
βββ src/
β βββ __init__.py
β βββ main.py
β βββ config.py
β βββ bot/
β β βββ __init__.py
β β βββ client.py
β β βββ commands.py
β β βββ listeners.py
β βββ preprocessing/
β β βββ __init__.py
β β βββ extractor.py
β β βββ classifier.py
β βββ memory/
β β βββ __init__.py
β β βββ mem0.py
β β βββ vector_store.py
β βββ query_engine/
β β βββ __init__.py
β β βββ engine.py
β β βββ rag.py
β βββ utils/
β βββ __init__.py
β βββ helpers.py
βββ tests/
βββ __init__.py
βββ test_memory.py
Run the bot:
python src/main.py/help_memory- Show help information/save [type] [content]- Manually save knowledge/recent [type] [limit]- Show recent memories/ask [question]- Ask a question about team knowledge
decisionblockerstatus_updatemilestonequestionanswer
/save decision We've decided to use React Native for our mobile app...
/save blocker The integration with the third-party analytics service is blocked...
/save status_update The notification system refactoring is now 80% complete...
/save milestone We've successfully completed the beta launch...
/recent 5
/recent decision 3
/ask What technology are we using for the mobile app?
/ask What's blocking the analytics integration?
/ask What's the status of the notification system?Team.Memory.Bot.Demo.mp4
Update MONITORED_CHANNELS in .env
- In-Memory (default):
VECTOR_DB=in_memory
- Pinecone (production):
VECTOR_DB=pinecone PINECONE_API_KEY=your_pinecone_api_key PINECONE_ENVIRONMENT=your_environment PINECONE_INDEX_NAME=team-memory
Modify generate_rag_response in src/query_engine/rag.py
- Check bot token
- Verify permissions
- Check monitored channels
- Review console output
- Check Mem0 API key
- Verify memory entries
- Review logs
- Test with simple queries
- Check Pinecone credentials
- Validate vector embeddings
- Switch to in-memory store for testing
Contributions are welcome!
- Fork the repo
- Create your feature branch
- Commit changes
- Push to GitHub
- Open a Pull Request
MIT License. See LICENSE file for details.