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.

A-MEM: Self-Evolving Memory for Coding Agents
August 17, 2026
A-MEM is an innovative self-evolving memory system designed for coding agents, organizing knowledge into a dynamic Zettelkasten-style graph. It allows memories to evolve and connect over time, enhancing an agent's ability to recall and utilize information effectively. This system offers both semantic and structural search capabilities for a richer knowledge base.

Agent Sandbox: Secure Local Development for AI Coding Agents
August 17, 2026
Agent Sandbox provides a robust and secure local development environment specifically designed for collaborating with AI coding agents. It ensures minimal filesystem access, configurable network egress policies, and secure secret injection, protecting your local machine from potentially risky agent operations. This project supports various AI agents and integrates seamlessly with both CLI and popular IDE devcontainer setups.

AMD Skills: Empowering AI Agents with AMD's Optimized Software Stack
August 16, 2026
AMD Skills is the official catalog of AI agent skills from AMD, designed to empower AI agents with optimized software for AMD hardware. This repository provides knowledge, scripts, and conventions for working with AMD's stack, enabling seamless integration with major coding agents like Cursor, Claude Code, OpenAI Codex, and Gemini CLI.

agent-tackle-box: A Terminal Debugger for LangGraph & LangChain Agents
August 15, 2026
agent-tackle-box is a comprehensive toolkit for developing AI agents, featuring the powerful `agent-debugger`. This terminal debugger provides deep insights into LangGraph and LangChain agents. It allows developers to inspect state, monitor tool calls, and step through Python code, all within a unified Textual UI.
Source repository
Open the original repository on GitHub.
15 counted GitHub visits