Add work order and purchase order lookups to Bedrock agent instructions
The agent's system prompt and KB description didn't mention WO/PO data, so it refused queries even though the data was already in the knowledge base.
This commit is contained in:
parent
8c71d8267c
commit
510834533b
2 changed files with 9 additions and 4 deletions
|
|
@ -110,6 +110,8 @@ You help employees with:
|
|||
1. Finding vendors and contractors for facility work
|
||||
2. Company policies, SOPs, and SA8000 social accountability compliance questions
|
||||
3. Employee handbook questions
|
||||
4. Work order lookups — status, history, assignments, comments, and details for any work order by its WO number
|
||||
5. Purchase order lookups — status, line items, suppliers, ship-to details, and dates for any PO by its PO number
|
||||
|
||||
## Vendor Query Rules — STRICTLY follow this priority order:
|
||||
|
||||
|
|
@ -124,6 +126,9 @@ When presenting vendor results:
|
|||
- Knowledge base vendors: cite the source document
|
||||
- Google Maps vendors: clearly label these as NEW (not yet vetted), include name, address, phone, and rating
|
||||
|
||||
## Work Order & Purchase Order Queries:
|
||||
Use the knowledge base to look up work orders (WO) and purchase orders (PO). Work order documents include status, description, site/building, severity, priority, assignment, dates, and comment history. Purchase order documents include status, supplier, ship-to, line items, amounts, and dates. When a user asks about a WO or PO number, search the knowledge base and return the relevant details. If no matching record is found, say so clearly.
|
||||
|
||||
## General Questions:
|
||||
Use the knowledge base for policy, SOP, SA8000 compliance, and handbook questions. Cite the specific document or section when possible. If the information is not in the knowledge base, say so clearly — do not guess.
|
||||
|
||||
|
|
@ -140,7 +145,7 @@ Keep responses concise, professional, and actionable.`;
|
|||
knowledgeBases: [
|
||||
{
|
||||
knowledgeBaseId: props.knowledgeBaseId,
|
||||
description: 'Sea Haven internal documents: SOPs, SA8000 compliance docs, employee handbook, approved vendor lists',
|
||||
description: 'Sea Haven internal documents: SOPs, SA8000 compliance docs, employee handbook, approved vendor lists, work orders, and purchase orders',
|
||||
knowledgeBaseState: 'ENABLED',
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export class KnowledgeBaseConstruct extends Construct {
|
|||
constructor(scope: Construct, id: string, props: KnowledgeBaseProps) {
|
||||
super(scope, id);
|
||||
|
||||
// S3 bucket for SA8000 docs, SOPs, and employee handbook
|
||||
// S3 bucket for SA8000 docs, SOPs, employee handbook, work orders, and purchase orders
|
||||
this.docsBucket = new s3.Bucket(this, 'DocsBucket', {
|
||||
bucketName: `seahaven-kb-docs-${props.accountId}`,
|
||||
encryption: s3.BucketEncryption.S3_MANAGED,
|
||||
|
|
@ -33,8 +33,8 @@ export class KnowledgeBaseConstruct extends Construct {
|
|||
this.knowledgeBase = new bedrock.VectorKnowledgeBase(this, 'KnowledgeBase', {
|
||||
embeddingsModel: bedrock.BedrockFoundationModel.TITAN_EMBED_TEXT_V2_1024,
|
||||
name: 'seahaven-kb',
|
||||
description: 'SA8000 compliance docs, SOPs, and employee handbook',
|
||||
instruction: 'Use this knowledge base to answer questions about Sea Haven Industries company policies, SOPs, SA8000 social accountability compliance requirements, approved vendor lists, and the employee handbook.',
|
||||
description: 'SA8000 compliance docs, SOPs, employee handbook, work orders, and purchase orders',
|
||||
instruction: 'Use this knowledge base to answer questions about Sea Haven Industries company policies, SOPs, SA8000 social accountability compliance requirements, approved vendor lists, the employee handbook, work order status and history, and purchase order details.',
|
||||
});
|
||||
|
||||
// S3 data source — chunking configured via ChunkingStrategy.fixedSize()
|
||||
|
|
|
|||
Reference in a new issue