Quick Start
Last updated
Last updated
The current architecture ilustraded below shows how dialog and dialog-lib serve as base abstractions that define how you deploy RAG LLM Apps with little effort. You can basically focus in maintaining and evolve your knowledge base and prompts, and if necessary you can implement your onw plugins to extend fuctionalities.
We recommend you use the docker compose deployment to set up your environment, as this will simplifies the process of setting up the environment and all its dependencies. You just need to copy and paste our docker-compose.yml
available below.
to avoid the risk of using an outdated version of
docker-compose
, we recommend that you get theyaml
from the main source here.
Your .env
file should have the following keys, as shown below and also available in our .env.sample
file.
pgvector
- PostgresWe use the pgvector extension of PostgreSQL to generate embeddings of questions and answers. If you are setting up PostgreSQL outside docker compose
, you need to enable the pgvector extension.
The dialog docker image is distributed in GitHub Container Registry with the tag latest
.
image: ghcr.io/talkdai/dialog:latest
.csv
knowledge baseThe knowledge base has needed columns:
category
subcategory: used to customize the prompt for specific questions
question
content: used to generate the embedding
Example:
When the dialog
service starts, it loads the knowledge base into the database, so make sure the database is up and paths are correct (see environment variables section). Alternatively, inside src
folder, run make load-data path="<path-to-your-knowledge-base>.csv"
.
See our documentation for more options about the the knowledge base, including embedding more columns together.
.toml
prompt configurationThe [prompt.header]
, [prompt.history_header]
, [prompt.suggested]
, and [fallback.prompt]
fields are mandatory fields used for processing the conversation and connecting to the LLM.
The [prompt.fallback]
field is used when the LLM does not find a compatible embedding in the database; that is, the [prompt.header]
is ignored and the [prompt.fallback]
is used. Without it, there could be hallucinations about possible answers to questions outside the scope of the embeddings.
In
[prompt.fallback]
the response will be processed by LLM. If you need to return a default message when there is no recommended question in the knowledge base, use the[prompt.fallback_not_found_relevant_contents]
configuration in the.toml
(project configuration).
It is also possible to add information to the prompt for subcategories and choose some optional llm parameters like temperature (defaults to 0.2) or model_name, see below for an example of a complete configuration: