Multilingual knowledge search service
- AWS Lambda
- API Gateway
- Amazon Bedrock
- Bedrock Knowledge Bases
- Bedrock Guardrails
- DynamoDB
- CloudWatch
- CloudFront
One embedding space instead of one index per language. That single choice is why adding a language here is a content problem, not a project.
A production RAG service over brand documentation, built end to end: retrieval, generation, guardrails, caching, and the analytics to prove it earns its place. Ask a question in English, French, or Spanish and it returns a grounded answer with source citations. A two-layer cache (exact-match and semantic) on DynamoDB sits in front of retrieval, so an identical or reworded question comes back in a fraction of the time and skips the model call entirely, which cuts cost and latency. Rate limiting and request guardrails protect the entry point, CloudWatch instruments the whole path, and a feedback-analytics dashboard gives the team a live read on whether answers are actually helping people. I owned the architecture, the API, and both ends of the stack.
Requestrate-limited, language + brand
Input guardprompt-attack, PII, topics
blockedleads torephrase
Cachehashed lookup
hitleads toskip retrieval
Retrievalmultilingual embeddings
no matchleads toescalate
Generategrounded in context only
Output guardgrounding + content check
ungroundedleads tofallback
Responseanswer + source citations
- Cut repeat-query cost and latency with a two-layer cache that skips the model call
- Scored retrieval and grounding on a fixed evaluation set to catch regressions early
- Hardened end to end with unit and adversarial suites covering injection, PII, and off-domain queries
- Built a feedback-analytics dashboard to measure real impact on users
- Projected 100 engineering hours saved once live
- Projected $1M+ annual savings; architected to serve millions of customers
Read the engineering decisionsHide details
How one index serves three languages
The embedding model is multilingual, so a question asked in French and a passage written in English land close together in the same vector space. That means no translation step, no separate index per language, and one retrieval call regardless of what was asked. The model answers in whatever language the question arrived in. Adding a language means adding content; the system stays the same.
How answers stay scoped to the right brand
Brand comes from the request origin; the client never gets to set it. A caller cannot reach another brand's content by changing a parameter. Every document carries its brand as metadata set at ingestion time, and retrieval filters on that tag. One index serves all brands, and onboarding a new one is a data change with no new deployment.
Why the response is checked twice
Filtering the request is not the same as trusting the response. The input pass rejects prompt attacks and sensitive data before anything reaches the model. The output pass verifies the answer is actually supported by the retrieved passages. Anything ungrounded becomes a handoff.




