Tutorials & How-To

Integrating Pinecone, OpenAI, and Private Data with RAG for Custom AI Applications

Connect Pinecone, OpenAI, and your private data into a custom RAG application, without the integration grind.

Key takeaways

  • Building RAG applications on proprietary data is promising but often requires extensive integration work; Dataworkz offers a no-code, customizable platform so teams can focus on innovation rather than integration, including scaling to many applications and datasets.
  • Setup starts by connecting OpenAI via its API token and Pinecone via its API token, each through their respective configuration screens.
  • When creating the app you name it, select language models (the example uses GPT-3.5 Turbo and GPT-4), then ingest data by uploading PDFs, Word docs, SharePoint, or crawling websites; the example uploads PDFs from an S3 bucket, with GCS and Azure also supported.
  • Chunking and embedding use a "pinecone_ada_002" workflow into a Pinecone index and namespace, while chunk storage uses MongoDB to keep PDF file names and vector IDs so source documents can be retrieved and provided as context.
  • After review and submission, the created vectors appear in the Pinecone namespace and the app is ready for Q&A, returning generated responses with source attribution.
On this pagesections

    Creating Retrieval Augmented Generation applications with Pinecone, OpenAI, and Dataworkz

    While the concept of creating Retrieval Augmented Generation (RAG) products using proprietary data is incredibly promising, the reality can be quite challenging. Developers often find themselves spending countless hours integrating various tools to build even semi-functional applications.

    The real hurdles emerge when it’s time to scale. Imagine needing to develop 50 applications that each interact with thousands of datasets and files. In such scenarios, having a user-friendly, highly customizable platform that requires no coding becomes invaluable. Dataworkz empowers users to seamlessly create and manage their applications, enabling them to focus on innovation rather than integration. With this approach, businesses can harness the full potential of their data with ease, ensuring they remain agile and competitive in a rapidly evolving market.

    First, we’ll connect to our language model using the OpenAI API token. Next, we’ll configure the connection to our vector database with Pinecone. Both steps are straightforward and require just the respective API tokens from OpenAI and Pinecone. Click the highlighted configuration buttons to navigate to the respective configuration screens.

    OpenAI Connection:

    Enter the language model, give it a name, add your API token and enter the desired variables

    Pinecone database connection:

    Give your pinecone connection a name and add the pinecone API token which can be found in your pinecone account under the API page. Save both of these and move on to creating the AI application of your choice.

    Back on the main AI Application page, we can hit ‘Create AI App’

    We will first be prompted to give our application a name, followed by selecting the language model or models of your choice. Here we have selected gpt 3.5 turbo and GPT 4.

    Hit next to move to the ingestion section where we can choose the files that we want to use for the RAG component of our application.

    Since we want to ingest new data, we will select the ‘ingest new data’ option, which will allow us to upload pdfs, word docs, sharepoint, as well as crawling websites.

    In this example, we choose to upload pdf files from an S3 bucket, but you may also upload from GCS and Azure.

    After hitting save, you will see that the target dataset is automatically mapped based on the name of the ai application. If you would like to change this, hit the edit pencil icon next to the Target box.

    When we click ‘Next,’ we’ll proceed to the screen where we can chunk and embed our vectors in Pinecone. We select the ‘pinecone_ada_002’ workflow, add our Pinecone instance and index name, and create a new namespace. For chunk storage, we choose MongoDB where we also keep record of the PDF file names and vector IDs. Doing this ensures we can properly retrieve the source documents and provide the context to the LLM.

    Save our vector storage configuration, and move on to the retrieval review. Here we make sure that we have all of the configuration components we want. If you want to edit the prompt, language models we are using, or query retrieval type hit the edit pencil buttons above the green icons. When ready, hit submit.

    If you look in pinecone, you will see your namespace with the vectors created for the uploaded documents.

    Once this is complete, you will see the application is ready for asking questions. Hit the search button to search your knowledge base. 

    Ask questions related to the documentation that has been uploaded, and retrieve a generated response along with the source attribution.

    The integration of Pinecone, OpenAI, and Dataworkz provides a streamlined pathway for developing Retrieval Augmented Generation applications without the need for extensive coding knowledge. By simplifying the connection and configuration processes, Dataworkz enables users to focus on harnessing their data’s potential rather than getting bogged down in technical complexities.

    With just a few straightforward steps—connecting to your language model, setting up your vector database, and ingesting data—you can create powerful AI applications tailored to your specific needs. As you scale and manage multiple datasets, the ease of use offered by this platform becomes invaluable, allowing for rapid innovation in a competitive landscape.

    By utilizing these tools effectively, businesses can not only enhance their operational agility but also ensure they are well-equipped to leverage their proprietary data for insightful decision-making and improved customer engagement. As you embark on your journey to build impactful RAG applications, remember that with Dataworkz, the power of AI and data is at your fingertips, ready to drive your success in the digital age.

    Frequently asked questions

    What do you need to connect before building the RAG application?

    You connect your language model using the OpenAI API token and configure your vector database with the Pinecone API token. Both steps are straightforward and require just the respective API tokens, accessed through their configuration screens.

    What data sources can you ingest?

    When selecting "ingest new data," you can upload PDFs, Word docs, and SharePoint content, as well as crawl websites. The example uploads PDF files from an S3 bucket, and uploads from GCS and Azure are also supported.

    Why is MongoDB used alongside Pinecone in this setup?

    Vectors are chunked and embedded into Pinecone using the pinecone_ada_002 workflow with an index and namespace, while chunk storage uses MongoDB to keep a record of the PDF file names and vector IDs. This ensures the source documents can be properly retrieved and provided as context to the LLM.

    What does the finished application produce?

    Once configuration is complete and submitted, the app is ready for questions. You search the knowledge base and ask questions related to the uploaded documentation, retrieving a generated response along with source attribution.

    See what your engineers can ship in production

    Dataworkz is the agentic AI platform enterprises trust to put AI agents into production. Teams build production-ready agents in days, every decision stays traceable, and every agent has ROI attached.

    Explore the platform