paint-brush
Ukuseshwa KweVector Kuyiqhekeza Kanjani Ikhodi Kuzibalo Zenkontileka nge@datastax
707 ukufundwa
707 ukufundwa

Ukuseshwa KweVector Kuyiqhekeza Kanjani Ikhodi Kuzibalo Zenkontileka

nge DataStax4m2024/12/09
Read on Terminal Reader

Kude kakhulu; Uzofunda

Ukubheka i-application architecture ye-rerichAPI, umhlinzeki wokuhlaziya idatha womkhakha wezezimali odale indlela enembe kakhulu yokuhlonza okungenayo inkokhelo ephindelelayo.
featured image - Ukuseshwa KweVector Kuyiqhekeza Kanjani Ikhodi Kuzibalo Zenkontileka
DataStax HackerNoon profile picture

Ukubheka i-application architecture ye-richAPI, umhlinzeki wezibalo zedatha womkhakha wezezimali odale indlela enembe kakhulu yokuhlonza okufakiwe kwenkokhelo okuphindelelayo.


Kwa- richAPI , besihlala sikholelwa ukuthi izibalo zezezimali kufanele zihlakaniphe futhi zisheshe, ikakhulukazi uma zihlonza izinkokhelo eziphindelelayo ezifihliwe kudatha yokwenziwe. Sakhe isixazululo esishintsha idatha yokwenziwayo eluhlaza ibe yimininingwane esebenzayo ngokufaka i-AI. Isistimu yethu isebenzisa ukushumeka kwe-vector ukuze iqoqe okwenziwayo ibe amaphethini okukhokha aphindelelayo, iqinisekisa ukunemba ngisho noma ukufakwa kwenkokhelo okuphindelelayo kuqukethe umehluko wamagama ocashile.


Kusukela kokubhaliselwe kuya ezinkokhelweni zomshwalense, inkundla yethu iletha imiphumela enokwethenjelwa kuyilapho igcina isivinini kanye nokuqina okudingwa yizinkampani zezezimali.


Lapha, sizobonisa ukuthi siyiklame kanjani i-architecture yethu ukuze ixazulule lezi zinselele, kusukela ekufakweni kwedatha nokushumeka kwe-vector kuye ekuhlanganiseni okwenziwayo kube amaqembu anenjongo. Sizophinde sihlole ukuthi i-AI izisebenzisa kanjani izici ezithuthukile njengosesho lwe-semantic, okuvumela abasebenzisi ukuthi bathole futhi bahlaziye idatha yezezimali kalula.

Okwenziwa Isicelo

i-richAPI ibhekana nenkinga evamile kodwa eyinselele ezinkampanini zezezimali: ukuhlonza izinkokhelo eziphindelelayo, njengokubhaliselwe, emilandweni yokwenziwe yasebhange. Izindlela zendabuko zazinenkinga yokukala futhi ngokuvamile zithembele kumameshini aqondile, zishoda ngomehluko ocashile (isb., “Spotify” vs. “Spotify AB”).


i-richAPI ibhekana nale nkinga ngendlela eqhutshwa yi-AI eletha ukunemba nesivinini. Enhliziyweni yalesi sixazululo kukhona i-DataStax Astra DB , inkundla yesizindalwazi eyakhelwe ukugeleza kokusebenza kwesimanjemanje, okuhlakazekayo, kanye ne-AI.

Izakhiwo

Uhlelo lwe-richAPI's luthatha okwenziwa yibhange okungaphekiwe, likucubungule ekushumekeni, futhi likuhlanganise kube amaphethini okukhokha aphindelelayo - konke kunikwe amandla amandla okusesha ama-vector afana ne-Astra DB. Izakhiwo ziqinisekisa ukulinganisa nokuphendula esigabeni ngasinye, ngisho nangaphansi kwamavolumu aphezulu wedatha.


Nakhu ukugeleza okwenziwe lula kwenqubo:

  1. Ukufakwa kwedatha - Uma okwenziwa yibhange kwamukelwe, i-richAPI backend iyayishicilela emugqeni wemilayezo ukuze icutshungulwe ngendlela efanayo.


  2. Ukudala kokushumeka - Okwenziwayo ngakunye (isb, “Spotify, -10€, 22.10.24”) kuguqulwa kube ivekhtha yezinombolo (isb, [0.12, 0.65, 0.78, ..., 0.23]) kusetshenziswa isici se-Astra DB's vectorize.


  3. Ukugcinwa nokusesha kwe-Vector ku-Astra DB - Okushumekiwe kugcinwa ku-Astra DB, lapho ukusesha okushesha kakhulu kwe-vector kuvumela isistimu ukuthi ithole futhi ihlanganise okwenziwayo okufanayo.


  4. Ukuhlaziywa okujwayelekile - Amaqoqo ayahlaziywa ukuze kutholakale izinkokhelo eziphindelelayo, zizihlukanise njengezivumelwano ezifana ne-“Spotify - isevisi yomculo - nyanga zonke" noma "Umshuwalense wezempilo - Ezempilo - minyaka yonke."


I-Astra DB iqinisekisa ukuthi yonke le nqubo iyahlaziywa futhi iyasabela, ngisho nenani eliphezulu ledatha. Inqubo iphinde ihambisane nezinyathelo zokuphepha zedatha eziqinile ukuze kuqinisekiswe ukuthi abasebenzisi bokugcina kanye nemisebenzi yabo ihlala ingaziwa futhi ivikelekile ekufinyeleleni kwangaphandle.



Ukuqaliswa Kwezobuchwepheshe

Ukuhlanganisa okwenziwayo kube yizinkontileka

Ukwenza ngamaqembu bekulokhu kuyinselelo enkulu. Amathuluzi wangaphambilini ayencike ekufaneni ncamashi (isb, igama lomthengisi noma inani lenkokhelo), ngokuvamile ayehluleka ukuthatha okuhlukile futhi ayephuza ukukala.


Ku-richAPI, sizame ukusesha amaphethini phakathi kwezigidi zemisebenzi enesizindalwazi esivamile esikhathini esidlule, obekuhamba kancane futhi kuthambekele ekubeni namaphutha. Ngisho nokwehluka okuncane kwemininingwane yokwenziwe kwephule i-clustering logic.


Ngoba sisebenzisa i-Astra DB, singakwazi ukugcina okushumekiwe futhi siseshe ngokuphumelelayo okwenziwayo okufanayo, ngisho nokuhluka okuncane kwemininingwane.


Nasi isibonelo: Inkokhelo ebizwa ngokuthi “Spotify AB” ye-€10 ngosuku olulodwa futhi “Spotify” ye-€10 elandelayo ihlelwe kahle njengenkokhelo efanayo ephindaphindayo.

Ukuphatha Amavolumu Edatha Emikhulu

Ngezinkulungwane zemisebenzi ecutshungulwa nsuku zonke, i-rerichAPI idinga isizindalwazi esingakhula kalula sibe sigcina isivinini nokunemba.


Isisekelo se-Astra DB yi-Apache Cassandra, ngakho yakhelwe ukukala. Iphinde ihlanganise nokugeleza komsebenzi kwe-AI, ivumela i-rerichAPI ukuthi igcine imibuzo esheshayo ngaphandle kokuyekethisa ukunemba.

Injini Yokusesha Yokwenziwe

Ngenxa yokuthi okushumekiwe kuthwebula incazelo ewumsuka yemisebenzi, i-rerichAPI ingaphinda isebenzise isici sosesho. Abasebenzisi bangathayipha igama elingukhiye njengokuthi "impilo" ukuze bathole konke okwenziwayo okuhlobene nempilo ngaphandle kokuthembela kumathegi achazwe ngaphambilini noma izigaba.


Uhlelo lukhiqiza ukushumeka embuzweni womsebenzisi futhi lusebenzisa usesho olulula lokufana lisebenzisa i-Astra DB; Ikhono layo lokusesha i-vector lenza lolu hlobo lokusesha kwe-semantic lusheshe futhi lunembile.


Umsebenzisi obhala “impilo,” ngokwesibonelo, uzobona zonke izinkokhelo zamasevisi ahlobene nezempilo, njengomshuwalense noma ubulungu bejimu, ngisho noma amagama omthengisi ehluka.

Esonga

Ukusetshenziswa kwe-richAPI kwe-Astra DB kubonisa ukuthi ubuchwepheshe besizindalwazi obuthuthukisiwe bungaqhuba kanjani ukuqanjwa okusha ekuhlaziyeni kwezezimali. Kusukela ekuhlanganiseni okunembayo kokwenziwe kuye ekunikeni amandla injini yokusesha ye-semantic esezingeni eliphezulu, ukusesha ivektha ye-Astra DB kanye nokuqina kunika amandla i-rerichAPI ukuletha izixazululo ezisheshayo, ezihlakaniphile kumakhasimende ayo.


Ngokuhlanganisa ukugeleza komsebenzi we-AI ngokuqondile ekwakhiweni kwe-Astra DB, i-richAPI ithuthukise ukucutshungulwa kwedatha yezimali futhi yethula amandla amasha abalulekile okuhlaziya inkontileka.


Ngu- Belkacem Berchiche, unjiniyela wokufunda ngomshini, u-richAPI, no-Dieter Flick, unjiniyela wezixazululo, i-DataStax


Funda kabanzi mayelana I-Astra DB futhi richAPI .