This project implements an AI-powered task management and knowledge base system that integrates with Slack and JIRA. It uses Large Language Models (LLMs) to optimize task allocation, provide intelligent responses to queries, and manage a knowledge base.
.
├── src/
│ ├── admin_gui/
│ │ ├── templates/
│ │ │ ├── edit_user.html
│ │ │ ├── edit_role.html
│ │ │ ├── role_management.html
│ │ │ ├── permission_management.html
│ │ │ ├── access_logs.html
│ │ │ └── ...
│ │ ├── static/
│ │ │ ├── css/
│ │ │ │ └── style.css
│ │ │ └── js/
│ │ │ └── script.js
│ │ ├── app.py
│ │ └── create_tables.sql
│ ├── jira/
│ │ └── client.py
│ ├── knowledge_base/
│ │ └── kb.py
│ ├── llm/
│ │ └── wrapper.py
│ ├── slack/
│ │ ├── bot.py
│ │ └── handlers.py
│ ├── task_management/
│ │ └── allocator.py
│ ├── utils/
│ │ ├── access_control.py
│ │ ├── bias_management.py
│ │ ├── chat_memory.py
│ │ ├── data_lineage.py
│ │ ├── logger.py
│ │ └── monitoring_agent.py
│ ├── config.py
│ ├── main.py
│ ├── demo.py
│ └── create_test_db.py
├── tests/
│ ├── test_main.py
│ ├── test_task_allocator.py
│ ├── test_knowledge_base.py
│ ├── test_llm_wrapper.py
│ └── test_suite.py
├── bias_managent_mutliagent_poc.py
├── chat_interface.py
├── requirements.txt
├── setup.py
├── Dockerfile
├── entrypoint.sh
├── docker_build.sh
├── .env
├── .gitignore
└── README.md
Docker is the preferred method for setting up and running this project. It ensures a consistent environment across different systems and simplifies the setup process.
-
Clone the repository:
git clone https://github.com/yourusername/ai-task-management.git cd ai-task-management
-
Create a
.env
file in the project root and add your environment variables (see Environment Variables section below). -
Build the Docker image:
./docker_build.sh
This script builds the Docker image, installing all necessary dependencies and setting up the environment as specified in the Dockerfile.
Expected output:
[+] Building 0.6s (10/10) FINISHED => [internal] load build definition from Dockerfile => => transferring dockerfile: 37B => [internal] load .dockerignore => => transferring context: 2B => [internal] load metadata for docker.io/library/python:3.12.7-bookworm => [1/5] FROM docker.io/library/python:3.12.7-bookworm => [internal] load build context => => transferring context: 32B => [2/5] WORKDIR /usr/src/app => [3/5] COPY requirements.txt ./ => [4/5] RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt => [5/5] COPY . . => exporting to image => => exporting layers => => writing image sha256:... => => naming to docker.io/library/ai-task-management
Troubleshooting:
- If you encounter permission issues, try running the script with sudo:
sudo ./docker_build.sh
- If the script is not executable, run:
chmod +x docker_build.sh
- If you encounter permission issues, try running the script with sudo:
-
Run the container:
docker run --env-file .env ai-task-management
Expected output:
Initializing AI-Powered Task Management System... Connected to database successfully Slack bot started JIRA integration initialized Admin GUI running on http://localhost:5000
Troubleshooting:
- If you see "Error: No such container", ensure you've built the image successfully in step 3.
- If you encounter environment variable issues, check that your .env file is in the correct location and properly formatted.
-
Verify the setup:
docker ps
This command should show your running container.
Expected output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1234567890ab ai-task-management "python ./src/main.py" 10 seconds ago Up 9 seconds friendly_feynman
Troubleshooting:
- If you don't see your container, it may have exited. Use
docker ps -a
to see all containers, including stopped ones. - Check the logs with
docker logs <container_id>
to see any error messages.
- If you don't see your container, it may have exited. Use
-
Access the application:
- Admin GUI: Open http://localhost:5000 in your web browser
- Slack: The bot should now be active in your Slack workspace
- JIRA: The system should be able to fetch and update JIRA tasks
The Docker setup process includes the following key steps:
- Installing all required dependencies
- Setting up the Python environment
- Running tests to ensure the environment is correctly configured
This approach guarantees that all developers and production environments have identical setups, minimizing "it works on my machine" issues.
Additional Docker commands:
- Stop the container:
docker stop <container_id>
- Remove the container:
docker rm <container_id>
- Remove the image:
docker rmi ai-task-management
- View logs:
docker logs <container_id>
Troubleshooting tips:
- If you're having network issues, ensure Docker has the necessary permissions and that no firewall is blocking it.
- For performance issues, check your Docker resource allocation in Docker Desktop settings.
- If changes to your code are not reflected, make sure you've rebuilt the image after making changes.
-
Clone the repository as described above.
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt pip install -e .
-
Create a
.env
file in the project root and add your environment variables.
Create a .env
file in the project root with the following variables:
DEBUG=True
DATABASE_URL=postgresql://user:password@db:5432/dbname
SECRET_KEY=your_secret_key_change_this_in_production
SLACK_TOKEN=your_slack_token_here
JIRA_TOKEN=your_jira_token_here
CHAT_WINDOW_TITLE=Multi-Agent Task Management Chat
CHAT_WINDOW_WIDTH=500
CHAT_WINDOW_HEIGHT=600
AUTHOR_NAME=Your Name
AUTHOR_EMAIL=your.email@example.com
USE_TEST_DB=True # Set to False to use external services
Adjust the values according to your setup and requirements.
To create a test database with dummy data for development and testing purposes:
- Navigate to the
src
directory:cd src
- Run the
create_test_db.py
script:python create_test_db.py
- This will create a SQLite database file named
test_database.db
in the same directory.
The test database includes dummy data for users, tasks, comments, and knowledge base entries, allowing you to test various functionalities of the system without connecting to external services.
To use the test database instead of connecting to external services:
- In your
.env
file, set theUSE_TEST_DB
variable toTrue
:USE_TEST_DB=True
- When this variable is set to
True
, the application will use the SQLite test database for all storage operations. - To switch back to using external services, set
USE_TEST_DB=False
or remove the variable from your.env
file.
To run the main application:
docker run --env-file .env ai-task-management run-task-management
To run the chat interface:
docker run --env-file .env ai-task-management run-chat-interface
To start the main application, run:
python src/main.py
This will initialize all components and start the Slack bot.
To run the chat interface:
python chat_interface.py
To see a demonstration of the system's capabilities, run:
python src/demo.py
This script showcases the main functionalities of the system, including task allocation, knowledge base operations, LLM capabilities, and Slack integration.
To run all tests, execute:
python tests/test_suite.py
This will run all test cases for the main application, task allocator, knowledge base, and LLM wrapper.
-
Task Management
- Allocate tasks based on team members' skills
- Generate workload reports
- Reallocate tasks for optimal resource utilization
-
Knowledge Base
- Add, update, delete, and search knowledge base entries
- Semantic search capabilities
-
LLM Integration
- Analyze tasks and match with team members' skills
- Optimize task allocation
- Summarize text and perform semantic search
-
Slack Integration
- Interact with the system through Slack commands
- Receive notifications and updates in Slack
-
JIRA Integration
- Fetch and update task information from JIRA
-
Monitoring and Activity Tracking
- Monitor Slack activity for specific users
- Track updates and changes in JIRA projects
-
Admin GUI
- Web-based interface for system administration
-
Bias Management
- Multi-agent system for managing and mitigating biases in task allocation
Here's a list of available Slack commands:
/allocate_task
: Allocate a new task/workload_report
: Generate a workload report/reallocate_tasks
: Suggest task reallocation/kb_add
: Add a new entry to the knowledge base/kb_search
: Search the knowledge base/kb_update
: Update an existing knowledge base entry/kb_delete
: Delete a knowledge base entry/kb_info
: Get information about the knowledge base/summarize
: Summarize a given text/semantic_search
: Perform a semantic search/analyze_task
: Analyze task requirements/match_task
: Match a task to team members/recent_activities
: Get recent activities/monitor_slack
: Monitor Slack activity for a user/monitor_jira
: Monitor updates for a JIRA project
- Implement your feature in the appropriate module under the
src/
directory. - Update or add tests in the
tests/
directory. - Update the README.md if your feature introduces new functionality or commands.
- If your feature requires new dependencies, add them to
requirements.txt
andsetup.py
.
- Fork the repository
- Create a new branch for your feature
- Implement your changes
- Write tests for your new feature
- Ensure all tests pass
- Submit a pull request
[Insert your chosen license here]