Skip to content

Commit

Permalink
Converting docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrudin committed Sep 24, 2024
1 parent c149d04 commit 3840151
Show file tree
Hide file tree
Showing 14 changed files with 623 additions and 133 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Started with: https://github.com/actions/starter-workflows/blob/main/pages/jekyll.yml .
# Have to use a custom Jekyll workflow as the default GitHub Jekyll workflow does not whitelist the
# "jekyll-tabs" plugin that lets us show code tabs in the documentation.

name: Deploy Jekyll site to Pages

on:
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby and install Gemfile bundles
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
with:
ruby-version: '3.1' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
working-directory: ./docs
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
working-directory: ./docs
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --verbose --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3
with:
path: "./docs/_site"

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
31 changes: 1 addition & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,4 @@ This repository contains a set of examples for demonstrating common AI use cases
MarkLogic. These examples are intended to serve as a starting point for your own applications; you are encouraged to
copy and modify the code as needed.

The examples in this repository depend on the
[Azure OpenAI Service](https://azure.microsoft.com/en-us/products/ai-services/openai-service). They can be easily
tailored to work with any LLM supported by the LLM framework used by each example. Note though that if you wish to
execute these examples as-is, you will need an Azure OpenAI account and API key.

## Setup

If you would like to try out the example programs, please [follow these instructions](setup/README.md).

## RAG Examples

MarkLogic excels at supporting RAG, or ["Retrieval-Augmented Generation"](https://python.langchain.com/docs/tutorials/rag/),
via its schema-agnostic nature as well as it's powerful and flexible indexing. This repository contains the following
examples of RAG with MarkLogic:

- The [rag-langchain-python](rag-langchain-python/README.md) project demonstrates RAG with Python, langchain, and MarkLogic.
- The [rag-langchain-java](rag-langchain-java/README.md) project demonstrates RAG with Java, langchain4j, and MarkLogic.
- The [rag-langchain-js](rag-langchain-js/README.md) project demonstrates RAG with JavaScript, langchain.js, and MarkLogic.

## Splitting / Chunking Examples

A RAG approach typically benefits from sending multiple smaller segments or "chunks" of text to an LLM. Please
see [this guide on splitting documents](splitting-langchain-java/README.md) for more information on how to split
your documents and why you may wish to do so.

## Embedding examples

To utilize the vector queries shown in the RAG Examples listed above, embeddings - vector representations of text -
should be added to your documents in MarkLogic.
See [this guide on adding embeddings](embedding-langchain-java/README.md) for more information.
For more information, please see [the user guide](TODO This will be changed once the docs are being published).
5 changes: 5 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
vendor
32 changes: 32 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!

gem "github-pages", "~> 229", group: :jekyll_plugins

gem "webrick"

# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-tabs"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]

# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
Loading

0 comments on commit 3840151

Please sign in to comment.