Banque des Territoires (CDC Group) x Polyconseil x Hugging Face: Enhancing a Major French Environmental Program with a Sovereign Data Solution
Banque des Territoires, Polyconseil and Hugging Face built a sovereign RAG application that drafts sourced email replies for the EduRénov school-renovation program from its internal documentation. Agents edit and validate the drafts, and that feedback is collected for future fine-tuning and RLHF. The system is a modular monolith in hexagonal architecture, with the LLM, embedding model and retrieval method swappable through configuration. LLM calls are offloaded to Hugging Face Text Generation Inference on GPUs at SecNumCloud-qualified NumSpot, currently running Mistral-7B-Instruct-v0.3, with CroissantLLM under evaluation and RAGAS used for evaluation.
Related posts
- Hugging Face x LangChain : A new partner package
Hugging Face mediumAdeptlangchain-huggingface is a new Python partner package jointly maintained by Hugging Face and LangChain, replacing community-written integrations that had drifted out of date. It provides HuggingFacePipeline for running transformers models locally, HuggingFaceEndpoint for the serverless Inference API or deployed TGI endpoints via InferenceClient, and ChatHuggingFace, which turns message lists into model-specific prompts with tokenizer.apply_chat_template. For embeddings it offers HuggingFaceEmbeddings (local sentence-transformers) and HuggingFaceEndpointEmbeddings (Hub or TEI instances), each shown with short code examples.
- Making (Very) Small LLMs Smarter
Docker mediumAdeptA 3B-parameter local model (Qwen2.5-Coder-3B, Q4_K_M) can become a useful coding assistant for an unfamiliar, recent Go library (Nova) when it is given a small, focused RAG context. Markdown snippet sections are embedded with EmbeddingGemma and stored in an in-memory vector store. Each query retrieves at most 3 snippets above a cosine-similarity threshold of 0.45. Because small models degrade as context grows, conversation history is capped at 2 messages. The agent is built in Node.js with LangchainJS and runs via Docker Model Runner and Docker Compose's models section, with low temperature and a presence penalty to keep output focused.
- Build a custom RAG AI agent in TypeScript and Jupyter
Deno mediumAdeptA local agentic RAG pipeline built in TypeScript inside a Deno Jupyter notebook, using LangChain and LangGraph with Ollama models. Deno blog posts are loaded with Cheerio, split into 500-character chunks, embedded with mxbai-embed-large and stored in an in-memory vector store exposed as a retriever tool. A LangGraph state graph wires an agent node (Llama 3.2 3B, the only small local model the author got tool calling working with) to retrieval, a binary relevance grader, query rewriting and final answer generation with DeepSeek R1 8B. The setup suits confidential documents that must not leave the machine.
- Expert Support case study: Bolstering a RAG app with LLM-as-a-Judge
Hugging Face mediumAdeptDigital Green's Farmer.chat, a GPT-4o ReAct agent backed by a RAG pipeline over ~46,000 agricultural research papers (semantic chunking, Qdrant), uses LLM-as-a-judge to evaluate prompt clarity, question type, answered rate and RAG faithfulness at scale. The faithfulness judge, a RAGAS-inspired binary NLI prompt that checks atomic statements against retrieved context, correlated well with human raters on ~360 questions. Benchmarking four LLMs on 700+ queries showed Gemini-1.5-Pro was most faithful (91%) but left 19.4% unanswered, so the team chose Gemini-1.5-Flash for its balance of 89% faithfulness and only 4.5% unanswered.
- Mistral 7B and BAAI on Workers AI vs. OpenAI Models for RAG
Neon mediumAdept
Swapping gpt-3.5-turbo for mistral-7b-instruct-v0.1 and text-embedding-ada-002 for BAAI's bge-base-en-v1.5 (both on Cloudflare Workers AI) in Neon's docs chatbot shows embeddings are close to interchangeable but text generation is not. Across eight Postgres questions, the two embedding models returned the same retrieved chunks 46% of the time at k=3 (42% at k=10), with Jaccard and TF-IDF cosine scores indicating substantial context overlap. Expert raters scored GPT-3.5 answers 3.8/5 versus 2.5/5 for Mistral 7B. Migrating embeddings to BGE looks viable and can cut vector storage, while replacing the generation model would noticeably hurt answer quality.