A complete guide to design a project management assistant using Generative AI
Learn how to design an efficient GenAI solution using Amazon Bedrock - Knowledge base and agent
Kowsalya Jaganathan
Amazon Employee
Published Sep 5, 2024
Last Modified Sep 6, 2024
Generative AI has rapidly become a transformative technology by revolutionizing industries worldwide and driving innovation. As builders, we always focus on problem solving and best possible ways to use technology to solve business challenges. In this blog post, we will problem solve one of the primary use cases in project management using Generative AI (GenAI). Project managers spend a 1/3rd of their day in project management activities like resource allocation, task creation and scanning through internal data sources for project or organization specific information. Solving this use case will help the project managers to be more efficient and enable them to use their time to innovate solutions for business challenges. With the help of GenAI technologies, you can make your project management team’s life easier by automating labour intensive & repetitive work through an interactive GenAI based chat application - Project management assistant.
Large Language Models (LLMs) are foundation models (FMs) trained in huge set of public data and are capable of generating comprehensive text response based on the data it is trained on. For our use case, we need the LLM to respond based on the organization specific data to help the project managers find relevant organization specific information efficiently and also, we need to integrate with organization’s enterprise applications to automate the project management process.
Retrieval Augmented Generation is an architectural approach, which allows you to augment the generation capabilities of LLM with your own data. In this approach, relevant information will be retrieved from your data sources and passed on to the LLM along with the user queries to generate relevant answer. RAG is a common technique that you can employ to improve the accuracy and relevancy of the LLM generated responses and it is cost effective, efficient and easy to implement.
Amazon Bedrock is a fully managed service that helps you to easily access high-performing foundation models (FMs) through a unified API. Amazon Bedrock also offers a broad set of capabilities to build generative AI applications efficiently with security, privacy, and responsible AI. Knowledge Base for Amazon Bedrock and Agents for Amazon Bedrock are the 2 key features that we use in this solution.
In this blog post, we will discuss the solution to build a Project Management Assistant using Amazon Bedrock and Retrieval Augmented Generation. By adopting this solution, you will be able to improve employee efficiency, agility and innovation in your organization.
Project Management Assistant is an interactive chat application, aimed to act as an assistant for project managers. In this blog, we are focussing on building 2 core functionalities of Project Management Assistant, which are given below:
- Interactive search – Ability to search on internal data sources
- Resource allocation - Ability to assign resources to projects
Design Considerations
Availability, resiliency, modularity, scalability, security, performance, cost and maintainability are some of the common aspects that are considered in any software design. When designing a GenAI application, along with all the above-mentioned aspects we need to address data privacy, legal and ethical considerations.
Project Management Assistant is built using a serverless architecture and primarily built on Amazon Bedrock. Bedrock being a fully managed service takes away the burden of managing the infrastructure, provisioning capacity, or writing custom code and also it makes the development process simple with easy-to-use features to handle security & compliance, prompt engineering, monitoring, encryption, user permissions, API invocation and more. By using AWS serverless, managed services like Amazon Bedrock, AWS Lambda, Amazon OpenSearch for this solution, we can easily address availability, scalability, resiliency, modularity, security, cost and maintainability aspects. Performance of a GenAI solution is generally measured by latency, relevancy and accuracy of the application. Optimum performance can be achieved by choosing right Foundation Model and optimized prompts. Data privacy and ensuring responsible use of AI is a major challenge in GenAI application and Bedrock promptly helps in addressing them as well. Bedrock doesn't store or log your prompts and completions. Also, Bedrock doesn't use your prompts and completions to train any AWS models and doesn't distribute them to third parties. Amazon Bedrock Guardrails allows you to implement safeguards for your GenAI applications based on your use cases and responsible AI policies.
Below image illustrates the architecture of Project Management Assistant
Let’s take quick look at the components of the architecture. This will help you to understand the design considerations and architectural approach of this solution.
You can build a UI application to act as the entry point for Project Management Assistant solution. Alternatively, you can integrate the solution to your existing applications or build a slack integration to serve as slack bot.
Orchestration is the brain of this solution and is implemented using Agents for Amazon Bedrock. Agents for Amazon Bedrock is one of the key features of Bedrock that enables you to build and configure autonomous agents for your application. Agent orchestrates multi-step tasks and interactions between foundation models (FMs), data sources, software applications, and user conversations. We can configure agent to automatically call APIs to take actions using action group and also agents can invoke knowledge bases to supplement information for these actions. In action group, you can define the actions that the agent should perform by defining either a OpenAPI schema or function details
Following are the responsibilities of the agent in this solution:
- Breaking down the user request in to multiple smaller tasks
- Intelligently orchestrating the multi-step tasks
- Initiating interaction with knowledge base, APIs and data sources to fulfill the task
- Generating response to interact with the user
As Project Management Assistant handles 2 functionalities, the agent should be able to direct the request to appropriate path based on the user query. Let’s say the project manager requests Project Management Assistant to assign a resource for a specific project, agent processes the user request and breaks it down in to multiple tasks as given below:
- Analyse the user request to identify the appropriate routing path. Based on the nature of the user request, agent could route the request to either knowledge base to retrieve required information or to the following sequence of tasks to assign a resource. Since the user request is to assign a resource, below tasks will be executed.
- Get the project details to find out the resource requirement by invoking an API
- Get the list of available employees that matches the resource requirement by invoking an API
- Generate response with the list of employees using LLM. Respond back to the customer and get them choose an employee to be assigned
- Assign the employee to the project by updating the database using an API
- Respond back to the customer with the confirmation
We have briefly talked about the Retrieval Augmented Generation technique and how it helps to customize the foundation model response with your organization data. Now, let’s see how to implement RAG. Building a RAG based solution includes following steps:
- Establish integration with your organization’s data sources
- Convert texts from your data sources to vector embeddings to enable efficient similarity search. This process requires an efficient chunking strategy and an embeddings foundation model. Chunking strategies are used to split large amount of information into smaller, more manageable chunks. Some of the well-known strategies are character chunking, token-based chunking, Hierarchical chunking and semantic chunking.
- Store the embedding in a vector store. Vector store could be a database capable of storing vector embeddings and vector index. The vector store applies indexing strategies and similarity search algorithms to efficiently store and retrieve the embeddings that match user query. Some of the popular indexing strategies are Inverted File (IVF), Hierarchical Navigable Small World (HNSW) Algorithm and KNN.
- Augment the user query with the retrieved information to generate relevant response from the Large Language Model (LLM)
Building an efficient RAG solution from the scratch is time and effort consuming. Amazon Bedrock provides Knowledge Base for Amazon Bedrock, which is a fully managed implementation of RAG. Knowledge base makes it easier to leverage RAG technique in your GenAI solutions as you don’t have to custom build all the above-mentioned steps. Knowledge base can be set up effortlessly by following these simple steps. You can also conveniently associate the knowledge base with agent to add RAG capability to the agent.
In this solution, we will use knowledge base to implement the interactive search functionality. Knowledge base provide options to choose your data source connectors, embeddings foundation model and vector store. We use Amazon OpenSearch as the vector store in our solution for the ease of use. You could use your preferred vector store when setting up the knowledge base. When the user queries the Project Management Assistant for information about a SOW contract or a policy, which is stored in the organization’s data source like Amazon S3, the agent will route the user request to the knowledge base and return the generate response to the user.
In this section, we will focus on the process flow of the Project Management Assistant for interactive search and resource allocation functionality.
Below diagram depicts the process flow for the interactive search functionality
The sequence of the steps for the interactive search functionality is explained below:
Step 0: Data ingestion
This step is a prerequisite for the solution. Data ingestion includes following activities :
- Identify your organization’s data sources that contains relevant information required for this solution. In our case, the data is stored in Amazon S3 bucket
- Create Knowledge base by configuring the following - integration to S3 bucket using S3 connector , your preferred choice of embedding model and Amazon OpenSearch as vector store
- Synchronize the data source to ingest the data into knowledge base and stored as vector embeddings in OpenSearch
Step 1: User initiates the interaction with Project Management Assistant through an interactive UI and requests for information specific to your organization such as SOW contracts, policies. Below image shows the simple UI screen built using Streamlit.
Step 2: Project Management Assistant UI sends the user query to the agent for processing.
Step 3a: Foundation model in the agent analyzes the user query based on the instruction configured in agent. Based on the analysis, the agent invokes the knowledge base to retrieve the relevant information to fulfill the user request. Under the hood, Knowledge base converts the user prompt into embeddings and using similarity search to retrieve relevant chunks from OpenSearch. Then the user prompt is augmented with the additional context from the retrieved chunks and it will be sent to the LLM to generate accurate response.
Step 4: Agent generates the final response based on the knowledge base generated response and send it to the UI to be presented to the user
In this blog, we are considering a simplified representation of resource allocation process and hence in the below flow we will be using APIs alone to allocate resources. In complex scenarios when needed, you could invoke the knowledge base as well to get the additional information from various data sources to help with the resource allocation process.
Below diagram depicts the process flow for the resource allocation functionality
The sequence of the steps for the resource allocation functionality is explained below:
Step 1: User initiates the interaction with Project Management Assistant through an interactive UI and requests to allocate resources for a project. To fulfill a task, there could be multiple back and forth user interactions or a single user interaction based on how you want to perform this action. In this blog, multiple user interactions are chosen to get additional information to complete the resource allocation.
Step 2: Project Management Assistant UI sends the user query to the agent for processing.
Step 3a: Based on the instructions defined in the agent, the agent identifies appropriate tasks and orchestrates them to fulfill the user request. To perform the actions, agent uses action groups to invoke appropriate APIs. Employee and project details are stored in Amazon RDS data source. Business logic to get and update the employee and project details from the data source are implemented in AWS Lambda functions. Order of the API invocation is given below:
- Get the project details to find out the resource requirement by invoking an API
- Get the list of available employees that matches the resource requirement by invoking an API
- Once the user chooses the employee, assign the chosen employee to the project by updating the database using an API
Step 4: Agent generates the response and interacts with the user to either get additional information or to present confirmation of task completion
In this blog, we discussed the solution to build a Project Management Assistant and walked through the flow of the solution for each of the functionality on a design level. Hope this helps you in designing a GenAI solution for your use case using Agents for Amazon Bedrock agents and knowledge base. Stay tuned for the next part of this blog with implementation details of this solution. Keep Learning!
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.