Skip to content

Commit

Permalink
Merge branch 'main' into feature-1567-AI-Services-provide-information…
Browse files Browse the repository at this point in the history
…-about-executed-tools
  • Loading branch information
dliubarskyi authored Aug 29, 2024
2 parents 6ceb81d + 64c8aa2 commit 094dce2
Show file tree
Hide file tree
Showing 183 changed files with 6,923 additions and 3,320 deletions.
7 changes: 7 additions & 0 deletions .github/langchain4j-github-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,10 @@ triage:
notifyInPullRequest: true
files:
- '*-vertex-*/**'
- id: elasticsearch
labels: [Elasticsearch]
title: "elasticsearch"
notify: [dadoonet]
notifyInPullRequest: true
files:
- '*-elasticsearch-*/**'
9 changes: 5 additions & 4 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
java_version: [ 8, 11, 17, 21 ]
include:
- java_version: '8'
included_modules: '-pl !langchain4j-jlama,!langchain4j-local-ai,!langchain4j-milvus,!code-execution-engines/langchain4j-code-execution-engine-graalvm-polyglot,!langchain4j-cassandra,!langchain4j-infinispan,!langchain4j-neo4j,!langchain4j-opensearch,!langchain4j-azure-ai-search'
included_modules: '-pl !langchain4j-ollama,!langchain4j-jlama,!langchain4j-local-ai,!langchain4j-milvus,!code-execution-engines/langchain4j-code-execution-engine-graalvm-polyglot,!langchain4j-cassandra,!langchain4j-infinispan,!langchain4j-neo4j,!langchain4j-opensearch,!langchain4j-azure-ai-search'
- java_version: '11'
included_modules: '-pl !langchain4j-jlama,!langchain4j-local-ai,!langchain4j-milvus,!code-execution-engines/langchain4j-code-execution-engine-graalvm-polyglot,!langchain4j-infinispan,!langchain4j-neo4j'
included_modules: '-pl !langchain4j-ollama,!langchain4j-jlama,!langchain4j-local-ai,!langchain4j-milvus,!code-execution-engines/langchain4j-code-execution-engine-graalvm-polyglot,!langchain4j-infinispan,!langchain4j-neo4j'
- java_version: '17'
included_modules: '-pl !langchain4j-jlama,!langchain4j-local-ai,!langchain4j-milvus,!code-execution-engines/langchain4j-code-execution-engine-graalvm-polyglot'
included_modules: '-pl !langchain4j-ollama,!langchain4j-jlama,!langchain4j-local-ai,!langchain4j-milvus,!code-execution-engines/langchain4j-code-execution-engine-graalvm-polyglot'
- java_version: '21'
included_modules: '-pl !langchain4j-local-ai,!langchain4j-milvus'
included_modules: '-pl !langchain4j-ollama,!langchain4j-local-ai,!langchain4j-milvus'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -66,6 +66,7 @@ jobs:
NOMIC_API_KEY: ${{ secrets.NOMIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}
OVHAI_AI_API_KEY: ${{ secrets.OVHAI_AI_API_KEY }}
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }}
WEAVIATE_API_KEY: ${{ secrets.WEAVIATE_API_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
NOMIC_API_KEY: ${{ secrets.NOMIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}
OVHAI_AI_API_KEY: ${{ secrets.OVHAI_AI_API_KEY }}
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }}
WEAVIATE_API_KEY: ${{ secrets.WEAVIATE_API_KEY }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@
<artifactId>langchain4j-core</artifactId>
</dependency>

<!-- DEPENDENCY CONFLICT RESOLUTION FOR OKHTTP (START) -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>

<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</dependency>
<!-- DEPENDENCY CONFLICT RESOLUTION FOR OKHTTP (END) -->

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Expand Down Expand Up @@ -86,4 +93,28 @@

</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>enforce</id>
<configuration>
<rules>
<dependencyConvergence/>
</rules>
</configuration>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
45 changes: 23 additions & 22 deletions docs/docs/integrations/embedding-stores/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@ hide_title: false
sidebar_position: 0
---

| Embedding Store | Storing Metadata | Filtering by Metadata | Removing Embeddings |
|---------------------------------------------------------------------------------------|------------------|-----------------------|---------------------|
| [In-memory](/integrations/embedding-stores/in-memory) ||||
| [Astra DB](/integrations/embedding-stores/astra-db) || | |
| [Azure AI Search](/integrations/embedding-stores/azure-ai-search) ||||
| [Azure CosmosDB Mongo vCore](/integrations/embedding-stores/azure-cosmos-mongo-vcore) || | |
| [Azure CosmosDB NoSQL](/integrations/embedding-stores/azure-cosmos-nosql) || | |
| [Cassandra](/integrations/embedding-stores/cassandra) || | |
| [Chroma](/integrations/embedding-stores/chroma) ||||
| [Elasticsearch](/integrations/embedding-stores/elasticsearch) ||||
| [Infinispan](/integrations/embedding-stores/infinispan) || | |
| [Milvus](/integrations/embedding-stores/milvus) ||||
| [MongoDB Atlas](/integrations/embedding-stores/mongodb-atlas) || | |
| [Neo4j](/integrations/embedding-stores/neo4j) || | |
| [OpenSearch](/integrations/embedding-stores/opensearch) || | |
| [PGVector](/integrations/embedding-stores/pgvector) ||||
| [Pinecone](/integrations/embedding-stores/pinecone) ||||
| [Qdrant](/integrations/embedding-stores/qdrant) || | |
| [Redis](/integrations/embedding-stores/redis) || | |
| [Vearch](/integrations/embedding-stores/vearch) || | |
| [Vespa](/integrations/embedding-stores/vespa) | | | |
| [Weaviate](/integrations/embedding-stores/weaviate) || ||
| Embedding Store | Storing Metadata | Filtering by Metadata | Removing Embeddings |
|---------------------------------------------------------------------------------------|------------------|----------------------------|---------------------|
| [In-memory](/integrations/embedding-stores/in-memory) ||||
| [Astra DB](/integrations/embedding-stores/astra-db) || | |
| [Azure AI Search](/integrations/embedding-stores/azure-ai-search) ||||
| [Azure CosmosDB Mongo vCore](/integrations/embedding-stores/azure-cosmos-mongo-vcore) || | |
| [Azure CosmosDB NoSQL](/integrations/embedding-stores/azure-cosmos-nosql) || | |
| [Cassandra](/integrations/embedding-stores/cassandra) || | |
| [Chroma](/integrations/embedding-stores/chroma) ||||
| [Elasticsearch](/integrations/embedding-stores/elasticsearch) ||||
| [Infinispan](/integrations/embedding-stores/infinispan) || | |
| [Milvus](/integrations/embedding-stores/milvus) ||||
| [MongoDB Atlas](/integrations/embedding-stores/mongodb-atlas) || Only native filter support | |
| [Neo4j](/integrations/embedding-stores/neo4j) || | |
| [OpenSearch](/integrations/embedding-stores/opensearch) || | |
| [Oracle](/integrations/embedding-stores/oracle) ||||
| [PGVector](/integrations/embedding-stores/pgvector) ||||
| [Pinecone](/integrations/embedding-stores/pinecone) ||||
| [Qdrant](/integrations/embedding-stores/qdrant) || | |
| [Redis](/integrations/embedding-stores/redis) || | |
| [Vearch](/integrations/embedding-stores/vearch) || | |
| [Vespa](/integrations/embedding-stores/vespa) | | | |
| [Weaviate](/integrations/embedding-stores/weaviate) || ||
90 changes: 90 additions & 0 deletions docs/docs/integrations/embedding-stores/oracle.md
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).
2 changes: 1 addition & 1 deletion docs/docs/integrations/embedding-stores/pgvector.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 13
sidebar_position: 14
---

# PGVector
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/integrations/embedding-stores/pinecone.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 14
sidebar_position: 15
---

# Pinecone
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/integrations/embedding-stores/qdrant.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 15
sidebar_position: 16
---

# Qdrant
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/integrations/embedding-stores/redis.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 16
sidebar_position: 17
---

# Redis
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/integrations/embedding-stores/vearch.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 17
sidebar_position: 18
---

# Vearch
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/integrations/embedding-stores/vespa.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 18
sidebar_position: 19
---

# Vespa
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/integrations/embedding-stores/weaviate.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 19
sidebar_position: 20
---

# Weaviate
Expand Down
Loading

0 comments on commit 094dce2

Please sign in to comment.