Skip to content

Commit

Permalink
📚 Update documentation (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
asim-shrestha authored May 13, 2023
1 parent dfee5db commit 2194dce
Show file tree
Hide file tree
Showing 9 changed files with 206 additions and 28 deletions.
10 changes: 10 additions & 0 deletions docs/docs/development/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
sidebar_position: 2
hide_table_of_contents: true
---

import DocCardList from "@theme/DocCardList";

# 🖥 Development

<DocCardList />
64 changes: 64 additions & 0 deletions docs/docs/development/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
sidebar_position: 1
---

# 🛠️ Setup

The following document will help you set up a local installation of AgentGPT.

## Stack

- 💅 Frontend: NextJS + Typescript
- 🐍 Backend: FastAPI + Python
- 📚 DB: MySQL through docker with the option of running SQLite locally

## ENV

Before you can get started, you need to ensure your ENV is correctly configured. To do this, copy over
the [.env.example](https://github.com/reworkd/AgentGPT/blob/main/.env.example) file into the `./next/` directory, rename
it to `.env` and update values as necessary. Some things to note:

- You will need to update the `OPENAI_API_KEY` with your own value. See the [FAQ](/faq) for details
- The DB ENV values are taken from definitions in `./docker-compose.yml`
- To enable web search, set `NEXT_PUBLIC_WEB_SEARCH_ENABLED=true` and use [your own SERP api key](https://serper.dev/)
for `SERP_API_KEY`.

## Using Docker

The docker build is very straightforward and should work out of the box.
Ensure you have docker installed by visiting [their website](https://www.docker.com/). After this, run the following
command:

```bash
docker-compose up --build
```

This will spin up a container for the frontend, backend, and database.

## Developing outside of docker

Outside of docker, you'll need to just configure your ENV. Additionally, you can use `setup.sh` to walkthrough ENV
configuration and also update your Prisma configuration to point to a local SQLite
instance.

After this, you can run the following to set up your Next.js project. We will add additional instructions for the Python
backend when enabled.

```bash
// Frontend
cd ./next
npm install
npm run dev
```

## Running the site

After you have locally built AgentGPT, you can travel to http://localhost:3000/ in your web browser.

## Issues / Additional help

If you're still having trouble, you can follow a legacy guide from
@CybrCo: [How to install AgentGPT locally](https://snapdragon-writer-867.notion.site/How-to-Install-AgentGPT-Locally-9b96b2314c9b491397976249fd121023)

If you still face problems, please submit an [issue on GitHub](https://github.com/reworkd/AgentGPT/issues) or reach out
to the team on [discord](https://discord.gg/jdSBAnmdnY).
89 changes: 89 additions & 0 deletions docs/docs/development/translations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
sidebar_position: 2
---

# 🌎 Translations

AgentGPT has translations across a variety of languages thanks to the help of many contributors such as @Cs4K1Sr4C.
languages. We're always looking to improve our translations however, if you notice something is off or missing, please
feel free to make the necessary updates or submit a ticket on GitHub!

## Translating the Frontend

We use i18next to handle our frontend translations. How it works is we have a folder for each language
in [next/public/locales](https://github.com/reworkd/AgentGPT/tree/main/next/public/locales).

```bash title="next/public/locales"
> en
> fr
> hu
...
> zh
```

For each component within the app, we namespace their translations. For example, our ChatWindow uses the `chat` name
space and its translations will be found in the `chat.json` under each folder. Translations are key value pairs where
the key represents the
desired text and the value represents the translation for a given langauge.

An example from the `chat` namespace:

- English: `"EMBARKING_ON_NEW_GOAL": "Embarking on a new goal:"`
- Spanish:`"EMBARKING_ON_NEW_GOAL": "Embarcándose en un nuevo objetivo:"`

#### Adding a new langauge

To add a new language, go into our i18 config and add a new locale

```bash title="next/next-i18next.config.js"
i18n: {
defaultLocale: "en",
locales:
[
"en",
"hu",
...,
"sk",
"hr",
"tr",
// Insert new language code here
],
...
```
Then head over to our languages definition and add a section to the available languages list
```tsx title="next/src/utils/languages.ts"
export const availableLanguages: Language[] = [
ENGLISH,
{ code: "fr", name: "Français", flag: "🇫🇷" },
// ...
{ code: "tr", name: "Türkçe", flag: "🇹🇷" },
// Insert new language here
];
```
After this, you must create a new folder with your langauge code
in [next/public/locales](https://github.com/reworkd/AgentGPT/tree/main/next/public/locales) and add translations for all
namespaces of our app. Note these values may not hot reload, so you must manually restart your next server.
## Translating the Backend
The backend translations are handled via the model itself.
We simply prompt it to provide the answer in the user selected langauge.
This means that whenever a new frontend language is added, the language is immediately supported on the backend!
This does however mean that we don't currently have much room to actually edit the translations provided by the model.
## Translating the Readme
We have a few README translations that live in [main/docs](https://github.com/reworkd/AgentGPT/tree/main/docs) such
as `README.zh-HANS.md`. If you'd like to translate the README to your language, make a similar file.
After doing this, add a link badge to our main english README alongside the other badges. Example:
<a href="https://github.com/reworkd/AgentGPT/blob/master/README.md"><img src="https://img.shields.io/badge/lang-English-blue.svg" alt="English"/></a>
## Translating our Documentation
This documentation is very experimental. Because of this, we have no plans to support translation just yet 😢
21 changes: 15 additions & 6 deletions docs/docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
---
sidebar_position: 3
sidebar_position: 4
---

# ❓ Frequently Asked Questions

### Introduction
Below is a list of the most frequently asked questions about AgentGPT. If you have any unanswered questions, please reach out to the moderation or dev team on [Discord](https://discord.gg/jdSBAnmdnY) or [GitHub](https://github.com/reworkd/AgentGPT).

Below is a list of the most frequently asked questions about AgentGPT. If you have any unanswered questions, please
reach out to the moderation or dev team on [Discord](https://discord.gg/jdSBAnmdnY)
or [GitHub](https://github.com/reworkd/AgentGPT).

### API key issues

<details>
<summary>Where can I get an API key?</summary>
You should first sign up for an OpenAI account. You can do so <a href="https://openai.com/blog/openai-api">here</a>.
Expand All @@ -24,7 +30,8 @@ Expired credit will show up as red such as the below image

![Example banner](./assets/expired-free-tier.png)

If you have used up your free tier credits, you will need to add billing information into your API key: <a href="https://platform.openai.com/account/billing/overview">OpenAI API Overview</a>.
If you have used up your free tier credits, you will need to add billing information into your API
key: <a href="https://platform.openai.com/account/billing/overview">OpenAI API Overview</a>.
Note that a few runs of AgentGPT will only cost a few cents.
</details>

Expand All @@ -47,6 +54,7 @@ Using AgentGPT is free as we handle the API costs. If you provide your own API k
</details>

### Agent issues

<details>
<summary>AgentGPT said it made a file / database / script, where can I find it?</summary>
Currently AgentGPT is incapable of outputs in that manner, but this is something we are actively working on.
Expand Down Expand Up @@ -90,11 +98,13 @@ If you provide your own API key, you can increase the output length within the a
</details>

### Misc

<details>
<summary>What is the difference between this and ChatGPT?</summary>
ChatGPT is a great tool that will allow you to ask a specific question and receive a result. It also follows a conversation, so after you have received a response, you can continue talking to it and it will remember (within limits) what was descussed previously.

AgentGPT on the otherhand is a platform for AI agents. You configure an agent to accomplish a broad goal, and it will automatically think and perform tasks to achieve it.
AgentGPT on the otherhand is a platform for AI agents. You configure an agent to accomplish a broad goal, and it will
automatically think and perform tasks to achieve it.
</details>

<details>
Expand All @@ -112,12 +122,11 @@ AgentGPT can do a lot, but we're also working on giving it a lot more capabiliti
Not yet but this is coming very soon! Keep an eye on our <a href="/roadmap">roadmap</a>.
</details>


### Local contribution issues

<details>
<summary>I'm having trouble setting up AgentGPT locally!</summary>
Please visit our <a href="/setup">setup</a> guide to diagnose any issues. If you have a problem that is undocumented, please submit an <a href="https://github.com/reworkd/AgentGPT/issues">issue on GitHub</a>.
Please visit our <a href="/development/setup">setup</a> guide to diagnose any issues. If you have a problem that is undocumented, please submit an <a href="https://github.com/reworkd/AgentGPT/issues">issue on GitHub</a>.
</details>


Expand Down
34 changes: 24 additions & 10 deletions docs/docs/roadmap.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
---
sidebar_position: 2
sidebar_position: 3
---

# 🚀 Roadmap

AgentGPT is currently in beta and we have a lot of features planned. Here's a glimpse of whats in the works!

## Finished features ✔

- 🔐 **Users and authentication**
- 💾 **Saving and sharing agent runs**
- If you are signed in, after your agent run has finished you have the ability to save it to our database.
- 🌐 **Dynamic translations for multiple languages**
- AgentGPT is used worldwide and we want to ensure everyone has a seamless experience on the platform. If we are missing the translation for your language, we'd love your help in getting it implemented!
- AgentGPT is used worldwide, and we want to ensure everyone has a seamless experience on the platform. If we are
missing the translation for your language, we'd love your help in getting it implemented!
- 🤖 **AI Model customization**
- Now users have the ability to use their own OpenAI API key to customize everything from the model, temperature, loops, and more! This also all runs directly within the user's browser!
- Now users have the ability to use their own OpenAI API key to customize everything from the model, temperature,
loops, and more! This also all runs directly within the user's browser!

## Features in development ⏳

:::tip
AgentGPT developers are actively working on the following. Expect these to take anywhere from a few days to 2 weeks.
:::
Expand All @@ -24,17 +29,23 @@ AgentGPT developers are actively working on the following. Expect these to take
- Note we've had to disable this due to costs, we will have it back up and running permanently within the week.
- This does not currently visit the websites themselves and parse websites but we are working on this.
-**Backend migration to Python**
- This is a bigger undertaking but something we feel must be done. It will allow us to migrate off of edge functions and use all of the tools available for language models in the Python ecosystem.
- This is a bigger undertaking but something we feel must be done. It will allow us to migrate off of edge functions
and use all the tools available for language models in the Python ecosystem.
- 🧠 **Long term memory via a vector DB**
- Providing Agents with more memory will allow them to perform tasks with a lot more context. This will also stop Agents from trying to perform the same or similar tasks multiple times.
- Providing Agents with more memory will allow them to perform tasks with a lot more context. This will also stop
Agents from trying to perform the same or similar tasks multiple times.
- 🤖 **Agent steer-ability**
- Users should be able to guide the Agent through a goal. This involves adding or removing tasks and providing additional context for the agent
- Users should be able to guide the Agent through a goal. This involves adding or removing tasks and providing
additional context for the agent
- 📚 **Documentation overhaul**
- This is the page you're viewing right now! It will continually be updated as the project evolves to allow any new user / contributer to get familiar with AgentGPT as quickly as possible.
- This is the page you're viewing right now! It will continually be updated as the project evolves to allow any new
user / contributer to get familiar with AgentGPT as quickly as possible.

## Planned features 🕰️

:::tip
If any of these features stand out to you or you'd like to suggest more features, please do so in the [AgentGPT discord](https://discord.gg/jdSBAnmdnY)!
If any of these features stand out to you, or you'd like to suggest more features, please do so in
the [AgentGPT discord](https://discord.gg/jdSBAnmdnY)!
:::

- 👨‍👩‍👦 **Interaction with websites and people**
Expand All @@ -45,5 +56,8 @@ If any of these features stand out to you or you'd like to suggest more features
- 🤖 **Cross agent communication**

## Notes
We are constantly updating our roadmap and adding new features so stay tuned for more updates and have a look at our GitHub.
We are however a small team and would love community support in helping develop AgentGPT. If you're interested, please head over to our [contributing page](/contributing).

We are constantly updating our roadmap and adding new features so stay tuned for more updates and have a look at our
GitHub.
We are however a small team and would love community support in helping develop AgentGPT. If you're interested, please
head over to our [contributing page](/contributing).
10 changes: 0 additions & 10 deletions docs/docs/setup.md

This file was deleted.

4 changes: 3 additions & 1 deletion docs/docs/usecases.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ sidebar_position: 6
---

# 🔥 Use Cases

This page is a WIP and will serve as a cool gateway into the different use cases of AgentGPT.
If you already interesting use cases in mind, please reach out to the moderation or dev team on [Discord](https://discord.gg/jdSBAnmdnY) or [GitHub](https://github.com/reworkd/AgentGPT).
If you already have interesting use cases in mind, please reach out to the moderation or dev team
on [Discord](https://discord.gg/jdSBAnmdnY) or [GitHub](https://github.com/reworkd/AgentGPT).
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"start": "docusaurus start --port 3001",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
Expand Down
Empty file removed next/src/middleware.ts
Empty file.

0 comments on commit 2194dce

Please sign in to comment.