Docs: [AEA-6312] - updated docs#433
Conversation
|
This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket: AEA-6312 |
There was a problem hiding this comment.
Pull request overview
Updates and expands repository documentation for EPS Assist Me, adding per-Lambda READMEs and a high-level architecture overview to help contributors understand the Slack bot, document ingestion pipeline, and CDK stack.
Changes:
- Added new README documentation for multiple Lambda packages and the CDK app.
- Refactored the main
README.mdto include an architecture overview, local run commands, and consolidated make/CI guidance. - Added an architecture flowchart image and referenced it from the root README.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/syncKnowledgeBaseFunction/README.md | New docs describing KB ingestion trigger and SQS batching. |
| packages/slackBotFunction/README.md | Simplified/modernized Slack bot docs; added architecture + env var/test notes. |
| packages/preprocessingFunction/README.md | New docs describing raw→markdown conversion step and testing. |
| packages/cdk/README.md | New docs describing infrastructure scope, structure, and deploy context. |
| packages/bedrockLoggingConfigFunction/README.md | New docs for the Bedrock logging CloudFormation custom resource. |
| images/eps-assist-me-flowchart.png | Added architecture diagram used by the root README. |
| README.md | Reworked top-level documentation (overview, architecture, local run, env vars, make commands, CI notes). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ### Licensing | ||
|
|
||
| Workflows are in the `.github/workflows` folder: | ||
| This code is dual licensed under the MIT license and the OGL (Open Government License).Any new work added to this repository must conform to the conditions of these licenses. In particular this means that this project may not depend on GPL-licensed or AGPL-licensed libraries, as these would violate the terms of those libraries' licenses. |
There was a problem hiding this comment.
Missing space after the period: "License).Any" reads as a typo. Please add a space so it becomes "License). Any".
| This code is dual licensed under the MIT license and the OGL (Open Government License).Any new work added to this repository must conform to the conditions of these licenses. In particular this means that this project may not depend on GPL-licensed or AGPL-licensed libraries, as these would violate the terms of those libraries' licenses. | |
| This code is dual licensed under the MIT license and the OGL (Open Government License). Any new work added to this repository must conform to the conditions of these licenses. In particular this means that this project may not depend on GPL-licensed or AGPL-licensed libraries, as these would violate the terms of those libraries' licenses. |
| - `packages/cdk/` CDK infrastructure, as a single stack containing all resources required for the secure functioning of the bot. Includes Bedrock prompt templates in `prompts/` directory. | ||
| - `packages/slackBotFunction/` Handles Slack events - mentions, DMs, threads, and user feedback. It queries Bedrock to retrieve relevant content and generate responses. | ||
| - `packages/preprocessingFunction/` Converts uploaded documents (PDF, DOCX, etc.) to Markdown for ingestion. | ||
| - `packages/syncKnowledgeBaseFunction/` Triggers knowledge base ingestion when processed documents land in S3. Notifies Slack when ingestion starts. |
There was a problem hiding this comment.
packages/notifyS3UploadFunction/ exists and is referenced in other package docs, but it’s missing from this top-level "Project Structure" list. Adding it here would make the repo overview consistent and help new contributors find that component.
| - `packages/syncKnowledgeBaseFunction/` Triggers knowledge base ingestion when processed documents land in S3. Notifies Slack when ingestion starts. | |
| - `packages/syncKnowledgeBaseFunction/` Triggers knowledge base ingestion when processed documents land in S3. Notifies Slack when ingestion starts. | |
| - `packages/notifyS3UploadFunction/` Sends Slack notifications when new documents are uploaded to S3. |
|
|
||
| ## Project Structure | ||
|
|
||
| - `app/handler.py` Lambda entry point. Processes SSQS/S3 records. |
There was a problem hiding this comment.
Typo in the project structure list: this says "Processes SSQS/S3 records" but the queue service is SQS. Please correct to "SQS/S3" so it matches the rest of the doc and AWS terminology.
| - `app/handler.py` Lambda entry point. Processes SSQS/S3 records. | |
| - `app/handler.py` Lambda entry point. Processes SQS/S3 records. |
| | `RAG_MODEL_ID` | Bedrock model ARN | | ||
| | `GUARD_RAIL_ID` | Bedrock guardrail ID | | ||
|
|
There was a problem hiding this comment.
The environment variable list looks incomplete. The Slack bot code requires additional variables (e.g. AWS_REGION, GUARD_RAIL_VERSION, RAG_RESPONSE_PROMPT_NAME/_VERSION, REFORMULATION_RESPONSE_PROMPT_NAME/_VERSION, and REFORMULATION_MODEL_ID), so documenting only this subset may mislead anyone running/debugging locally. Consider listing all required variables (or explicitly calling out that additional Bedrock/prompt-related variables are required and pointing to where CDK sets them).
| | `RAG_MODEL_ID` | Bedrock model ARN | | |
| | `GUARD_RAIL_ID` | Bedrock guardrail ID | | |
| | `RAG_MODEL_ID` | Bedrock RAG model ARN | | |
| | `GUARD_RAIL_ID` | Bedrock guardrail ID | | |
| | `GUARD_RAIL_VERSION` | Bedrock guardrail version to apply | | |
| | `AWS_REGION` | AWS Region for Bedrock and other AWS service calls | | |
| | `RAG_RESPONSE_PROMPT_NAME` | Name of the RAG response prompt resource | | |
| | `RAG_RESPONSE_PROMPT_VERSION` | Version of the RAG response prompt resource | | |
| | `REFORMULATION_RESPONSE_PROMPT_NAME` | Name of the query reformulation prompt resource | | |
| | `REFORMULATION_RESPONSE_PROMPT_VERSION` | Version of the query reformulation prompt resource | | |
| | `REFORMULATION_MODEL_ID` | Bedrock model ARN used for query reformulation | | |
| These variables are injected by the CDK stack (see `packages/cdk/`) and must be present when running or debugging the function locally. |
|



Summary
Details
Also please review the following JIRA pages:
https://nhsd-confluence.digital.nhs.uk/spaces/APIMC/pages/1121409816/Architecture+-+EPS+Assist
https://nhsd-confluence.digital.nhs.uk/spaces/APIMC/pages/1128231070/EPS+Assist+Me+Architecture+Overview+with+RAG+and+Amazon+Bedrock
https://nhsd-confluence.digital.nhs.uk/spaces/APIMC/pages/1149096324/EPS+Assist+Me+Bedrock+Prompt+Management+Workflow+for+Enhanced+Query+Processing
https://nhsd-confluence.digital.nhs.uk/spaces/APIMC/pages/1169561728/EPS+Assist+Me+Feedback+Flow