AIMQ (AI Message Queue) is a robust message queue processor designed specifically for Supabase's pgmq integration. It provides a powerful framework for processing queued tasks with built-in support for AI-powered document processing and OCR capabilities.
- Supabase pgmq Integration: Seamlessly process messages from Supabase's message queue
- Document OCR Processing: Extract text from images using EasyOCR
- Queue-based Processing: Efficient handling of document processing tasks
- AI-powered Analysis: Leverage machine learning for advanced text analysis
- Flexible Architecture: Easy to extend with new processing tools and capabilities
This project uses Poetry for dependency management. To get started:
# Install Poetry if you haven't already
curl -sSL https://install.python-poetry.org | python3 -
# Clone the repository
git clone <your-repo-url>
cd aimq
# Install dependencies
poetry install
- Create a
.env
file in the project root:
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
QUEUE_NAME=your_queue_name
- Configure your Supabase project with pgmq following the official documentation.
- Start the processor:
poetry run python -m aimq.processor
- Process documents by adding messages to your Supabase queue:
from aimq.core import QueueMessage
message = QueueMessage(
type="ocr",
payload={
"image_url": "https://example.com/document.jpg"
}
)
To contribute to AIMQ:
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
poetry run pytest
- Submit a pull request
MIT License - see LICENSE for details.