Skip to content

Commit

Permalink
Migrate to MkDocs (#58)
Browse files Browse the repository at this point in the history
Co-authored-by: Philip Meier <[email protected]>
  • Loading branch information
pavithraes and pmeier authored Oct 5, 2023
1 parent 3dad16b commit 03721c7
Show file tree
Hide file tree
Showing 19 changed files with 123 additions and 165 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,9 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

# MacOS
**/.DS_Store

# VSCode
.vscode/
56 changes: 5 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,9 @@
# Ragna

## Local install
> **Note**
> This project is in active development.
```bash
$ conda env create --file environment.yml
$ conda activate ragna-dev
$ pip install --editable '.[complete]'
$ ragna --version
$ ragna ls
```
## Local development

## Minimal example

```python
import asyncio

from ragna import Rag
from ragna.assistant import RagnaDemoAssistant
from ragna.source_storage import RagnaDemoSourceStorage


async def main():
rag = Rag()

path = "ragna.txt"
with open(path, "w") as file:
file.write("Ragna is an OSS RAG app with Python and REST API.\n")

async with await rag.new_chat(
documents=[path],
source_storage=RagnaDemoSourceStorage,
assistant=RagnaDemoAssistant,
) as chat:
print(await chat.answer("What is Ragna?"))


# This is only needed when running module as script.
# If inside a notebook, the code inside the main function can be run directly.
if __name__ == "__main__":
asyncio.run(main())
```

## Documentation

Ragna uses Sphinx to build it's documentation.

You can contribute to the documentation at `docs/source`,
and start a development build that auto-refreshes on new changes with:

```bash
sphinx-autobuild docs/source docs/build/html
```

which serves the docs website at [http://127.0.0.1:8000](http://127.0.0.1:8000).
* Setup: [docs/community/contribute.md](docs/community/contribute.md)
* Quickstart: [docs/get-started.md](docs/get-started.md#minimal-example)
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions docs/community/brand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Brand guidelines
49 changes: 49 additions & 0 deletions docs/community/contribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contribute to Ragna

<!-- TODO: expand and add more narration -->

## Fork and clone the repository

```bash
git clone https://github.com/<your-username>/ragna.git
```

## Set up development environment

Create and activate a conda environment:

```bash
conda env create --file environment.yaml
conda activate ragna-dev
```

## Contribute code

Install Ragna in editable mode:

```bash
pip install --editable '.[complete]'
```

Verify your installation:

```bash
ragna --version
ragna ls
```

## Contribute documentation

Ragna uses MkDocs to build it's documentation.

You can contribute to narrative documentation at `docs/`,
and configure the docs website using `mkdocs.yml`

To start a development build that auto-refreshes on new changes,
run the following from the root directory:

```bash
mkdocs serve
```

This serves the docs website at [http://127.0.0.1:8000](http://127.0.0.1:8000).
1 change: 1 addition & 0 deletions docs/explanations/understand-rag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# What is RAG?
37 changes: 37 additions & 0 deletions docs/get-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Get started

## Installation

<!-- TODO -->


## Minimal example

```python
import asyncio

from ragna import Rag
from ragna.assistant import RagnaDemoAssistant
from ragna.source_storage import RagnaDemoSourceStorage


async def main():
rag = Rag()

path = "ragna.txt"
with open(path, "w") as file:
file.write("Ragna is an OSS RAG app with Python and REST API.\n")

async with await rag.new_chat(
documents=[path],
source_storage=RagnaDemoSourceStorage,
assistant=RagnaDemoAssistant,
) as chat:
print(await chat.answer("What is Ragna?"))


# This is only needed when running module as script.
# If inside a notebook, the code inside the main function can be run directly.
if __name__ == "__main__":
asyncio.run(main())
```
14 changes: 10 additions & 4 deletions docs/source/index.md → docs/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Ragna
---
title: Welcome
---

<!-- The following description is not final and likely to change. -->
# Ragna

Ragna is a toolkit for building RAG-based LLM applications.
A toolkit for building RAG-based LLM applications, it provides:

It provides:
* **Python API** for RAG orchestration
* **REST API** for building web applications
* **Ready-to-use web application** with UI for uploading documents, selecting models, and chat interface.

<!-- TODO:
- Update description
- Link to relevant sections of the docs
-->
35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

1 change: 1 addition & 0 deletions docs/references/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Release notes
1 change: 1 addition & 0 deletions docs/references/cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# CLI reference
1 change: 1 addition & 0 deletions docs/references/python-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Python API reference
1 change: 1 addition & 0 deletions docs/references/rest-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# REST API reference
48 changes: 0 additions & 48 deletions docs/source/conf.py

This file was deleted.

1 change: 1 addition & 0 deletions docs/tutorials/python-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Use the Python API
1 change: 1 addition & 0 deletions docs/tutorials/rest-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Explore the REST API
1 change: 1 addition & 0 deletions docs/tutorials/web-app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Set up a web application
10 changes: 3 additions & 7 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ dependencies:
- mypy
- pre-commit
# documentation
- sphinx
- myst-parser
- sphinx-copybutton
- furo
- sphinx-design
- sphinx-inline-tabs
- sphinxext-opengraph
- mkdocs
- mkdocs-material
- mkdocstrings
5 changes: 5 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
site_name: Ragna
theme:
name: material
features:
- navigation.sections

0 comments on commit 03721c7

Please sign in to comment.