Knowledge Bases
knowledge_bases
Methods
Description
Creates an EGP knowledge base.
Details
A knowledge base is a storage device for all data that needs to be accessible to EGP models. Users can upload data from a variety of data sources into a knowledge base, and then query the knowledge base for chunks that are semantically relevant to the query.
Every knowledge base must be associated with a fixed embedding model. This embedding model will be used to embed all data that is stored in the knowledge base. The embedding model cannot be changed once the knowledge base is created. Only the embedding models in the dropdown menu below are supported.
Differences from V1
- V1 data ingestion consisted of knowledge bases, vector stores, and data connectors. V1 Knowledge bases interacted with natural language, V1 vector stores interacted with chunks and embeddings, and V1 data connectors set up automatic ingestion pipelines with third party data sources.
- In V2, all data ingestion is done through knowledge bases. Low level configuration such as chunking strategies and data sources are now handled by this unified knowledge base v2 upload API.
- The way data is stores in V2 allows for better observability on the ingestion progress and content of the knowledge base.
- Reliability and scalability is also improved via distributed temporal workflows.
Backwards Compatibility
V2 and V1 Knowledge Bases are entirely separate and not backwards compatible. Users who have existing V1 knowledge bases will need to migrate their data to V2 knowledge bases.
Description
Deletes a knowledge base.
Details
This API can be used to delete a knowledge base by ID. To use this API, pass in the knowledge_base_id that was returned from your Create Knowledge Base API call as a path parameter.
Backwards Compatibility
V2 and V1 Knowledge Bases are entirely separate and not backwards compatible. Users who have existing V1 knowledge bases will need to migrate their data to V2 knowledge bases.
Description
Lists all knowledge bases owned by the authorized user.
Details
This API can be used to list all knowledge bases that have been created by the user. This API will return the details of all knowledge bases including their IDs, names, the embedding models they use, any metadata associated with the knowledge bases, and the timestamps for their creation, last-updated time.
Backwards Compatibility
V2 and V1 Knowledge Bases are entirely separate and not backwards compatible. Users who have existing V1 knowledge bases will need to migrate their data to V2 knowledge bases.
Description
Query a knowledge base for text chunks that are most semantically relevant to the query.
Details
Given a query expressed as an embedding, this API runs a similarity search amongst the embeddings indexed in the knowledge base to find the most relevant chunk embeddings. To use this API, specify the knowledge_base_id of the knowledge base you want to query, pass in the natural language query that you want to search for, specify the value top_k, which is the number of similar chunks that will be returned, and specify whether you want the returned chunks to include_embeddings.
Similarity search is used to efficiently find, retrieve, and rank chunks based on their similarity to a given query, which is also expressed as an embedding. Similarity scores ( using the cosine similarity metric) are calculated between each chunk embedding and the embedded query, and the chunks are ranked based on similarity score. The top-ranked chunks are returned as the query results.
We are using the Hierarchical Navigable Small World (HNSW) algorithm to perform a k nearest neighbors search in the vector space. This algorithm returns an estimate of the best k nearest neighbors and is optimized for datasets with hundreds of thousands of vectors. You can read more about the specifics of this algorithm here.
Backwards Compatibility
V2 and V1 Knowledge Bases are entirely separate and not backwards compatible. Users who have existing V1 knowledge bases will need to migrate their data to V2 knowledge bases.
Description
Gets the details of a knowledge base.
Details
This API can be used to get information about a single knowledge base by ID. To use this API, pass in the knowledge_base_id that was returned from your Create Knowledge Base API call as a path parameter.
This API will return the details of a knowledge base including its ID, name, the embedding model it uses, any metadata associated with the knowledge base, and the timestamps for its creation, last-updated time.
Backwards Compatibility
V2 and V1 Knowledge Bases are entirely separate and not backwards compatible. Users who have existing V1 knowledge bases will need to migrate their data to V2 knowledge bases.
Patch Knowledge Base
Submit Upload Job with local files
Domain types
Artifacts
knowledge_bases.artifacts
Methods
Batch Delete Locally Stored Artifacts
Delete Locally Stored Artifact
Description
List all artifacts tracked by a knowledge base.
Details
This API can be used to list all artifacts that are currently tracked in a knowledge base. This API will return the details of all artifacts including their IDs, names, the source they originated from, their current upload statuses, and the timestamps for their creation and last-updated time.
This list should be consistent with the state of the data source at the time of start of the latest upload. If the state is not consistent, create a new upload to update the knowledge base to reflect the latest state of the data source.
Description
Gets the details of an artifact tracked by a knowledge base.
Details
This API can be used to get information about a single artifact by ID. This response will contain much more detail about the artifact than show in the List Artifacts API call. To use this API, pass in the knowledge_base_id and artifact_id that were returned from your List Artifacts API call as path parameters.
Compatibility with V1
V2 and V1 Knowledge Bases are entirely separate and not backwards compatible. Users who have existing V1 knowledge bases will need to migrate their data to V2 knowledge bases.
Patch Artifact Information
Domain types
Async Jobs
knowledge_bases.async_jobs
Methods
List Upload Jobs
Chunks
knowledge_bases.chunks
Methods
Description
Get chunks from a knowledge base using chunk IDs or a matching metadata field
### Details
This API can be used to get a list of chunks from a knowledge base. Given a chunk id, a metadata field and value, or both, matching chunks are searched for in the knowledge base given by knowledge base id.
Data Source Connections
knowledge_bases.data_source_connections
Methods
Delete Knowledge Base Data Source Connection
Domain types
Upload Schedules
knowledge_bases.upload_schedules
Methods
Description
Creates a upload schedule
Details
This API can be used to create a upload schedule. To use this API, review the request schema and pass in all fields that are required to create a upload schedule.
Description
Deletes a upload schedule
Details
This API can be used to delete a upload schedule by ID. To use this API, pass in the id that was returned from your Create Upload Schedule API call as a path parameter.
Description
Lists all upload schedules accessible to the user.
Details
This API can be used to list upload schedules. If a user has access to multiple accounts, all upload schedules from all accounts the user is associated with will be returned.
Description
Gets the details of a upload schedule
Details
This API can be used to get information about a single upload schedule by ID. To use this API, pass in the id that was returned from your Create Upload Schedule API call as a path parameter.
Review the response schema to see the fields that will be returned.
Description
Updates a upload schedule
Details
This API can be used to update the upload schedule that matches the ID that was passed in as a path parameter. To use this API, pass in the id that was returned from your Create Upload Schedule API call as a path parameter.
Review the request schema to see the fields that can be updated.
Domain types
Uploads
knowledge_bases.uploads
Methods
Cancel Upload Job
Submit Upload Job
Description
List all uploads for a knowledge base.
Details
This API can be used to list all uploads that have been created for a knowledge base. This API will return the details of all uploads including their IDs, their statuses, the data source configs they use, the chunking strategy configs they use, and the timestamps for their creation and last-updated time.
Backwards Compatibility
V2 and V1 Knowledge Bases are entirely separate and not backwards compatible. Users who have existing V1 knowledge bases will need to migrate their data to V2 knowledge bases.
Get Upload Job
Domain types