FAQs for Knowledge Base
Use a knowledge base to add corporate knowledge to your automations.
What is a RAG knowledge base and how does it work?
A RAG knowledge base is a collection of documents that you give to a Large Language Model (LLM) to search and find relevant information.
When you create a knowledge base, a knowledge base is created along with additional artifacts: ready-to-use integrations, connections, AI agent with specific guidelines for knowledge bases, agentic AI tool with specific guidelines for knowledge bases, and agentic AI pattern optimized for knowledge bases.
Here's how knowledge bases work in Oracle Integration:
Ingestion - getting your documents into the knowledge base
- You drag and drop documents into your knowledge base.
- The KnowledgeBaseUploadAndIngestFiles integration runs in the background to support this.
- Documents are split into chunks, and the selected embedding model is used to compute vector embeddings for each chunk before the chunks are uploaded into the OCI Search with OpenSearch knowledge base.
- You upload PDF or text documents into an Oracle Cloud Infrastructure Object Storage bucket.
- You run the ObjectStoreKnowledgeBaseIngestion integration to ingest documents from the OCI Object Storage bucket into the OCI Search with OpenSearch knowledge base. You can also schedule this integration to run periodically to ingest documents from OCI Object Storage.
- Documents are split into chunks, and the selected embedding model is used to compute vector embeddings for each chunk before the chunks are uploaded into the OCI Search with OpenSearch knowledge base.
-
To perform a search, you run the KnowledgeBaseSearch integration and specify your query.
Types of searches:
- Text search: supports both BM25 keyword search and phrase search for exact matches. You could use this for finding specific order numbers, person names, or any other precise terminology.
- Semantic search: searches based on meaning.
- Hybrid search: searches both exact match and meaning.
What determines whether a document is ingested into the knowledge base from OCI Object Storage?
By default, the document file name is used for identifying the document. To compare the contents of the document, the hash of the document is used.
The document ingestion strategy selected in the RAG ingest action in the ObjectStoreKnowledgeBaseIngestion integration determines whether a document is ingested:
-
Replace: This is the default behavior. Only new or changed documents in the OCI Object Storage bucket are ingested. If a document has already been ingested, it is not ingested again unless it has been updated. If the document has been updated, it's replaced in OCI Search with OpenSearch.
Tip:
A simple way to manage versions is to add the version number to the document file name such as mydocument_v1, mydocument_v2. This allows you to easily have multiple versions of a document in the knowledge base. -
Append: This strategy is primarily designed for documents pushed through a REST trigger such as incident reports sent with attachments instead of documents from OCI Object Storage. Every time the integration runs, the documents are ingested as new entries. If this strategy is used with OCI Object Storage, every file in the bucket is ingested every time the integration runs. This means that if a file remains in the bucket, it will be re-ingested repeatedly, resulting in duplicate entries with the same name within the OCI Search with OpenSearch knowledge base.
- Replace versioned: Requires the document version to be mapped in the RAG ingest action of the ObjectStoreKnowledgeBaseIngestion integration.
- If no version is provided for a document, same behavior as Replace.
- If a version is provided for a document:
- If the document name, version, and hash values are the same as that of a document in the knowledge base, do not ingest the document.
- If the document name and version are the same but the hash values are different, delete the existing document from the knowledge base and ingest the new document.
- If the document name is the same but the specified version is different, ingest the new document into the knowledge base. This allows for multiple versions of the same document to be ingested.
- If no version was provided for a document when it was ingested, but then a version is provided for the same document, this is considered as two different documents.
How many knowledge bases can I have per project?
You can have one knowledge base per project.
What types of storage are supported for the knowledge base?
For temporary storage to upload your documents for ingestion, OCI Object Storage.
For the knowledge base database, OCI Search with OpenSearch version 2.19 or higher.
Why is the embedding model grayed out when I try to change it for my knowledge base?
If your knowledge base contains documents, you will not be able to change the embedding model as it will be grayed out. This is because all existing document chunks were vectorized using that specific model. Switching to a different model creates a mathematical mismatch, making it impossible for the system to compare your new queries against the old vectors.
To change models, delete all documents in the knowledge base, then change the embedding model. If you want to compare how different models perform, create separate knowledge bases.