yeongseon /
azure-functions-cookbook-python
Dogfood-tested recipes and examples for the Azure Functions Python DX Toolkit
63/100 healthLoading repository data…
RDarrylR / repository
A Serverless Recipe Assistant with Bedrock AgentCore, Knowledge Bases, and S3 Vectors
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A serverless AI recipe assistant powered by Amazon Bedrock AgentCore, Knowledge Bases, and S3 Vectors. Search, explore, and analyze 600+ family recipes with real-time USDA nutrition lookup, multi-turn conversations, and text-to-speech cooking mode -- all for about $0.08/month in AWS costs.
| Service | Role |
|---|---|
| Bedrock AgentCore | Managed runtime for the Strands SDK agent |
| Bedrock Knowledge Base | Vector search over recipe collection |
| S3 Vectors | Zero-idle-cost vector storage for embeddings |
| Amazon S3 | Recipe markdown storage + frontend static hosting |
| CloudFront | CDN, HTTPS, single distribution for frontend + API |
| Lambda | Streaming proxy -- bridges JWT auth to IAM, SigV4 signing |
| WAF | Rate limiting (100 req/5min per IP), bad input protection |
| Amazon Cognito | User authentication (User Pool + Identity Pool) |
| Amazon Polly | Text-to-speech for cooking mode |
| Bedrock LLM | Nova Pro (default) or Claude Sonnet 4 |
| Titan Embed V2 | Embedding model for Knowledge Base |
| Terraform | Infrastructure as code |
| Service | Cost (half month, dev) | Notes |
|---|---|---|
| Bedrock (LLM) | $0.00 | Free tier -- Nova Pro, Titan Embed V2 |
| Bedrock AgentCore | $0.06 | ~6 vCPU-hours, consumption-based |
| S3 (storage + vectors) | $0.02 | Recipes, frontend, embeddings |
| CloudFront | $0.00 | Free tier (1TB transfer/month) |
| Lambda | $0.00 | Free tier (1M requests/month) |
| WAF | $0.00 | Dev usage within free tier |
| Cognito | $0.00 | Free tier (< 50K MAU) |
| Total | ~$0.08 |
S3 Vectors replaces OpenSearch Serverless (~$350/month minimum), making RAG feasible for personal projects.
pip install bedrock-agentcore)Bootstrap requires two passes because Terraform needs the AgentCore runtime ARN, but the agent can't be deployed until the infrastructure (KB, Cognito, S3) exists.
git clone https://github.com/RDarrylR/serverless-family-recipe-assistant.git
cd serverless-family-recipe-assistant
make init # Install Python deps (uv sync)
make install-frontend # Install frontend deps (npm install)
cd infrastructure
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars: set alert_email and aws_profile
# Leave agent_runtime_arn empty and cognito_callback_urls as localhost only
# (CloudFront URL will be added after step 4)
terraform init
terraform apply
cd ..
# One-time X-Ray setup (required for AgentCore observability):
aws xray update-trace-segment-destination --destination CloudWatchLogs
make agent-config # Generate AgentCore YAML from Terraform outputs
make setup-env # Generate .env and frontend/.env from Terraform outputs
# Edit .env:
# - USDA_API_KEY: your USDA FoodData Central API key (free signup)
# - RECIPE_SOURCE_DIR: path to your raw recipe files (PDFs, images, DOCX)
# - ACTIVE_LLM: nova (default), nova-lite, claude, or claude-haiku
make deploy-agent # Deploy agent to AgentCore
# The deploy output prints the agent_runtime_arn (needed for step 4).
# To find AGENT_RUNTIME_ID and MEMORY_ID for .env:
# AGENT_RUNTIME_ID: run "make agent-status" — it's the runtime name
# (e.g., family_recipe_agent-aBcDeFgH)
# MEMORY_ID: grep memory_id agent/.bedrock_agentcore.yaml
# (AgentCore CLI populates this on first deploy)
# Edit .env: set AGENT_RUNTIME_ID and MEMORY_ID with these values
# Edit infrastructure/terraform.tfvars:
# - set agent_runtime_arn from step 3
# - add CloudFront URL to cognito_callback_urls:
# cognito_callback_urls = ["http://localhost:5173", "https://<dist-id>.cloudfront.net"]
# (get the URL from: cd infrastructure && terraform output cloudfront_domain_name)
make apply # Re-apply Terraform (wires Lambda to AgentCore)
make setup-env # Regenerate .env files (preserves your manual values)
# Copy your recipe source files (PDFs, images, DOCX) to the RECIPE_SOURCE_DIR configured in .env
make preprocess # Convert raw recipes to structured markdown via Nova Pro
make sync # Upload to S3 + trigger KB ingestion
make deploy-frontend # Build React app + deploy to S3 + invalidate CloudFront cache
# Create a user (self-signup is disabled by default)
aws cognito-idp admin-create-user \
--user-pool-id $(cd infrastructure && terraform output -raw cognito_user_pool_id) \
--username your@email.com \
--temporary-password 'YourPassword123!' \
--user-attributes Name=email,Value=your@email.com Name=email_verified,Value=true
# Set a permanent password (skip the "change password" prompt on first login)
aws cognito-idp admin-set-user-password \
--user-pool-id $(cd infrastructure && terraform output -raw cognito_user_pool_id) \
--username your@email.com \
--password 'YourPassword123!' \
--permanent
Sign in at the CloudFront URL (from terraform output cloudfront_domain_name).
make serve-frontend # Vite dev server at localhost:5173
+-- agent/ # AgentCore agent (Strands SDK)
| +-- agent.py # Entrypoint - handles SSE streaming
| +-- config.py # LLM model configs (nova, claude, etc.)
| +-- prompts.py # System prompt
| +-- tools/ # search_recipes, calculate_nutrition
| +-- .bedrock_agentcore.yaml.template # AgentCore deployment config template
+-- functions/ # Lambda functions
| +-- chat/index.mjs # Node.js streaming handler (SigV4 -> AgentCore, relays SSE)
+-- frontend/ # React 19 + Vite SPA
| +-- src/
| +-- components/ # AuthScreen, ChatScreen, MessageList, MessageInput
| +-- contexts/ # AuthContext (Cognito auth state provider)
| +-- hooks/ # useAuth, useChat (SSE streaming), useTextToSpeech
+-- infrastructure/ # Terraform modules
| +-- modules/
| +-- storage/ # S3 buckets (recipes, frontend)
| +-- knowledge-base/ # Bedrock KB + S3 Vectors
| +-- auth/ # Cognito user pool + client + identity pool
| +-- api/ # CloudFront + Lambda Function URL + WAF
| +-- alerting/ # SNS alerts
+-- scripts/ # Recipe pipeline
| +-- preprocess_recipes.py # Extract markdown from PDFs/images via Nova Pro
| +-- enrich_nutrition.py # Enrich nutrition data using USDA FoodData Central
| +-- sync_recipes.py # Upload to S3, trigger KB ingestion
| +-- audit_recipes.py # Dedup + quality checks
+-- data/processed/ # Local processed markdown (gitignored)
+-- tests/ # pytest (unit + integration)
+-- docs/ # Agent overview, scripts documentation
+-- diagrams/ # Architecture diagrams (PNG)
# Infrastructure
make plan # Terraform plan
make apply # Terraform apply
make tf-init # Initialize Terraform
make tf-validate # Validate Terraform configuration
# Agent
make deploy-agent # Deploy agent to AgentCore
make agent-status # Check agent deployment status
make agent-invoke PROMPT="..." # Test agent directly
make agent-config # Generate AgentCore YAML from template + Terraform outputs
make setup-env # Generate .env and frontend/.env from Terraform outputs
# Recipe Pipeline
make preprocess # Extract markdown from raw recipes (PDFs, images, DOCX)
make enrich-nutrition # Enrich nutrition with USDA data
make sync # Upload to S3 + trigger KB ingestion
make audit # Find duplicate recipes
# Frontend
make install-frontend # Install frontend dependencies
make serve-frontend # Vite dev server (localhost:5173)
make deploy-frontend # Build + S3 sync + CloudFront cache invalidation
# Code Quality
make test # Run all tests (pytest)
make test-unit # Run unit tests only
make lint # Ruff check
make fmt # Ruff format
The agent supports multiple LLMs, selected via ACTIVE_LLM at deploy time:
| Model | ID | Use Case |
|---|---|---|
nova (default) | us.amazon.nova-pro-v1:0 | General use, free tier |
nova-lite | us.amazon.nova-lite-v1:0 | Faster, cheaper |
claude | us.anthropic.claude-sonnet-4-20250514-v1:0 | Higher quality |
claude-haiku | us.anthropic.claude-3-5-haiku-20241022-v1:0 | Fast and cheap |
If you deploy this, please remember to destroy the infrastructure when you're done to avoid ongoing charges:
cd infrastructure && terraform destroy
Also delete the AgentCore agent runtime via the AgentCore CLI or AWS console.
Darryl Ruggles -- Blog | Bluesky | X | LinkedIn | AWS Community Builder
Join the Believe In Serverless community!
Selected from shared topics, language and repository description—not editorial ratings.
yeongseon /
Dogfood-tested recipes and examples for the Azure Functions Python DX Toolkit
63/100 healthAdamMartinCote /
A simple serverless application to demonstrate the use of AWS Lambda to run python code on schedule
27/100 healthEldan-Talis /
A serverless cooking recipes app built with React + Python (Flask) + AWS
32/100 healthyeongseon /
A DX toolkit for Azure Functions Python: OpenAPI, validation, logging, diagnostics, scaffolding, and recipes.
61/100 healthParth-yangandul /
A serverless pantry manager built with AWS Lambda and Streamlit that tracks item expiry dates and suggests recipes to reduce food waste.
53/100 health