What You’re Building and Why It Works
This isn’t a generic chatbot bolted onto a PDF. The architecture is purpose-built for diagnostic accuracy and real-world field use.
Here’s what makes it effective:
- RAG-powered retrieval pulls answers directly from indexed manufacturer manuals, parts catalogs, and service guides — so responses are grounded in actual documentation, not hallucinated procedures.
- AgentCore Memory maintains context within a session (short-term) and persists technician specializations and fleet details across sessions (long-term).
- Natural language interface means technicians describe symptoms the way they’d describe them to a colleague — and get structured, actionable diagnostic responses back.
The result is a system that reduces repeat site visits, shortens diagnostic time, and keeps repair procedures aligned with manufacturer warranties.
Architecture at a Glance

The solution has four functional sections working together.
Section A — Authentication and Frontend: AWS Amplify hosts the React web app. Amazon Cognito handles user authentication via User Pool and Identity Pool. The frontend communicates directly with the AgentCore Runtime endpoint using a Cognito Bearer token.
Section B — AgentCore Runtime: The hosted Strands-based agent exposes a single /invocations endpoint. Internally, it routes requests by path — /chat for AI queries, /issues for CRUD operations on service tickets. Session management and health checks are built in.
Section C — AI Processing: The Strands Agent uses a custom search_equipment_knowledge tool that calls the Bedrock Knowledge Base via the retrieve_and_generate API. Equipment documentation stored in Amazon S3 is indexed using Amazon OpenSearch Serverless for vector search and Amazon Titan Embeddings for semantic matching.
Section D — Data and Memory: DynamoDB stores equipment service tickets. AgentCore Memory handles both short-term (within-session) and long-term (cross-session) context. CloudWatch and X-Ray provide automatic observability.
The Request Flow
When a technician submits a question, here’s exactly what happens:
- Technician authenticates through Amazon Cognito in the web app.
- Query is sent to the AgentCore Runtime
/invocationsendpoint with a Bearer token. - AgentCore validates the token and retrieves relevant context from previous conversations.
- The Strands Agent sends the query to Amazon Nova 2 Lite for inference.
- The model invokes
search_equipment_knowledge, which queries the Bedrock Knowledge Base. - The Knowledge Base searches indexed equipment manuals and returns relevant documentation with source citations.
- The model synthesizes a diagnostic response with repair procedures and parts recommendations.
- The technician receives the response with source attribution for verification.
That last point matters. Source attribution means technicians can verify recommendations against the original manual — critical when you’re working with high-pressure hydraulics or electrical systems.
Prerequisites
Before you write a single line of configuration, make sure you have these in place:
- An AWS account with IAM permissions to deploy AgentCore agents
- Amazon Bedrock model access for Amazon Nova 2 Lite in your target AWS Region
- AWS CLI v2.0 or later, installed and configured
- Python 3.10 or newer
- Terminal access
Cost reality check: For testing, the main costs are Bedrock model invocations (Amazon Nova 2 Lite runs $0.30/$2.50 per million input/output tokens) and the Knowledge Base’s OpenSearch Serverless instance (~$0.24/hour while active). AgentCore Runtime, DynamoDB, S3, Cognito, and Amplify fall within Free Tier for testing volumes. Use the AWS Pricing Calculator for production estimates.
Critical: Deploy everything in the same AWS Region. The CloudFormation stack, Knowledge Base, and AgentCore launch command must all use the same Region or the integration breaks.
Step 1: Prepare Your Equipment Documentation

The Knowledge Base is the brain of this system. What you put in determines what you get out.
For this tutorial, the source material is the John Deere 1023E and 1025R Compact Utility Tractor Operator’s Manuals, available from the John Deere Technical Information Store. You can substitute your own organization’s documentation.
Collect and organize these document types:
- Equipment manuals (PDF format recommended)
- Technical service guides and troubleshooting documentation
- Parts catalogs with part numbers and specifications
- Maintenance schedules and preventive care instructions
- Safety protocols and manufacturer warnings
Before uploading, verify:
- Documents are text-searchable, not scanned images. Scanned PDFs won’t index properly.
- Naming conventions are consistent — for example,
JohnDeere_1023E_OperatorsManual.pdf - Any proprietary information that shouldn’t be broadly accessible has been removed
Step 2: Create the S3 Bucket and Upload Documentation
Run these commands from your terminal:
aws s3 mb s3://agriculture-kb-documents-<unique-suffix>
aws s3 cp ./equipment-docs s3://agriculture-kb-documents-<unique-suffix> --recursive
Replace <unique-suffix> with something unique to your account. S3 bucket names are globally unique.
Step 3: Create the Bedrock Knowledge Base
In the Amazon Bedrock console, create a new Knowledge Base with these settings:
- Knowledge Base name: Agriculture-Equipment-Repair-KB
- Data source:
s3://agriculture-kb-documents-<unique-suffix> - Parsing strategy: Amazon Bedrock default parser
- Chunking strategy: Default chunking
- Embeddings model: Amazon Titan Embeddings G1 – Text
- Vector store: Quick create a new vector store (Amazon OpenSearch Serverless)
After creation, sync your data source. Ingestion typically takes 10–20 minutes depending on document volume. Use the Test functionality in the Bedrock console to run sample queries and confirm the Knowledge Base is returning relevant results.
Record the Knowledge Base ID from the details page. You’ll need it in later steps.
Step 4: Deploy Supporting Infrastructure via CloudFormation
Launch the CloudFormation stack from the AWS console. Configure the stack parameters:
- Stack name:
ag-repair-assist(or your preferred name) - KnowledgeBaseId: The ID you recorded in Step 3
After successful deployment, pull these values from the stack’s Outputs tab. You’ll use them throughout the remaining steps:
| Output Key | Used For |
|---|---|
| AgentCoreExecutionRoleArn | Agent configuration |
| CognitoDiscoveryUrl | Agent OAuth setup |
| UserPoolClientId | Agent OAuth setup |
| EquipmentIssuesTableName | Agent environment variables |
| UserPoolId | Frontend configuration |
| IdentityPoolId | Frontend configuration |
| AmplifyConsoleUrl | Frontend deployment |
| AmplifyAppUrl | Your live application URL |
Step 5: Set Up the Agent Environment Locally
Run these commands from your local terminal:
mkdir agriculture-repair-agent && cd agriculture-repair-agent
python3 -m venv .venv
source .venv/bin/activate
Install the AgentCore toolkit and dependencies:
pip install "bedrock-agentcore-starter-toolkit>=0.1.21" strands-agents strands-agents-tools
Download and extract the agent code package. It contains two files: agriculture_repair_agent.py (the agent logic) and requirements.txt (dependencies).
Understanding the Core Tool
The agent’s diagnostic capability comes from a single well-designed tool. Here’s the retrieval function that powers it:
@tool
def search_equipment_knowledge(query: str) -> str:
"""Search equipment manuals, parts catalogs, and repair docs."""
response = bedrock_agent_runtime.retrieve_and_generate(
input={"text": query},
retrieveAndGenerateConfiguration={
"type": "KNOWLEDGE_BASE",
"knowledgeBaseConfiguration": {
"knowledgeBaseId": KNOWLEDGE_BASE_ID,
},
"modelArn": f"arn:aws:bedrock:{REGION}::foundation-model/{MODEL_ID}",
}
)
return response.get("output", {}).get("text", "No results found.")
This function takes a natural language query, sends it to the Knowledge Base via retrieve_and_generate, and returns the synthesized response. The model handles the semantic matching — you just pass in the question.
Step 6: Configure and Deploy the Agent
Run the configuration command:
agentcore configure -e agriculture_repair_agent.py
When prompted, enter the following values:
- Agent Name: Press Enter to use the default (
agriculture_repair_agent) - Requirements File: Press Enter to confirm
requirements.txt - Deployment Configuration: Select Choice 1 — Direct Code Deploy, Python only, no Docker required
- Python runtime version: Select 3.10 or higher
- Execution Role: Paste
AgentCoreExecutionRoleArnfrom Step 4 outputs - S3 Bucket URI/Path: Enter the URI for the S3 bucket created in Step 2
- Configure OAuth authorizer: Choose yes
- OAuth Discovery URL: Paste
CognitoDiscoveryUrlfrom Step 4 outputs - Allowed OAuth client IDs: Paste
UserPoolClientIdfrom Step 4 outputs - Remaining OAuth prompts: Press Enter to skip
- Memory Configuration: Press Enter to create new memory
- Enable long-term memory: Choose yes
After configuration completes, you’ll see a summary confirming your execution role, OAuth setup, and memory configuration (short-term + long-term, 30-day retention).
Launch the Agent
agentcore launch --env KNOWLEDGE_BASE_ID=<your-kb-id> --env TABLE_NAME=<EquipmentIssuesTableName>
This takes approximately 5–10 minutes. No local Docker required — AgentCore handles containerization on the backend.
After completion, note the Agent Runtime ARN from the output. You’ll need it for frontend configuration.
Monitor your deployment logs:
aws logs tail /aws/bedrock-agentcore/runtimes/agriculture_repair_agent-<id>-DEFAULT
--log-stream-name-prefix "2026/05/21/[runtime-logs]" --follow
The GenAI Observability Dashboard in CloudWatch shows token usage, latency, and tool invocation patterns. Note that observability data can take up to 18 minutes to appear after first launch.
Step 7: Deploy the Frontend
- Download the
ML-18699-FrontEnd.zipfrom the link provided in your deployment outputs. - Navigate to the
AmplifyConsoleUrlfrom your Step 4 CloudFormation outputs. - Click Deploy updates, choose the Drag and drop method, upload the zip file, and click Save and Deploy.
- Wait for deployment to complete.
Using the Application
Open the AmplifyAppUrl from your CloudFormation outputs. On first launch, you’ll be prompted to enter configuration details — use the values from Steps 4 and 6.
Create an account using the Sign-Up option, verify your email, and sign in. You’ll land on the main dashboard.
Real Diagnostic Example
Here’s what the assistant actually produces in practice.
Technician prompt:
My John Deere 1023E series tractor is losing hydraulic pressure on the left side when lifting heavy implements. The pressure drops from 2500 PSI to 1800 PSI under load.
Assistant response:
Probable Root Causes:
- Mesh filter contamination or debris restricting flow
- Restriction in suction line — blockage in the suction hose or pipe
- Hydraulic pump wear — internal wear causing pressure drop under load
- Main relief valve malfunction — leaking or incorrectly set relief valve
- SCV valve issues (if equipped) — internal leakage or improper operation
Follow-up prompt:
What hydraulic fluid is recommended for John Deere 1025R?
Assistant response:
Primary Recommendation: John Deere Hy-Gard or John Deere Low Viscosity Hy-Gard
Biodegradable Option: John Deere Bio Hy-Gard
Alternative: Any oil meeting John Deere Standard JDM J20C or equivalent specifications
That’s the value of RAG in action. The response isn’t generated from training data — it’s retrieved from the actual manufacturer manual you indexed, then synthesized into a structured diagnostic answer.
Keeping the Knowledge Base Current
Manufacturers release updated manuals and revise service documentation regularly. Build a synchronization schedule into your workflow so new uploads are processed automatically. Stale documentation produces stale recommendations.
Tuning Retrieval Quality
The top_k and relevance_score thresholds in your retrieval configuration directly affect response quality. Broader documentation corpora need tighter thresholds to avoid noise. Test with real technician queries and adjust based on what comes back.
Extending the Agent
Adding new capabilities — inventory checks, parts ordering, dealer communication — requires only adding a new @tool function to the agent code. No infrastructure changes needed. This is one of the cleaner extensibility patterns in the Strands SDK.
Safety Is Non-Negotiable
Agricultural equipment involves high-pressure hydraulics, electrical systems, and rotating machinery. Every repair recommendation must align with manufacturer warranties and safety guidelines. The system should surface safety warnings prominently — not bury them at the end of a response. Build this into your prompt engineering from the start.
Scaling to Production
This tutorial is optimized for testing and evaluation. Before going to production, add:
- Amazon Bedrock Guardrails for prompt attack detection and content filtering. Configure denied topics to keep the agent focused on equipment repair.
- Amazon CloudFront + AWS WAF in front of the AgentCore Runtime endpoint for rate limiting and OWASP protection.
Cleanup
AWS resources incur charges until deleted. Run these commands when you’re done testing.
Delete the agent:
agentcore destroy
Delete the CloudFormation stack:
aws cloudformation delete-stack --stack-name ag-repair-assist
Delete the Knowledge Base from the Amazon Bedrock console — select Agriculture-Equipment-Repair-KB and choose Delete.
Empty and delete the S3 bucket:
aws s3 rm s3://agriculture-kb-documents-<unique-suffix> --recursive
aws s3 rb s3://agriculture-kb-documents-<unique-suffix>
Back up any equipment documentation you want to keep before deleting the S3 bucket. Deletion is permanent.
What This Actually Demonstrates
The technical stack here — AgentCore Runtime, Strands SDK, RAG via Bedrock Knowledge Base, memory persistence — is reusable across any domain where expertise lives in documents and decisions need to be made in the field.
Agriculture is a compelling use case because the stakes are high and the documentation is dense. But the same pattern applies to industrial maintenance, medical device servicing, construction equipment, or any scenario where a technician needs fast, accurate, source-verified answers without carrying a library.
The real shift isn’t the technology. It’s moving from “search for the answer” to “describe the problem and get a structured diagnostic path back.” That’s the workflow change that reduces downtime, cuts repeat site visits, and gets equipment back running faster.
Build it once. Tune the Knowledge Base. Let the agent do the manual hunting.
Comment (1)
Want to join this discussion? Login or Register.
As a SaaS founder working with AI products, I've noticed the same trend: users are increasingly looking for practical outcomes and workflow automation rather than AI for its own sake. Thanks for putting together such a comprehensive overview.