Skip to content
TenzinGayche edited this page Dec 15, 2025 · 2 revisions

LangGraph Buddhist Text Translation API

API Version License

Welcome to the comprehensive documentation for the LangGraph Buddhist Text Translation API β€” a sophisticated, multi-stage pipeline for translating, analyzing, and standardizing Tibetan Buddhist texts.


πŸš€ Quick Start

# Clone the repository
git clone https://github.com/OpenPecha/langraph-api.git
cd langraph-api

# Install dependencies
pip install -r requirements.txt

# Configure API keys in .env
echo "ANTHROPIC_API_KEY=your-key" > .env

# Start the server
uvicorn src.translation_api.api:app --reload --port 8001

πŸ“– Documentation

Document Description
Architecture System design, LangGraph workflow, multi-stage pipeline
Concepts & Terminology Buddhist terms, UCCA, Gloss, technical concepts
API Reference Complete endpoint documentation with examples
Model Router Multi-provider LLM configuration (Anthropic, OpenAI, Google)
Workflow System Combo-key based translation workflows
Streaming Guide SSE patterns and real-time events
Installation Setup, configuration, deployment
Usage Guide Examples, tutorials, best practices

✨ Key Features

πŸ”„ Modular Three-Stage Pipeline

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Translation   β”‚ β†’  β”‚    Glossary     β”‚ β†’  β”‚  Standardization    β”‚
β”‚    Service      β”‚    β”‚    Service      β”‚    β”‚     Service         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Each service is independent, giving you full control over your translation workflow.

πŸ“‘ Streaming First

Real-time Server-Sent Events (SSE) for all long-running operations:

  • Watch translations appear as they complete
  • Monitor glossary extraction progress
  • Track standardization updates live

πŸ€– Multi-Model Support

Provider Models
Anthropic Claude Sonnet 4, Claude 4.5, Claude Opus
Google Gemini 2.5 Pro, Gemini 2.5 Flash
OpenAI GPT-4, GPT-4 Turbo
Dharmamitra Specialized Buddhist translation

🧠 Advanced Features

  • UCCA Generation: Universal Conceptual Cognitive Annotation graphs
  • Gloss Analysis: Word-by-word breakdown with standardization
  • Commentary Integration: Use up to 3 commentaries for context
  • Sanskrit Parallel: Cross-reference with Sanskrit sources
  • Custom Prompts: Full template customization with placeholders

πŸ—οΈ Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         FastAPI Server                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ Translationβ”‚  β”‚  Glossary  β”‚  β”‚   UCCA     β”‚  β”‚   Gloss    β”‚ β”‚
β”‚  β”‚ Endpoints  β”‚  β”‚ Endpoints  β”‚  β”‚ Endpoints  β”‚  β”‚ Endpoints  β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚        β”‚               β”‚               β”‚               β”‚        β”‚
β”‚        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚                              β”‚                                   β”‚
β”‚                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                        β”‚
β”‚                    β”‚   Model Router    β”‚                        β”‚
β”‚                    β”‚  (Multi-Provider) β”‚                        β”‚
β”‚                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                        β”‚
β”‚                              β”‚                                   β”‚
β”‚           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚           β–Ό                  β–Ό                  β–Ό               β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚    β”‚ Anthropic  β”‚     β”‚   Google   β”‚     β”‚  OpenAI    β”‚        β”‚
β”‚    β”‚   Claude   β”‚     β”‚   Gemini   β”‚     β”‚   GPT-4    β”‚        β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“Š API Endpoints at a Glance

Category Endpoints Description
Translation /translate, /translate/stream Batch & streaming translation
Glossary /glossary/extract, /glossary/extract/stream Term extraction
Standardization /standardize/analyze, /standardize/apply Consistency enforcement
UCCA /ucca/generate, /ucca/generate/stream Semantic graph generation
Gloss /gloss/generate, /gloss/generate/stream Word analysis
Workflow /workflow/run, /workflow/run/batch Combo-key workflows
Editor /editor/comment, /editor/comment/stream Grounded commentary
Proxy /dharmamitra/* Dharmamitra integration

πŸ”— Links

Resource URL
Repository https://github.com/OpenPecha/langraph-api
OpenPecha https://openpecha.org
LangGraph https://langchain-ai.github.io/langgraph/

πŸ“„ License

This project is licensed under the Apache 2.0 License.


Built with ❀️ by OpenPecha

Clone this wiki locally