Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
37dd81b
chore: enable local dev with a docker compose based stack
joeds13 Nov 21, 2025
0961f90
update app to send document as bytes instead of doing text conversion
PaulTaylor Nov 27, 2025
5e63b2c
updated system prompt
PaulTaylor Nov 28, 2025
aae4b06
fix bedrock service tests
PaulTaylor Nov 28, 2025
30825d3
fix markdown rendering issue on the client with the updated prompt
PaulTaylor Dec 1, 2025
2fd9889
update evaluation mechanisms for multimodal prompting
PaulTaylor Dec 3, 2025
31409c9
Remove pandoc and pypdf as no longer required
PaulTaylor Dec 4, 2025
d763608
switch default model to nova-lite
PaulTaylor Dec 5, 2025
e59d873
ignore terraform plugin-cache and built evaluation_alerts.zip
PaulTaylor Dec 5, 2025
c87b8ef
fix mixed http/https issue in the frontend when retriving history
PaulTaylor Dec 11, 2025
e942808
resolve CodeQL issues
PaulTaylor Dec 16, 2025
5a6bedc
fix whitespace issues
PaulTaylor Dec 16, 2025
7b3dd0e
frontend dependency updates to address vulnerabilities
PaulTaylor Dec 16, 2025
f195466
fix unit tests for evaluation service
PaulTaylor Dec 16, 2025
35866ef
exclude local docker runner from sonar coverage analysis
PaulTaylor Dec 16, 2025
42a43e0
improve test coverage in bedrock_service.py
PaulTaylor Dec 16, 2025
4729bdc
exclude local development wrapper from sonor analysis
PaulTaylor Dec 16, 2025
e26288b
disable automated evaluations as they always give the same result
PaulTaylor Dec 16, 2025
baff263
remove some stray print statements remaining from debugging
PaulTaylor Dec 17, 2025
01de1cf
fixes from user feedback
PaulTaylor Jan 27, 2026
ea58e17
remove hardcoded aws references from compose file
PaulTaylor Feb 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,5 @@ src/backend/app/.env
src/backend/bedrock_alerts/lambda_build
src/backend/bedrock_alerts/lambda_function.zip
src/backend/bedrock_alerts/lambda_function.zip
src/backend/bedrock_alerts/evaluations_alerts.zip
plugin-cache
94 changes: 94 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
x-aws-environment: &aws-environment
AWS_DEFAULT_REGION: eu-west-2
AWS_REGION: eu-west-2
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SESSION_TOKEN: ${AWS_SESSION_TOKEN}

services:
frontend:
build:
context: src/frontend/notifai-uploader
ports:
- "3000:80"
depends_on:
- backend
- bedrock-prompt-messager
environment:
<<: *aws-environment
REACT_APP_BACKEND_API_BASE_URL: ${REACT_APP_BACKEND_API_BASE_URL}
REACT_APP_COGNITO_ID: ${COGNITO_APP_CLIENT_ID}
REACT_APP_COGNITO_USER_POOL_ID: ${COGNITO_USER_POOL_ID}
REACT_APP_API_GATEWAY: ${REACT_APP_API_GATEWAY}
healthcheck:
test: ["CMD", "curl", "http://localhost:80/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s

backend:
build:
context: src/backend/app
ports:
- "8080:8080"
entrypoint:
[
"fastapi",
"dev",
"/app/main.py",
"--port",
"8080",
"--host",
"0.0.0.0",
"--reload",
]
Comment on lines +35 to +45
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The backend is started with fastapi dev /app/main.py, but main.py imports modules as from app.... In this container layout, that typically requires PYTHONPATH to include the parent directory of the app package (mirroring pytest.ini: pythonpath = src/backend). Without setting PYTHONPATH (or switching to module-style startup like fastapi dev app.main:app), the backend may fail to start with ModuleNotFoundError: No module named 'app'.

Copilot uses AI. Check for mistakes.
volumes:
- "${PWD}/src/backend/app:/app"
environment:
<<: *aws-environment
COGNITO_REGION: ${AWS_REGION}
COGNITO_USER_POOL_ID: ${COGNITO_USER_POOL_ID}
COGNITO_APP_CLIENT_ID: COGNITO_APP_CLIENT_ID
S3_LLM_LOGS_BUCKET: ${S3_LLM_LOGS_BUCKET}
S3_LLM_LOGS_DIRECTORY: ${S3_LLM_LOGS_DIRECTORY}
S3_LLM_LOGS_BUCKET_ACCOUNT_ID: ${S3_LLM_LOGS_BUCKET_ACCOUNT_ID}
healthcheck:
test:
[
"CMD",
"python3",
"-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8080/health')",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s

bedrock-prompt-messager:
build:
context: src/backend/bedrock-prompt-messager
dockerfile: Dockerfile
ports:
- "8081:8080"
volumes:
- "${PWD}/src/backend/bedrock-prompt-messager:/var/task"
environment:
<<: *aws-environment
env_model_id: "amazon.nova-lite-v1:0"
env_temperature: "0.1"
env_max_tokens: "10000"
env_top_p: "0.5"
env_logging_s3_bucket: ${S3_LLM_LOGS_BUCKET}
env_logging_s3_key_prefix: ${S3_LLM_LOGS_DIRECTORY}
env_guardrail_arn: ${GUARDRAIL_ARN}
env_guardrail_version: ${GUARDRAIL_VERSION}
env_logging_s3_account_id: ${S3_LLM_LOGS_BUCKET_ACCOUNT_ID}
# FEAT_EXTENDED_ADVICE: true
healthcheck:
test: ["CMD", "curl", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
2 changes: 1 addition & 1 deletion infrastructure/terraform/components/notifyai/bedrock.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ data "aws_iam_policy_document" "bedrock_access_s3" {
aws_s3_bucket.evaluation_programatic_results.arn,
"${aws_s3_bucket.evaluation_programatic_results.arn}/*",
"arn:aws:bedrock:*::foundation-model/*",
"arn:aws:bedrock:${var.region}:${var.aws_account_id}:inference-profile/eu.amazon.nova-pro-v1:0",
"arn:aws:bedrock:${var.region}:${var.aws_account_id}:inference-profile/eu.amazon.nova-lite-v1:0",
"arn:aws:bedrock:${var.region}:${var.aws_account_id}:evaluation-job/*",
"arn:aws:bedrock:${var.region}::prompt/*",
"arn:aws:bedrock:*:${var.aws_account_id}:inference-profile/*",
Expand Down
2 changes: 2 additions & 0 deletions infrastructure/terraform/components/notifyai/eventbridge.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module "eventbridge" {
arn = aws_lambda_function.bedrock_evaluations.arn
input = jsonencode({ "job" : "cron-by-rate" })
role_arn = aws_iam_role.eventbridge_scheduler_role.arn

end_date = "2025-12-16T00:00:00Z"
}
Comment on lines 14 to 17
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coding end_date = "2025-12-16T00:00:00Z" permanently stops the scheduled evaluation after that date (and it’s already in the past as of now), regardless of evaluation-schedule-days. If the intent is to disable scheduling, it’s clearer/safer to disable the schedule explicitly (e.g., via a variable/flag) or remove the schedule block, rather than relying on a fixed timestamp.

Copilot uses AI. Check for mistakes.
Copy link
Author

@PaulTaylor PaulTaylor Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was deliberate - as the smallest change that could disable the evaluation runner. That code needs to be updated/replaced/removed as per the adopting team. At the moment it doesn't add value because it always tests the same model against the same documents (and will not function against the updated prompt).

A proper MLOps type evaluation pipeline would be desirable, but was out of the scope of these changes.

(This rationale applies to all of the comments impacting the evaulation service code)

}
}
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/terraform/components/notifyai/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ data "aws_iam_policy_document" "bedrock_access" {
"${aws_s3_bucket.lambda_prompt_logging_s3_bucket.arn}/${local.s3_lambda_logging_key}*",
"arn:aws:bedrock:${var.region}:${var.aws_account_id}:guardrail/*",
"arn:aws:bedrock:${var.region}:${var.aws_account_id}:inference-profile/eu.amazon.nova-pro-v1:*",
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IAM policy still grants access to the Nova Pro inference profile (...inference-profile/eu.amazon.nova-pro-v1:*) while the PR switches the deployed model to Nova Lite. If the runtime uses inference profiles, this mismatch can cause AccessDenied when invoking Nova Lite. Consider updating/removing the Nova Pro inference-profile ARN and adding the corresponding Nova Lite inference-profile ARN.

Suggested change
"arn:aws:bedrock:${var.region}:${var.aws_account_id}:inference-profile/eu.amazon.nova-pro-v1:*",
"arn:aws:bedrock:${var.region}:${var.aws_account_id}:inference-profile/eu.amazon.nova-lite-v1:*",

Copilot uses AI. Check for mistakes.
"arn:aws:bedrock:${var.region}::foundation-model/amazon.nova-pro-v1:0",
"arn:aws:bedrock:${var.region}::foundation-model/amazon.nova-lite-v1:0",
"arn:aws:logs:${var.region}:${var.aws_account_id}:log-group:/aws/lambda/${local.lambda_name}:*"
]
}
Expand Down
Loading
Loading