GenAI-powered agent for Zammad
Zammad-AI is a Python-based microservice that integrates Generative AI capabilities into the Zammad ticketing system. It operates as an event-driven service, listening to ticket events via Kafka and generating AI-assisted responses.
- Event-Driven Architecture: Built with FastStream and Kafka for robust message processing.
- Smart Filtering: Configurable filtering of ticket events based on request types.
- Secure Communication: Supports mTLS for secure Kafka connections using
truststore. - Modern Stack: Powered by Python 3.13, Pydantic, and uv.
- Configurable: Flexible configuration via YAML,
.env, and environment variables.
- Ingest: Listens to the
ticket-eventsKafka topic. - Filter: Validates events based on configured
valid_request_types. - Process: Fetches ticket details and generates an AI response (GenAI integration).
- Output: Posts the draft response back to Zammad.
- Python: 3.13+
- Package Manager: uv
- Docker: For running the local development stack.
Configuration is managed via pydantic-settings. The application looks for configuration in the following order (highest priority first):
- Environment Variables (prefix
ZAMMAD_AI_) config.yaml.envfile- Defaults
| Setting | Env Variable | Description | Default |
|---|---|---|---|
kafka.broker_url |
ZAMMAD_AI_KAFKA__BROKER_URL |
Kafka broker URL | localhost:9092 |
kafka.topic |
ZAMMAD_AI_KAFKA__TOPIC |
Kafka topic to listen to | ticket-events |
valid_request_types |
ZAMMAD_AI_VALID_REQUEST_TYPES |
List of valid request types | Required |
Example config.yaml:
kafka:
broker_url: "localhost:9092"
topic: "ticket-events"
valid_request_types:
- "general_inquiry"
- "support"Start the local Kafka broker, Zookeeper, and Mailpit using Docker Compose:
docker compose up -d- Kafka UI: http://localhost:8089
- Mailpit: http://localhost:8025
Use uv to install the project dependencies:
uv syncRun the application:
uv run python zammad-ai/main.pyRun the test suite using pytest:
uv run pytestThe project uses ruff for linting and formatting.
Check for issues:
uv run ruff check .Format code:
uv run ruff format .Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please open an issue with the tag "enhancement", fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Open an issue with the tag "enhancement"
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
More about this in the CODE_OF_CONDUCT file.
Distributed under the MIT License. See LICENSE file for more information.
it@M - opensource@muenchen.de