Back to .md Directory

Albert RAG API

Documents a French government RAG API that extends OpenAI-compatible chat endpoints with source-augmented queries.

May 2, 2026
0 downloads
3 views
ai agent llm rag prompt eval openai
View source

What this file does

Documents a French government RAG API that extends OpenAI-compatible chat endpoints with source-augmented queries.

When to use it

  • Building a RAG layer on top of an existing OpenAI-compatible API
  • Integrating French public service sources like service-public.fr into a chatbot
  • Exposing a streaming chat API with authentication and temperature control

Assumes this stack

OpenAI APIRAGcurl

Albert RAG API

Overview

The Albert API supports the v1 OpenAI API, including system prompts, conversation handling, temperature control, and streaming. Additionally, we have introduced a Retrieval-Augmented Generation (RAG) extension toenhance user queries with relevant sources.

Authentication

To use the API, you need to authenticate with an API token. Ensure that you include the token in the header of your requests.

Endpoints

1. Standard LLM API

Endpoint

POST /api/v1/chat/completions

Example Request

curl -X POST https://albert.etalab.gouv.fr/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
  "model" : "AgentPulic/llama3-instruct-8b",
  "messages": [
    { "role": "system", "content": "Réponds dans un style francais ancien, moyenâgeux." },
    { "role": "user", "content": "Comment déclarer un revenue fiscal de référence ?" },
  ],
  "temperature": 0.7,
}'

2. RAG Extension

Endpoint

POST /api/v1/chat/completions

Parameters

  • rag: (string, optional) Only "last" is supported for now, which the current RAG implementation of ALbert that augment the last user query with French data references
  • limit: (integer, optional) Limit the number of references added.
  • sources: (array, optional) List of sources to search for references. Source available: "service-public", "travail-emploi".

Example Request

curl -X POST https://albert.etalab.gouv.fr/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
  "model" : "AgentPulic/llama3-instruct-8b",
  "messages": [
    { "role": "system", "content": "Réponds dans un style ancien, moyenâgeux" },
    { "role": "user", "content": "Comment déclarer un revenue fiscal de référence ?" },
  "rag": {
      "mode": "rag",
      "strategy": "last",
      "limit": 5
  }
}'

Note

  • The API does not store user conversations.
  • User must authenticated to use the API.

What's inside

2 endpoints, 2 example curl requests, authentication note, and parameter descriptions for RAG mode.

Change this for your project

  • Replace YOUR_API_TOKEN with your actual API token
  • Replace AgentPulic/llama3-instruct-8b with your model identifier
  • Replace https://albert.etalab.gouv.fr with your own API base URL

Where it goes

Use as the system prompt for your model call, or as the base instructions in your agent framework.

Related Documents