This project implements an intelligent agent system using LangChain and LangGraph capable of maintaining a conversation (Chatbot) and automatically translating its responses to the Andalûh EPA (Êttandâ pal Andalûh) orthographic proposal.
It allows interaction both via command line (CLI) and through a modern web interface built with Streamlit, and supports multiple LLM providers (Google Gemini and Ollama).
- Agent Architecture: Intelligent pipeline
Chatbot -> Translatorusing LangGraph. - Multi-Model: Native support for:
- Google Gemini (via API).
- Ollama (Local models like Llama 3, Mistral, etc.).
- Interfaces:
- 🖥️ CLI: Simple terminal interface.
- 🌐 Web App: Full application with Streamlit, including basic authentication.
- Dockerized: Easy deployment with Docker Compose (including Ollama).
agents.py: LangGraph graph definition and agent logic.tools.py: Custom tools (wrapper for theandaluhlibrary).app.py: Streamlit web application.main.py: CLI entry point.tests/: Unit test suite to verify translation rules.
The easiest way to run the full stack (Web App + Local Ollama) is using Docker Compose.
-
Start the services:
docker compose up --build -d
-
Download model (First time only): If using Ollama, you need to download the model inside the container:
docker exec -it andaluh-ollama ollama run llama3.2 -
Access: Open your browser at http://localhost:8501.
- User:
admin - Password:
andaluh
- User:
- Python 3.11+
- (Optional) Ollama installed locally or Google API Key.
-
Create virtual environment:
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r andaluh_chatbot/requirements.txt
-
Configure environment variables: Create a
.envfile inandaluh_chatbot/.envbased on the following example:To use Ollama (Local):
LLM_PROVIDER=ollama OLLAMA_BASE_URL=http://127.0.0.1:11434 OLLAMA_MODEL=llama3.2:latest
To use Google Gemini (Cloud):
LLM_PROVIDER=google GOOGLE_API_KEY=your_api_key_here MODEL=gemini-2.5-flash
Command Line Interface (CLI):
python -m andaluh_chatbot.mainWeb Interface (Streamlit):
streamlit run andaluh_chatbot/app.pyThe project includes tests to verify that translation rules (seseo, ceceo, vowel opening, etc.) are applied correctly.
Run tests:
python -m unittest andaluh_chatbot/tests/test_translation.py