|
| 1 | +As a software engineer already using AWS, the most efficient approach in 2026 is to build a serverless **RAG (Retrieval-Augmented Generation)** application using **Amazon Bedrock**. This bypasses the limitations of HubSpot’s built-in rule-based bots while maintaining full control over your logic and data. |
| 2 | + |
| 3 | +**Architecture Overview** |
| 4 | + |
| 5 | +1. **Frontend:** A lightweight React or vanilla JS chat widget on your site. |
| 6 | +2. **Orchestration (AWS Lambda):** Acts as the brain, receiving user input, querying your data, and calling HubSpot's API. |
| 7 | +3. **LLM & RAG (Amazon Bedrock):** Uses "Knowledge Bases for Amazon Bedrock" to index your website content (stored in S3) and provide generative answers. |
| 8 | +4. **CRM Integration (HubSpot API):** Lambda uses a **Private App Access Token** to create contacts or send internal notifications. |
| 9 | + |
| 10 | +------ |
| 11 | + |
| 12 | +**Step-by-Step Implementation Guide** |
| 13 | + |
| 14 | +**1. Knowledge Retrieval (RAG)** |
| 15 | + |
| 16 | +To answer questions about your site content and availability, use **Knowledge Bases for Amazon Bedrock**: |
| 17 | + |
| 18 | +- **Data Source:** Crawl your website or export your content to an **S3 bucket** as text or PDF files. |
| 19 | +- **Vector Database:** Use the "Quick Start" option in Bedrock to set up a managed vector store (like **Amazon OpenSearch Serverless**). |
| 20 | +- **Availability Data:** Include a specific "Availability.txt" file in your S3 bucket that you update with your current project status. The LLM will prioritize this context when asked about work. |
| 21 | + |
| 22 | +**2. Tool Use (Function Calling)** |
| 23 | + |
| 24 | +To allow the bot to "do tasks" like adding contacts, use **Agents for Amazon Bedrock**: |
| 25 | + |
| 26 | +- Define a **JSON Schema** for a tool called `add_hubspot_contact`. |
| 27 | +- When the LLM detects an intent to "sign up" or "contact me," it will pause and output the structured data (name, email). |
| 28 | +- **Lambda Execution:** Your Lambda function receives this structured output, calls the HubSpot Contacts API, and returns a success message to the LLM. |
| 29 | + |
| 30 | +**3. Secure HubSpot API Integration** |
| 31 | + |
| 32 | +- **Authentication:** Create a **Private App** in your [HubSpot portal](https://www.hubspot.com/products/crm/chatbot-builder) to get an `access_token`. Store this token in **AWS Secrets Manager**—never hardcode it in Lambda. |
| 33 | +- **Contact Creation:** Use the `POST /crm/v3/objects/contacts` endpoint. |
| 34 | +- **Internal Messaging:** To notify yourself, you can use the HubSpot Notifications API or simply have the Lambda function send an email via **Amazon SES**. |
| 35 | + |
| 36 | +**4. Deployment via AWS Lambda URL** |
| 37 | + |
| 38 | +- Enable a **Function URL** for your Lambda to provide a direct HTTPS endpoint for your website's chat widget. |
| 39 | +- **Security:** Implement a simple API key check or verify the origin of requests in your Lambda code to prevent unauthorized use of your LLM tokens. |
| 40 | + |
| 41 | +**Why this is better than HubSpot's native bot:** |
| 42 | + |
| 43 | +- **Cost:** You pay only for what you use on AWS (Bedrock tokens + Lambda execution) rather than paying for a $450+/month HubSpot Professional seat. |
| 44 | +- **Flexibility:** You can switch between models (Claude 3.5, Llama 3, etc.) within Bedrock as better ones are released in 2026. |
| 45 | +- **Customization:** You can program complex logic for your "availability" questions that a standard rule-based bot cannot handle. |
| 46 | + |
| 47 | +[build-your-first-generative-ai-chatbot-with-aws-bedrock](https://builder.aws.com/content/32QI11dOJqOSjbKKlPpXBu8vw1O/build-your-first-generative-ai-chatbot-with-aws-bedrock-in-minutes) |
| 48 | + |
| 49 | +**Amazon Bedrock does not have a traditional "Always Free" tier** based on usage volume. However, as of a major update in **July 2025**, AWS significantly revamped its Free Tier to include **credit-based offers** that effectively allow you to use Bedrock for free as a new customer. |
| 50 | + |
| 51 | +**1. 2026 Free Credit Offers** |
| 52 | + |
| 53 | +If you create a new AWS account, you can receive up to **$200 in credits** that apply to paid services like Amazon Bedrock: |
| 54 | + |
| 55 | +- **Sign-up Bonus:** New customers automatically receive **$100 in credits** upon account creation. |
| 56 | +- **Builder Quests:** You can earn up to **another $100** by completing five onboarding activities. One of these specific tasks is often based on **Amazon Bedrock** (e.g., submitting a prompt in the text playground). |
| 57 | +- **Duration:** These credits are valid for **6 months** from the date of account creation. |
| 58 | + |
| 59 | +**2. Bedrock Pricing Components to Watch** |
| 60 | + |
| 61 | +Even with credits, you must manage your architecture carefully to avoid high costs, particularly for the project you described: |
| 62 | + |
| 63 | +- **Model Inference:** This is billed per token (input/output). This is typically very low cost for small personal projects. |
| 64 | +- **Knowledge Bases (Vector Store):** This is the most expensive part of your proposed "answer from site content" architecture. Using **Amazon OpenSearch Serverless** as the vector store for RAG often has a minimum monthly cost of around **$700/month**. |
| 65 | + - *Alternative:* For a personal project, consider using a cheaper vector store option like **Pinecone's free tier** or an **S3-based** retrieval system to avoid this charge. |
| 66 | +- **Agents for Bedrock:** These may incur separate charges based on usage and active resource consumption during tool calls. |
| 67 | + |
| 68 | +**3. Complementary Always Free Services** |
| 69 | + |
| 70 | +While Bedrock itself is paid (via credits), the other components of your 2026 architecture are part of the **AWS Always Free** tier: |
| 71 | + |
| 72 | +- **AWS Lambda:** 1 million requests and 400,000 GB-seconds of compute time per month. |
| 73 | +- **Amazon S3:** 5 GB of standard storage (useful for storing your website content files). |
| 74 | +- **Amazon DynamoDB:** 25 GB of storage (useful for logging chat history or tracking availability). |
| 75 | + |
| 76 | +**Summary Table** |
| 77 | + |
| 78 | +| Feature | Free Tier Status (2026) | |
| 79 | +| :------------------------- | :---------------------------------------------------------- | |
| 80 | +| **Foundation Models** | No "always free" usage; uses up to $200 in sign-up credits. | |
| 81 | +| **Prompting Playground** | No charge during the "Builder Quest" to earn credits. | |
| 82 | +| **Model Import** | No charge to import a custom model. | |
| 83 | +| **Orchestration (Lambda)** | **Always Free** within monthly limits. | |
0 commit comments