How regisleandro/alfredo_ai works
Project Type and Purpose
• This is a full‐stack, event-driven chatbot application demonstrating communication via RabbitMQ.
• It provides a Streamlit front-end for user interaction, a Python “api” service that processes messages, and integrations with external systems (MongoDB, GitHub, Trello, Pulpo, Google Chat).
High-Level Components
• Streamlit Front-end (streamlit_app.py)
• Message Broker (RabbitMQ service)
• API Worker Service (api/main.py + pkg/ modules)
• Formatter Submodule (api/formatters)
• Integration Clients (pkg/github.py, pkg/trello.py, pkg/mongo.py, pkg/pulpo.py, pkg/file_processor.py, pkg/task_analyst.py)
• External Services (GitHub, Trello, Pulpo API, MongoDB)
• Optional Node Connector (alfredo_rocket/alfredo_rocket.js) for Google Chat webhook
Relationships and Data Flow
• User → Streamlit UI: User submits a prompt or file via the Streamlit web app.
• Streamlit → RabbitMQ Exchange: The app publishes messages to a RabbitMQ queue.
• RabbitMQ → API Worker: The API service (api/main.py) consumes messages.
• API Worker → pkg Modules: The worker uses pkg/task_analyst, pkg/file_processor, pkg/constants to interpret the request.
• API Worker → External Clients: It calls pkg/github, pkg/trello, pkg/pulpo, or pkg/mongo to perform actions or store data.
• API Worker → Formatters: It passes results to api/formatters to generate human-readable responses.
• Formatter → RabbitMQ (or Webhook): Formatted responses are published back to RabbitMQ or sent to Google Chat via the Node connector.
• Node Connector → Google Chat: The alfredo_rocket service posts messages to Google Chat.
Key Architectural Patterns
• Event-Driven / Message Queue: All requests and responses flow through RabbitMQ to decouple front-end and back-end.
• Modular Service Design: Core logic is split into small, focused modules under pkg.
• Adapter/Formatter Layer: api/formatters isolates all output formatting.
• External-Integration Clients: Each external service has its own client module.