forked from langchain4j/langchain4j
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature-1567-AI-Services-provide-information…
…-about-executed-tools
- Loading branch information
Showing
183 changed files
with
6,923 additions
and
3,320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
--- | ||
sidebar_position: 13 | ||
--- | ||
|
||
# Oracle | ||
The Oracle Embedding Store integrates with | ||
the [AI Vector Search Feature](https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/overview-ai-vector-search.html) of Oracle Database. | ||
|
||
## Maven Dependency | ||
|
||
```xml | ||
<dependency> | ||
<groupId>dev.langchain4j</groupId> | ||
<artifactId>langchain4j-oracle</artifactId> | ||
<version>0.34.0</version> | ||
|
||
</dependency> | ||
``` | ||
|
||
## APIs | ||
|
||
- `OracleEmbeddingStore` | ||
|
||
|
||
## Examples | ||
|
||
- [OracleEmbeddingStoreExample](https://github.com/langchain4j/langchain4j-examples/blob/main/oracle-example/src/main/java/OracleEmbeddingStoreExample.java) | ||
|
||
## Usage | ||
|
||
Instances of this store can be created by configuring a builder. The builder | ||
requires that a DataSource and an embedding table be provided. The distance | ||
between two vectors is calculated using [cosine similarity](https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/cosine-similarity.html) | ||
which measures the cosine of the angle between two vectors. | ||
|
||
It is recommended to configure a DataSource which pools connections, such as the | ||
Universal Connection Pool or Hikari. A connection pool will avoid the latency of | ||
repeatedly creating new database connections. | ||
|
||
If an embedding table already exists in your database provide the table name. | ||
|
||
```java | ||
EmbeddingStore embeddingStore = OracleEmbeddingStore.builder() | ||
.dataSource(myDataSource) | ||
.embeddingTable("my_embedding_table") | ||
.build(); | ||
``` | ||
|
||
If the table does not already exist, it can be created by passing a CreateOption | ||
to the builder. | ||
|
||
```java | ||
EmbeddingStore embeddingStore = OracleEmbeddingStore.builder() | ||
.dataSource(myDataSource) | ||
.embeddingTable("my_embedding_table", CreateOption.CREATE_IF_NOT_EXISTS) | ||
.build(); | ||
``` | ||
|
||
By default the embedding table will have the following columns: | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| id | VARCHAR(36) | Primary key. Used to store UUID strings which are generated when the embedding store | | ||
| embedding | VECTOR(*, FLOAT32) | Stores the embedding | | ||
| text | CLOB | Stores the text segment | | ||
| metadata | JSON | Stores the metadata | | ||
|
||
If the columns of your existing table do not match the predefined column names | ||
or you would like to use different column names, you can use a EmbeddingTable | ||
builder to configure your embedding table. | ||
|
||
```java | ||
OracleEmbeddingStore embeddingStore = | ||
OracleEmbeddingStore.builder() | ||
.dataSource(myDataSource) | ||
.embeddingTable(EmbeddingTable.builder() | ||
.createOption(CREATE_OR_REPLACE) // use NONE if the table already exists | ||
.name("my_embedding_table") | ||
.idColumn("id_column_name") | ||
.embeddingColumn("embedding_column_name") | ||
.textColumn("text_column_name") | ||
.metadataColumn("metadata_column_name") | ||
.build()) | ||
.build(); | ||
``` | ||
|
||
The builder provides two other methods that allow to create an index on the | ||
embedding column and configure the use of exact or approximate search. | ||
|
||
For more information about Oracle AI Vector Search refer to the [documentation](https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/overview-ai-vector-search.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 13 | ||
sidebar_position: 14 | ||
--- | ||
|
||
# PGVector | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 14 | ||
sidebar_position: 15 | ||
--- | ||
|
||
# Pinecone | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 15 | ||
sidebar_position: 16 | ||
--- | ||
|
||
# Qdrant | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 16 | ||
sidebar_position: 17 | ||
--- | ||
|
||
# Redis | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 17 | ||
sidebar_position: 18 | ||
--- | ||
|
||
# Vearch | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 18 | ||
sidebar_position: 19 | ||
--- | ||
|
||
# Vespa | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 19 | ||
sidebar_position: 20 | ||
--- | ||
|
||
# Weaviate | ||
|
Oops, something went wrong.