Locally
Setting up Ada
Ada's main logic consists of two components:
-
The NextJS backend handles:
- Database operations: Storing users, processed documents, chapters, education levels, etc.
-
The Python backend manages:
- The document processing pipeline
Ada is a monorepo managed by Docker Compose. Follow these steps to get the project running on your local machine.
Prerequisites
- Git
- conda with Python 3.9 (you can use venv)
- npm and Node.js
- A computer / server with CUDA 12 installed
- Postgresql
Postgresql
You can run use the docker compose to launch an instance of postgresql
If you prefer to run it "locally" you can come up with your own instance, by changing the relevant environment variables
Installation
- Clone the repository:
- Navigate to the project directory:
The server
the server is used in two ways:
- To run the processing pipeline in order to index the documents (pdf, video, ...).
It does this using the AI models that run locally - To serve the embedding models, used by the web client to process every user queries.
Setup the server
- Create a virtual environment using conda with python 3.9
- Go inside the server folder:
- Install the required dependencies
Dependency missing
If when running the server, you encounter a error saying that a dependency is missing.
- Make sure that the requirements.txt has been installed correctly (without error)
- refer to the Dockerfile (
server/Dockerfile
) to see if a your missing dependency is not specified there (look for aRUN pip install xxx
inside the Dockerfile)
- Make sure you have correctly set-up the environment variables
Launch the server
The server needs to access the environment variables. To inject them, you can run it with this command:
This command will inject the environment variables located in the root folder's .env file into the context of the command.
The next-app
The next-app is built using the following technologies :
- Next.JS 14 (with app router)
- Prisma ORM used to connect to the Postgresql database.
Setup the next-app
- Navigate to the project directory:
- Install the required dependencies
- Sync the database
- Feed the db with initial content
Launch the next-app
if everything worked well you can visit http://localhost:3000/ and you should see something like this:
Troubleshooting
If you encounter any issues during setup, please check the following:
- Ensure all prerequisites are correctly installed.
- Verify that the required ports are not being used by other applications.
- Check the logs for any error messages.
If problems persist, please contact erwan.boehm@beta.gouv.fr or open an issue on the GitHub repository.