Commit Graph

838 Commits

Author SHA1 Message Date
LangChain4j 8421e56a1b Docu: added diagrams for RAG 2024-02-09 11:39:01 +01:00
LangChain4j 8dc5af622c
Docu: added diagrams and examples for RAG (#619) 2024-02-09 11:31:24 +01:00
LangChain4j b6ff37377a Docu: started documenting AI Services 2024-02-09 10:58:01 +01:00
LangChain4j 37b78f232b Docu: renaming 2024-02-09 10:57:43 +01:00
LangChain4j a22d297104
Release 0.27.0 (#615) 2024-02-09 08:00:34 +01:00
Katia Aresti 7d89ea229e
First Infinispan Integration / Langchain (#552)
This is the first implementation of Infinispan as Embeddings Store for
langchain
The current version is 15.0.0.Dev07, which will be in a final release in
a few weeks time

closes #553

Example https://github.com/langchain4j/langchain4j-examples/pull/42
2024-02-08 11:15:07 +01:00
LangChain4j dc4028b546 Docu: response streaming 2024-02-08 09:22:29 +01:00
LangChain4j d61f9c7d9d Docu: model parameters 2024-02-08 09:22:29 +01:00
LangChain4j 49307755be Docu: all available model types 2024-02-08 09:22:29 +01:00
LangChain4j 7d54651f19 Docu: fixes 2024-02-08 09:22:29 +01:00
Carlos Zela Bueno 9ad53fd61d
[Docs] Summary table of the integration capabilities (#609)
Hi @LizeRaes 
- Updated main `README.md` to add summary table
- Updated integration overview table + current capabilities
documentation.
   https://langchain4j.github.io/langchain4j/docs/integrations/

This is in reference to
https://github.com/langchain4j/langchain4j/discussions/565

PS: Updated as of February 5, probably requires double checking to make
sure all checks are up to date. Anyway, the main idea is that this table
is updated frequently according to contributions :)

---------

Co-authored-by: LangChain4j <langchain4j@gmail.com>
Co-authored-by: Lize Raes <49833622+LizeRaes@users.noreply.github.com>
2024-02-07 17:54:21 +01:00
LangChain4j b36315056e Docu: added more info on ChatLanguageModel API and ChatMemory 2024-02-07 10:45:19 +01:00
Amith Koujalgi 31f0da6e94
Docs updates (#599)
- Updated docs GH workflow to build and publish javadoc alongside of
docs directory. This would make the docs available at
https://langchain4j.github.io/langchain4j and javadoc at
https://langchain4j.github.io/langchain4j/apidocs/index.html
- Updated javadoc build command in docs GH workflow to do a full project
build (that includes all modules and no exclusions).
- Updated javadoc build in docs GH workflow to run with Java 21 version.

This is in reference to
https://github.com/langchain4j/langchain4j/discussions/596

---------

Co-authored-by: Lize Raes <49833622+LizeRaes@users.noreply.github.com>
2024-02-06 11:13:41 +01:00
LangChain4j 34865af810 Docu: added more info on ChatLanguageModel API 2024-02-06 09:06:42 +01:00
LangChain4j cf684e9ed0 added example of returning POJOs to docu 2024-02-05 10:02:33 +01:00
LangChain4j 840080899c added examples of using embedding stores to docu 2024-02-05 10:02:23 +01:00
LangChain4j 50a617b11b added documentation on LanguageModel vs ChatLanguageModel 2024-02-05 09:54:09 +01:00
LangChain4j 96766f684b added features to documentation 2024-02-05 09:33:58 +01:00
LangChain4j 184348e947 added Useful Materials 2024-02-03 18:07:30 +01:00
LangChain4j b625dbcfe1 typo 2024-02-03 18:07:30 +01:00
LangChain4j f17f8349ac Docu: updates 2024-02-02 10:01:08 +01:00
LangChain4j 2b461a9b1a updated doc 2024-02-02 00:57:42 +01:00
LangChain4j 3014776f90 updated doc 2024-02-02 00:56:20 +01:00
LangChain4j 057730bc7b fix button link 2024-02-01 09:19:15 +01:00
LangChain4j 55a3d9060b fixed "Unexpected character `3` (U+0033) before name, expected a character that can start a name, such as a letter, `$`, or `_`" 2024-02-01 09:09:47 +01:00
LangChain4j 59eab0cecb Docu: updated introduction 2024-02-01 09:00:59 +01:00
LangChain4j fca8ca48f7 bump version to 0.27.0-SNAPSHOT 2024-01-30 16:18:40 +01:00
LangChain4j 3958e01738
release 0.26.1 (#570) 2024-01-30 16:11:21 +01:00
LangChain4j a8ad9e48d9
Automate release (#562) 2024-01-30 07:20:20 +01:00
K. Siva Prasad Reddy 0eeb0340a0
Correcting the code snippets in the docs (#566) 2024-01-30 04:57:03 +01:00
LangChain4j 14fb985de0
Foundation for advanced RAG (#538)
So far, LangChain4j had only a simple (a.k.a., naive) RAG
implementation: a single `Retriever` was invoked on each interaction
with the LLM, and all retrieved `TextSegments` were appended to the end
of the `UserMessage`. This approach was very limiting.

This PR introduces support for much more advanced RAG use cases. The
design and mental model are inspired by [this
article](https://blog.langchain.dev/deconstructing-rag/) and [this
paper](https://arxiv.org/abs/2312.10997), making it advisable to read
the article.

This PR introduces a `RetrievalAugmentor` interface responsible for
augmenting a `UserMessage` with relevant content before sending it to
the LLM. The `RetrievalAugmentor` can be used with both `AiServices` and
`ConversationalRetrievalChain`, as well as stand-alone.

A default implementation of `RetrievalAugmentor`
(`DefaultRetrievalAugmentor`) is provided with the library and is
suggested as a good starting point. However, users are not limited to it
and can have more freedom with their own custom implementations.

`DefaultRetrievalAugmentor` decomposes the entire RAG flow into more
granular steps and base components:
- `QueryTransformer`
- `QueryRouter`
- `ContentRetriever` (the old `Retriever` is now deprecated)
- `ContentAggregator`
- `ContentInjector`

This modular design aims to separate concerns and simplify development,
testing, and evaluation. Most (if not all) currently known and proven
RAG techniques can be represented as one or multiple base components
listed above.

Here is how the decomposed RAG flow can be visualized:

![advanced-rag](https://github.com/langchain4j/langchain4j/assets/132277850/b699077d-dabf-4768-a241-3fcd9ab0286c)

This mental and software model aims to simplify the thinking, reasoning,
and implementation of advanced RAG flows.

Each base component listed above has a sensible and simple default
implementation configured in `DefaultRetrievalAugmentor` by default but
can be overridden by more sophisticated implementations (provided by the
library out-of-the-box) as well as custom ones. The list of
implementations is expected to grow over time as we discover new
techniques and implement existing proven ones.

This PR also introduces out-of-the-box support for the following proven
RAG techniques:
- Query expansion
- Query compression
- Query routing using LLM
- [Reciprocal Rank
Fusion](https://learn.microsoft.com/en-us/azure/search/hybrid-search-ranking)
- Re-ranking ([Cohere Rerank](https://docs.cohere.com/docs/reranking)
integration is coming in a [separate
PR](https://github.com/langchain4j/langchain4j/pull/539)).
2024-01-26 16:25:24 +01:00
Lize Raes 283107c8ce
add logging and model parameter tutorials to docu (#536)
Adding Model Parameter Setting tutorial and Logging explanation to
documentation
2024-01-24 08:28:45 +01:00
Lize Raes 88153721aa
action to build and publish javadoc to pages (#504)
Adds the following:

 * add maven plugin for generating javadoc 
 * action to build and publish javadoc to pages
 * update javadoc link in docusaurus
2024-01-12 12:50:44 +01:00
Amith Koujalgi aba5eeb925
Docu logos and domain (#503)
@LizeRaes Updated the images for the docs home page 🙂

Just had to convert the PNGs into SVGs as the `Svg` tag takes only image
as SVG.

---------

Co-authored-by: LizeRaes <49833622+LizeRaes@users.noreply.github.com>
2024-01-11 20:37:16 +01:00
Amith Koujalgi 7e42166109
Updated Docs (#500)
- Updated subpage 0 to `Overview` and made it the landing page upon
clicking `Tutorials` from the horizontal/navigation/top bar.
- Set up GitHub action to build and publish the docs to the GitHub pages
on release. [Preview](https://amithkoujalgi.github.io/langchain4j/) of
the docs on GitHub pages. This action/workflow can also be triggered
manually.
- Added content to `/integrations/language-models/ollama`

PS:
If GitHub pages has been enabled in the repository, the repo admin
should be able to run the new GitHub workflow/action in the Actions tab
and after the completion of the workflow, the docs should be available
in the link provided by GitHub (or a specified custom domain).
2024-01-11 09:04:38 +01:00
dependabot[bot] 93ff2f97f3
Bump follow-redirects from 1.15.3 to 1.15.4 in /docs (#480)
Bumps
[follow-redirects](https://github.com/follow-redirects/follow-redirects)
from 1.15.3 to 1.15.4.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="65858205e5"><code>6585820</code></a>
Release version 1.15.4 of the npm package.</li>
<li><a
href="7a6567e16d"><code>7a6567e</code></a>
Disallow bracketed hostnames.</li>
<li><a
href="05629af696"><code>05629af</code></a>
Prefer native URL instead of deprecated url.parse.</li>
<li><a
href="1cba8e85fa"><code>1cba8e8</code></a>
Prefer native URL instead of legacy url.resolve.</li>
<li><a
href="72bc2a4229"><code>72bc2a4</code></a>
Simplify _processResponse error handling.</li>
<li><a
href="3d42aecdca"><code>3d42aec</code></a>
Add bracket tests.</li>
<li><a
href="bcbb096b32"><code>bcbb096</code></a>
Do not directly set Error properties.</li>
<li>See full diff in <a
href="https://github.com/follow-redirects/follow-redirects/compare/v1.15.3...v1.15.4">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=follow-redirects&package-manager=npm_and_yarn&previous-version=1.15.3&new-version=1.15.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain4j/langchain4j/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 12:01:21 +01:00
Lize Raes ec7844719b
set up documentation structure (#473)
suggestion for documentation website layout
2024-01-09 09:47:56 +01:00
Amith Koujalgi a0c63b611e
Added skeleton structure for docs (#458)
Hi @LizeRaes,

In reference to
[this](https://github.com/langchain4j/langchain4j/discussions/429#discussioncomment-8025023),
I've added the skeleton structure for documentation under the `docs`
directory.

I've also updated the `README.md` under the `docs` directory to help in
setting up and running the docs.

It's straightforward to set up and run the docs locally to get a feel
for its appearance.

I've also attached a few screenshots of the pages to get a quick look at
the appearance.

Please have a look and do let me know what you think. Thanks!


**_Sample Images:_**

- Docs: Home/Landing Page

<img width="1792" alt="1"
src="https://github.com/langchain4j/langchain4j/assets/1876165/c2ff1bf3-a412-4d86-be0d-9937936ec533">

- Docs: Inner Page Sample

<img width="1792" alt="2"
src="https://github.com/langchain4j/langchain4j/assets/1876165/9166df41-f16a-4bff-a3ca-145364be475c">

- Docs: Sample Blog

<img width="1792" alt="3"
src="https://github.com/langchain4j/langchain4j/assets/1876165/44dc1e7c-f669-4806-acfe-8fc2c3d2f59b">

Co-authored-by: Amith Koujalgi <amith.koujalgi@razorthink.com>
2024-01-06 04:01:35 +01:00