{"ref":"artifact:miyasuta-cap-bp-rag","page":"/artifacts/miyasuta-cap-bp-rag","json":"/artifacts/miyasuta-cap-bp-rag.json","generated":"2026-10-26","drafted_with_ai":true,"entity":{"id":"miyasuta-cap-bp-rag","name":"cap-bp-rag","artifact_type":"sample","ecosystem":"cap","domain":"ai-and-agents","secondary_domains":["integration-and-messaging"],"origin_ring":"independent","use_as":"reference","description":{"one_line":"An event-driven RAG application: [Cloud Integration](artifact:btp-cloud-integration) embeds a Business Partner event taken off a broker, and the CAP service stores the vector in [SAP HANA Cloud](artifact:btp-hana-cloud) and answers questions from it.","short":"Event-driven RAG app with CAP, Cloud Integration and SAP HANA Cloud","what_it_solves":"Written as a submission to the [May 2026 Developer Challenge](https://community.sap.com/t5/integration-blog-posts/may-2026-developer-challenge-from-events-to-intelligence-building-an-event/ba-p/14386772), so the README carries an architecture diagram and the two flows and no setup steps. Ingestion is split across two systems: [Cloud Integration](artifact:btp-cloud-integration) takes the event off Solace PubSub+, calls OpenAI for an embedding of the text, and posts it to the CAP service's `insert` API, so the application itself neither subscribes to the broker nor embeds on write. The CDS entity carries `textEmbedding: Vector(1536)` beside the business partner's `fullData` and `text`, and the service exposes `BusinessPartners` as insert-only and `BusinessPartnerViewer` as read-only, both without the embedding column. Retrieval sits in two actions on that service: `similaritySearch` sorts rows by `cosine_similarity` against `to_real_vector` of the query embedding, and `ask` hands the ten nearest to a `gpt-4o-mini` completion. The integration flow itself ships as an exported zip under `cpi/`, so what it does is not readable in the repository."},"links":{"repo":"https://github.com/miyasuta/cap-bp-rag"},"compat":{"runtimes":["node"],"deployment":["cf"]},"demonstrates":["capability:retrieval-augmented-generation","capability:event-mesh"],"requires":[{"ref":"artifact:btp-hana-cloud","for":"the vector store: the 1536-dimension embedding column sits there and the similarity search runs there, and the production profile binds the hana database kind","requirement":"required","sources":[{"url":"https://github.com/miyasuta/cap-bp-rag","title":"miyasuta/cap-bp-rag — README","checked":"2026-10-19","quote":"It implements an event-driven Retrieval-Augmented Generation (RAG) application built with the SAP Cloud Application Programming Model (CAP), using SAP HANA Cloud's Vector Engine as the vector store and OpenAI for embeddings and answer generation."},{"url":"https://raw.githubusercontent.com/miyasuta/cap-bp-rag/main/package.json","title":"miyasuta/cap-bp-rag — package.json","checked":"2026-10-08","quote":"\"@cap-js/hana\": \"^2\""}]}],"connects":[{"ref":"artifact:btp-hana-cloud","kind":"data","direction":"outbound","for":"writes the embedding of a Business Partner record and reads the nearest rows back for a question","sources":[{"url":"https://github.com/miyasuta/cap-bp-rag","title":"miyasuta/cap-bp-rag — README, ingestion flow","checked":"2026-10-19","quote":"4. **CAP → SAP HANA Cloud** — store the vector (1536 dimensions)."},{"url":"https://github.com/miyasuta/cap-bp-rag","title":"miyasuta/cap-bp-rag — README, query flow","checked":"2026-10-19","quote":"7. **CAP → SAP HANA Cloud** — run a similarity search via `cosine_similarity`."}]},{"ref":"artifact:btp-cloud-integration","kind":"data","direction":"inbound","for":"the ingestion side calls in: Cloud Integration posts the Business Partner record with the embedding it created for it","sources":[{"url":"https://github.com/miyasuta/cap-bp-rag","title":"miyasuta/cap-bp-rag — README, ingestion flow","checked":"2026-10-19","quote":"3. **Cloud Integration → CAP** — call the `insert` API with the embedding."}]}],"interfaces":[{"key":"insert","name":"insert","kind":"api","direction":"in","for":"take a Business Partner record whose embedding has already been computed outside the application","sources":[{"url":"https://github.com/miyasuta/cap-bp-rag","title":"miyasuta/cap-bp-rag — README, ingestion flow","checked":"2026-10-19","quote":"3. **Cloud Integration → CAP** — call the `insert` API with the embedding."}]},{"key":"ask","name":"ask","kind":"api","direction":"in","for":"take a question and answer it from the stored records","sources":[{"url":"https://github.com/miyasuta/cap-bp-rag","title":"miyasuta/cap-bp-rag — README, query flow","checked":"2026-10-19","quote":"5. **API Client (Postman) → CAP** — call the `ask` API."}]}],"type_properties":{"form":{"value":"reference-application","sources":[{"url":"https://github.com/miyasuta/cap-bp-rag","title":"miyasuta/cap-bp-rag — README","checked":"2026-10-19","quote":"It implements an event-driven Retrieval-Augmented Generation (RAG) application built with the SAP Cloud Application Programming Model (CAP), using SAP HANA Cloud's Vector Engine as the vector store and OpenAI for embeddings and answer generation."}]}},"maintainers":["actor:mio-yasutake"],"contributors":["actor:mio-yasutake"],"provenance":{"discovered_via":[{"source":"source:github-orgs","channel":"miyasuta"}],"first_seen":"2026-10-08"},"drafted_with_ai":true},"effective_normative_relations":[],"readings":{"liveness":[{"label":"Maintenance","tier":"unknown","evidence":"no release data"},{"label":"Continuity","tier":"fair","evidence":"one contributor, personally owned"},{"label":"Repository","tier":"good","evidence":"pushed 2026-05, not archived"}],"compatibility":[{"label":"Declared for","tier":"fair","evidence":"nothing declared"},{"label":"Survived majors","tier":"unknown","evidence":"no release dates"},{"label":"Maintainer's CI","tier":"fair","evidence":"no CI configured"}],"practice":[{"label":"Tests","tier":"good","evidence":"2 test files"},{"label":"Docs","tier":"fair","evidence":"README 2 KB"},{"label":"Changelog","tier":"fair","evidence":"none in the repo"}],"reach":[{"value":null,"unit":"installs/week"},{"value":0,"unit":"watching"}]},"signals":{"crawled_at":"2026-10-25","npm":"not published under this name","stars":0,"forks":0,"open_issues":0,"archived":false,"pushed_at":"2026-05-31","license_spdx":null,"org_owned":false,"default_branch":"main","created_at":"2026-05-29T21:30:04Z","open_prs":0,"tree_truncated":false,"test_files":2,"workflows":0,"other_ci":false,"readme_bytes":1553,"docs_files":0,"changelog":false,"license_file":false,"dts_files":0,"first_commit":"2026-05-27","last_commit":"2026-05-31","commits":10,"contributors":1,"readme_path":"readme.md","readme_sha":"4f3a29fd63d1bb4fe79cc1ae444b541d584f70a5","repo_read":"2026-10-25"},"edges":{"maintainers":[{"ref":"actor:mio-yasutake","name":"Mio Yasutake","json":"/actors/mio-yasutake.json"}],"contributors":[{"ref":"actor:mio-yasutake","name":"Mio Yasutake","json":"/actors/mio-yasutake.json"}],"explained_by":[],"alternative_to_this":[],"needed_by":[],"available_via":[],"parts":[],"add_ons":[],"answered_through_parts":[]}}