Translation Agent: Agentic Translation with LLM Reflection Workflow
This repository profile is provided by osrepos.com, an open source repository discovery platform.
Summary
Translation Agent is a Python demonstration of an agentic workflow for machine translation, leveraging large language models (LLMs) and a reflection process. This innovative approach aims to improve translation quality by having the LLM translate, reflect on its output, and then refine the translation based on its own suggestions. It offers significant customizability for style, idioms, and regional language variations, making it a promising direction for future translation technologies.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
Translation Agent is a Python demonstration of an innovative agentic workflow for machine translation, developed by Andrew Ng and collaborators. This project leverages large language models (LLMs) to perform translations through a unique reflection process. The core idea involves an LLM first translating a text, then reflecting on its own output to identify areas for improvement, and finally using these self-generated suggestions to refine the translation.
This approach offers significant customizability, allowing users to easily modify the output's style (e.g., formal/informal), specify how to handle idioms and special terms, and even target specific regional language uses or dialects. While not yet mature software, Translation Agent is presented as a promising starting point for agentic translations, encouraging further discussion, experimentation, and open-source contributions in the field.
Installation
To get started with translation-agent, follow these steps. The Poetry package manager is required for installation.
Install Poetry:
pip install poetryFor more detailed instructions, refer to the Poetry Installation Guide.
Clone the repository and set up:
A
.envfile with anOPENAI_API_KEYis required to run the workflow. See the.env.samplefile in the repository for an example.git clone https://github.com/andrewyng/translation-agent.git cd translation-agent poetry install poetry shell # activates virtual environment
Examples
Once installed, you can use translation-agent in your Python projects:
import translation_agent as ta
source_lang, target_lang, country = "English", "Spanish", "Mexico"
source_text = "Hello, how are you?" # Example text
translation = ta.translate(source_lang, target_lang, source_text, country)
print(translation)
For a complete example script, refer to examples/example_script.py within the cloned repository.
Why Use It
Translation Agent presents a compelling alternative to traditional machine translation systems, primarily due to its high steerability and potential for superior translation quality in specific contexts. By integrating LLMs into a reflection workflow, it allows for granular control over translation nuances, such as stylistic choices, consistent handling of specialized terminology via glossaries, and adaptation to regional language variations.
Although its performance can vary, the project has shown instances of producing "fantastic results" that surpass commercial offerings. Furthermore, this agentic approach could serve as a valuable mechanism for automatically generating high-quality parallel text corpora, which can then be used to train and improve traditional, faster machine translation algorithms. The project actively invites the open-source community to explore extensions, including experimenting with different LLMs, developing glossary creation and usage strategies, and conducting more robust evaluations.
Links
- GitHub Repository: https://github.com/andrewyng/translation-agent
- License: Translation Agent is released under the MIT License.
Related repositories
Similar repositories that may be relevant next.

Ragas: Supercharge Your LLM Application Evaluations
August 9, 2026
Ragas is an ultimate toolkit for evaluating and optimizing Large Language Model (LLM) applications. It offers objective metrics, intelligent test generation, and data-driven insights to move beyond subjective assessments. This framework helps developers build feedback loops and continuously improve their LLM applications.

awesome-cli-coding-agents: A Curated Directory of Terminal-Native AI Tools
August 9, 2026
The `awesome-cli-coding-agents` repository offers a comprehensive, curated directory of over 100 terminal-native AI coding agents. These powerful tools operate directly within your command line, enabling autonomous code reading, editing, and execution. The list also covers various harnesses and orchestration solutions for managing these agents.

QwenPaw: Your Personal AI Assistant for Local and Cloud Deployment
August 7, 2026
QwenPaw is a powerful personal AI assistant designed for easy installation and deployment, either on your local machine or in the cloud. It supports multiple chat applications and offers highly extensible capabilities, making it a versatile tool for various AI-driven tasks. With its robust memory system and security features, QwenPaw aims to be an intuitive and private partner in your digital life.

DeepTutor: Lifelong Personalized Tutoring with AI Agents
August 7, 2026
DeepTutor is an advanced AI-powered platform designed for lifelong personalized tutoring, integrating various learning modes into a single, extensible system. It leverages large language models and multi-agent systems to offer features like interactive chat, quiz generation, and skill development. This project provides a comprehensive environment for learners and educators seeking intelligent, adaptive educational tools.
Source repository
Open the original repository on GitHub.
15 counted GitHub visits