TranslatePrompt
A learning translation agent that breaks the cycle of repetitive manual corrections by remembering your feedback and improving over time.

Role
Owner
Timeline
2025 - Present
Technologies
Python: Langgraph, FastAPI
Database: SQLite
Typescript: React
The Problem
Traditional translation workflows suffer from a fundamental limitation: they lack memory. Users repeatedly encounter the same translation errors—technical terms, company-specific language, or cultural nuances that require manual correction. This creates an inefficient cycle where domain expertise is lost after each session, forcing users to make the same corrections repeatedly.
The Solution
TranslatePrompt addresses this challenge through a conversational AI agent built with LangGraph that maintains persistent memory across translation sessions. The system learns from user corrections, building personalized glossaries and translation rules that improve accuracy over time. Unlike traditional tools that simply process text, this agent evolves with user feedback.
Architecture Overview
The system implements a stateful conversation flow using LangGraph, where each node represents a specific stage in the translation process. The agent maintains conversational memory through a structured state object and uses LangGraph's interrupt mechanism to create human-in-the-loop interactions.
Core Agent State Structure
class TranslateState(TypedDict):
messages: Annotated[list[BaseMessage], add_messages]
original_text: str
source_language: str
target_language: str
The state object preserves conversation history and context across all interactions, enabling the agent to maintain memory of previous corrections and preferences.
Translation Workflow
The agent follows a three-stage process that creates an interactive learning loop:
- Initial Translation: Analyzes the input text, retrieves user-specific glossaries and rules, then generates the first translation using contextual prompts.
- Human Feedback Loop: Presents the translation to the user and pauses execution using LangGraph's interrupt mechanism, waiting for corrections or approval.
- Iterative Refinement: Processes user feedback to generate improved translations, while simultaneously analyzing corrections in the background to build learning artifacts.
Agent Flow Diagram

The conversational loop maintains user engagement while background processes handle learning and optimization without blocking the user experience.
Key Technical Insights
Performance-First Architecture
The most critical insight from building this agent was the importance of decoupling user-facing operations from background intelligence. The initial design included glossary analysis directly in the refinement loop, which created some delays for simple corrections.
Architectural Decision: Split the system into synchronous (immediate user feedback) and asynchronous (background learning) processes. This ensures sub-second response times while maintaining the intelligence features that make the system valuable.
State Management Patterns
LangGraph's state management required careful attention to message accumulation. Using the add_messages
reducer pattern ensures conversational context is preserved across interactions, while the Command
pattern provides explicit control flow that's easier to debug than conditional edges.
Production Considerations
- Interrupt Mechanism: LangGraph's built-in interrupts enable true human-in-the-loop workflows without complex state management
- Background Processing: Non-blocking analysis jobs maintain responsiveness while building user-specific learning artifacts
- Conversation Persistence: Stateful checkpointing allows users to resume translation sessions across browser sessions
Want to dive deeper? Read the full technical breakdown of how this agent was built:
Lessons Learned Building a Real-World AI Agent with LangGraph →