Skip to content

Commit 4568d7c

Browse files
sanchitmonga22shubhammalhotra28
authored andcommitted
Refactor RAG terminology to "pipeline" across scripts and source files for consistency. Update comments and logging messages to reflect the change from "backend" to "pipeline". Remove unused React Native package files related to RAG.
1 parent feeee0a commit 4568d7c

94 files changed

Lines changed: 632 additions & 6966 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sdk/runanywhere-commons/scripts/build-android.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ if [ "$BUILD_WHISPERCPP" = "ON" ]; then
723723
done
724724
fi
725725

726-
echo "├── rag/ # RAG backend libraries"
726+
echo "├── rag/ # RAG pipeline libraries"
727727
for ABI in "${ABI_ARRAY[@]}"; do
728728
echo "│ └── ${ABI}/"
729729
echo "│ ├── librac_backend_rag.so"

sdk/runanywhere-commons/scripts/build-ios.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# --backend NAME Build specific backend: llamacpp, onnx, rag, all (default: all)
1616
# - llamacpp: LLM text generation (GGUF models)
1717
# - onnx: STT/TTS/VAD (Sherpa-ONNX models)
18-
# - rag: RAG backend with embeddings and text generation
18+
# - rag: RAG pipeline with embeddings and text generation
1919
# - all: All backends (default)
2020
# --clean Clean build directories first
2121
# --release Release build (default)
@@ -42,7 +42,7 @@
4242
# # Build only ONNX backend (speech-to-text/text-to-speech)
4343
# ./scripts/build-ios.sh --backend onnx
4444
#
45-
# # Build only RAG backend (embeddings + text generation)
45+
# # Build only RAG pipeline (embeddings + text generation)
4646
# ./scripts/build-ios.sh --backend rag
4747
#
4848
# # Build only RACommons (no backends)

sdk/runanywhere-commons/src/features/rag/jni/rac_rag_jni.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* @file rac_backend_rag_jni.cpp
3-
* @brief RunAnywhere Core - RAG Backend JNI Bridge
3+
* @brief RunAnywhere Core - RAG Pipeline JNI Bridge
44
*
5-
* Self-contained JNI layer for the RAG backend.
5+
* Self-contained JNI layer for the RAG pipeline.
66
*
77
* Package: com.runanywhere.sdk.rag
88
* Class: RAGBridge
@@ -89,11 +89,11 @@ Java_com_runanywhere_sdk_rag_RAGBridge_nativeRegister(JNIEnv* env, jclass clazz)
8989
rac_result_t result = rac_backend_rag_register();
9090

9191
if (result != RAC_SUCCESS && result != RAC_ERROR_MODULE_ALREADY_REGISTERED) {
92-
LOGe("Failed to register RAG backend: %d", result);
92+
LOGe("Failed to register RAG pipeline: %d", result);
9393
return static_cast<jint>(result);
9494
}
9595

96-
LOGi("RAG backend registered successfully");
96+
LOGi("RAG pipeline registered successfully");
9797
return RAC_SUCCESS;
9898
}
9999

@@ -106,9 +106,9 @@ Java_com_runanywhere_sdk_rag_RAGBridge_nativeUnregister(JNIEnv* env, jclass claz
106106
rac_result_t result = rac_backend_rag_unregister();
107107

108108
if (result != RAC_SUCCESS) {
109-
LOGe("Failed to unregister RAG backend: %d", result);
109+
LOGe("Failed to unregister RAG pipeline: %d", result);
110110
} else {
111-
LOGi("RAG backend unregistered");
111+
LOGi("RAG pipeline unregistered");
112112
}
113113

114114
return static_cast<jint>(result);

sdk/runanywhere-commons/src/features/rag/rac_rag_pipeline.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ rac_result_t rac_rag_pipeline_create(
8282
bc, llm_service, embeddings_service, false);
8383

8484
if (!pipeline->backend->is_initialized()) {
85-
LOGE("RAG backend failed to initialize");
85+
LOGE("RAG pipeline failed to initialize");
8686
return RAC_ERROR_INITIALIZATION_FAILED;
8787
}
8888

@@ -153,7 +153,7 @@ rac_result_t rac_rag_pipeline_create_standalone(
153153
bc, llm_handle, embed_handle, true);
154154

155155
if (!pipeline->backend->is_initialized()) {
156-
LOGE("RAG backend failed to initialize");
156+
LOGE("RAG pipeline failed to initialize");
157157
return RAC_ERROR_INITIALIZATION_FAILED;
158158
}
159159

sdk/runanywhere-commons/src/features/rag/rag_backend.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,12 @@ bool RAGBackend::add_document(const std::string& text, const nlohmann::json& met
142142
std::vector<SearchResult> RAGBackend::search(const std::string& query_text, size_t top_k) const {
143143
size_t embedding_dimension;
144144
float similarity_threshold;
145-
bool initialized;
146145
const DocumentChunker* chunker;
147146

148147
{
149148
std::lock_guard<std::mutex> lock(mutex_);
150149
embedding_dimension = config_.embedding_dimension;
151150
similarity_threshold = config_.similarity_threshold;
152-
initialized = initialized_;
153151
chunker = chunker_.get();
154152
}
155153

sdk/runanywhere-commons/tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ if(UNIX AND NOT APPLE)
110110
endif()
111111

112112
# =============================================================================
113-
# RAG Backend Tests (GoogleTest)
113+
# RAG Pipeline Tests (GoogleTest)
114114
# =============================================================================
115115

116116
if(RAC_BACKEND_RAG AND TARGET rac_backend_rag)
@@ -127,7 +127,7 @@ if(RAC_BACKEND_RAG AND TARGET rac_backend_rag)
127127
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
128128
FetchContent_MakeAvailable(googletest)
129129

130-
# RAG backend thread safety test
130+
# RAG pipeline thread safety test
131131
add_executable(rac_rag_backend_thread_safety_test
132132
rag_backend_thread_safety_test.cpp
133133
)

sdk/runanywhere-flutter/packages/runanywhere/lib/native/dart_bridge_rag.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
/// LLM and Embeddings services for Retrieval-Augmented Generation.
88
library dart_bridge_rag;
99

10-
import 'dart:convert';
1110
import 'dart:ffi';
1211

1312
import 'package:ffi/ffi.dart';

sdk/runanywhere-kotlin/scripts/build-kotlin.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ copy_jni_libs() {
417417
fi
418418

419419
# =======================================================================
420-
# RAG Module: Backend + JNI bridge
420+
# RAG Pipeline: Native libs + JNI bridge
421421
# =======================================================================
422422
# Copy backend library
423423
if [ -f "${COMMONS_DIST}/rag/${ABI}/librac_backend_rag.so" ]; then

sdk/runanywhere-kotlin/src/jvmAndroidMain/kotlin/com/runanywhere/sdk/public/extensions/RunAnywhere+RAG.jvmAndroid.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*
55
* JVM/Android actual implementations for Retrieval-Augmented Generation (RAG) operations.
6-
* Dispatches to RAG JNI (librac_backend_rag_jni) which calls the C++ rac_rag_* backend.
6+
* Dispatches to RAG JNI (librac_backend_rag_jni) which calls the C++ rac_rag_* pipeline.
77
*
88
* Mirrors Swift RunAnywhere+RAG.swift + CppBridge.RAG exactly.
99
*/
@@ -63,7 +63,7 @@ actual suspend fun RunAnywhere.ragCreatePipeline(config: RAGConfiguration) {
6363
if (!RAGBridge.nativeIsRegistered()) {
6464
val regResult = RAGBridge.nativeRegister()
6565
if (regResult != 0) { // 0 is RAC_SUCCESS
66-
throw IllegalStateException("Failed to register RAG backend. Error code: $regResult")
66+
throw IllegalStateException("Failed to register RAG pipeline. Error code: $regResult")
6767
}
6868
}
6969

@@ -168,7 +168,7 @@ actual suspend fun RunAnywhere.ragQuery(question: String, options: RAGQueryOptio
168168
)
169169

170170
if (jsonString.isBlank()) {
171-
throw IllegalStateException("RAG query failed — empty response from native backend")
171+
throw IllegalStateException("RAG query failed — empty response from native pipeline")
172172
}
173173

174174
ragJson.decodeFromString<RawRAGResult>(jsonString)

sdk/runanywhere-kotlin/src/jvmAndroidMain/kotlin/com/runanywhere/sdk/rag/RAGBridge.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*
55
* RAG Native Bridge
66
*
7-
* Self-contained JNI bridge for the RAG backend module.
8-
* This mirrors the Swift RAGBackend XCFramework architecture.
7+
* Self-contained JNI bridge for the RAG pipeline module.
8+
* This mirrors the Swift RAG pipeline XCFramework architecture.
99
*
1010
* The native library (librac_backend_rag_jni.so) contains:
1111
* - rac_backend_rag_register()
@@ -18,7 +18,7 @@ package com.runanywhere.sdk.rag
1818
import com.runanywhere.sdk.foundation.SDKLogger
1919

2020
/**
21-
* Native bridge for RAG backend registration and pipeline operations.
21+
* Native bridge for RAG pipeline registration and operations.
2222
*
2323
* This object handles loading the RAG-specific JNI library and provides
2424
* JNI methods for backend registration with the C++ service registry,
@@ -83,23 +83,23 @@ object RAGBridge {
8383
// ==========================================================================
8484

8585
/**
86-
* Register the RAG backend with the C++ service registry.
86+
* Register the RAG pipeline with the C++ service registry.
8787
*
8888
* @return 0 (RAC_SUCCESS) on success, error code on failure
8989
*/
9090
@JvmStatic
9191
external fun nativeRegister(): Int
9292

9393
/**
94-
* Unregister the RAG backend from the C++ service registry.
94+
* Unregister the RAG pipeline from the C++ service registry.
9595
*
9696
* @return 0 (RAC_SUCCESS) on success, error code on failure
9797
*/
9898
@JvmStatic
9999
external fun nativeUnregister(): Int
100100

101101
/**
102-
* Check if the RAG backend is registered.
102+
* Check if the RAG pipeline is registered.
103103
*
104104
* @return true if registered
105105
*/

0 commit comments

Comments
 (0)