Reputation: 1
When I explore RAGStack, I read this statement:
"RAGStack provides several abstractions to improve developer productivity and system performance, including orchestration and prompt templates, unstructured data store abstraction, natural language to structured query abstraction, agent memory abstraction, and LLM caching abstraction."
I am seeking a reliable reference to understand the various abstractions in RAGStack. However, I couldn't find any reference documents regarding this. Can anyone please share a document link for this, if available?
Upvotes: -1
Views: 49
Reputation: 16313
If you've been building Gen AI apps the last few months then you'd know that you need to install several Python packages for RAG use cases.
A common RAG workflow for a document Q&A app involves:
Then when a user asks a question:
As you can imagine, all these steps require lines and lines of code to implement. But with RAGStack, all it takes is just a few lines of code.
To load all the documents from a directory requires just one line of code using LlamaIndex's SimpleDirectoryReader
:
documents = SimpleDirectoryReader('data').load_data()
To create and initialise a vector store backed by Apache Cassandra:
cassandra_store = CassandraVectorStore(table='ragdemo', embedding_dimension=1536)
storage_context = StorageContext.from_defaults(vector_store=cassandra_store)
With this single line of code (1) the documents are split into chunks, (2) vector embeddings are generated (using OpenAI by default, configurable to use other LLMs), and (3) both embeddings and document chunks are stored in the vector DB:
index = VectorStoreIndex.from_documents(documents, storage_context=storage_context)
And finally with just these 2 lines of code (4) generate an embedding for the user's question, (5) retrieve the documents from the vector DB, (6) generate the prompt for the LLM, (7) post the query to the LLM for a response:
query_engine = index.as_query_engine()
response = query_engine.query("What is vector search?")
You can checkout the full working code in my blog post on the DataStax website -- Test Drive Vector Search with DataStax Enterprise 6.9 and RAGStack. Full disclosure: I'm an Apache Cassandra committer and I work at DataStax.
Hopefully in this simple Document Q&A example, you would see how much abstraction is baked into RAGStack and how it makes it so much easier to build RAG applications.
For more details, see the official RAGStack docs. Cheers!
Upvotes: 0