██████╗ ██╗ ██████╗ ██████╗ ██████╗ ████████╗ ██████╗ ███╗ ██╗ ██████╗ ██╗ ██╗███████╗
██╔══██╗██║ ██╔═══██╗██╔═══██╗██╔══██╗ ╚══██╔══╝██╔═══██╗████╗ ██║██╔════╝ ██║ ██║██╔════╝
██████╔╝██║ ██║ ██║██║ ██║██║ ██║ ██║ ██║ ██║██╔██╗ ██║██║ ███╗██║ ██║█████╗
██╔══██╗██║ ██║ ██║██║ ██║██║ ██║ ██║ ██║ ██║██║╚██╗██║██║ ██║██║ ██║██╔══╝
██████╔╝███████╗╚██████╔╝╚██████╔╝██████╔╝ ██║ ╚██████╔╝██║ ╚████║╚██████╔╝╚██████╔╝███████╗
╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚══════╝
[ CROSS-LINGUAL KNOWLEDGE EXTRACTION // POWERED BY COHERE ]
Query in any language. Retrieve with precision.
╔══════════════════════════════════════════════════════════════════════════════╗
║ ║
║ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ║
║ ▓ ▓ ║
║ ▓ A retrieval-augmented generation system that speaks ALL tongues ▓ ║
║ ▓ Leveraging Cohere's multilingual models to pierce language ▓ ║
║ ▓ barriers and extract knowledge from the depths of any corpus ▓ ║
║ ▓ ▓ ║
║ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
|
|
| FEATURE | DESCRIPTION | STATUS |
|---|---|---|
MULTILINGUAL EMBED |
Query and retrieve in 100+ languages | ◉ ACTIVE |
CROSS-LINGUAL |
Ask in English → Find documents in Chinese | ◉ ACTIVE |
SEMANTIC RERANK |
Cohere Rerank v3 for precision retrieval | ◉ ACTIVE |
PERSISTENT STORAGE |
ChromaDB vector database with HNSW | ◉ ACTIVE |
SOURCE TRACKING |
Full citation chain for every response | ◉ ACTIVE |
CONFIDENCE METRICS |
Reliability scores for all outputs | ◉ ACTIVE |
WEB INTERFACE |
Dark-themed UI for human interaction | ◉ ACTIVE |
╔═══════════════════════════════════════╗
║ USER QUERY [ANY LANGUAGE] ║
║ "什么是机器学习?" ║
╚═══════════════════╤═══════════════════╝
│
▼
┌─────────────────────────────────────────────────────┐
│ ⛧ COHERE EMBED MULTILINGUAL v3.0 ⛧ │
│ [ Convert query → 1024-dim vector ] │
└─────────────────────────┬───────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ ⛧ CHROMADB VECTOR SEARCH ⛧ │
│ [ Retrieve top 10 similar docs ] │
└─────────────────────────┬───────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ ⛧ COHERE RERANK MULTILINGUAL v3.0 ⛧ │
│ [ Reorder by semantic relevance → 5 ] │
└─────────────────────────┬───────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ ⛧ COHERE COMMAND R+ ⛧ │
│ [ Generate grounded answer ] │
└─────────────────────────┬───────────────────────────┘
│
▼
╔═══════════════════════════════════════╗
║ RESPONSE [QUERY LANGUAGE] ║
║ "机器学习是人工智能的一个分支..." ║
╚═══════════════════════════════════════╝
|
|
|
╔════════════════════════════════════════════════╗
║ ◉ Python 3.10+ ║
║ ◉ Cohere API Key (https://cohere.com) ║
╚════════════════════════════════════════════════╝
# Clone the repository
git clone https://github.com/BabyChrist666/cohere-multilingual-rag.git
cd cohere-multilingual-rag
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env → Add your COHERE_API_KEY# Run CLI Demo
python rag.py
# Launch Web Server
python server.py
# Access: http://localhost:8000curl -X POST http://localhost:8000/documents \
-H "Content-Type: application/json" \
-d '{
"texts": ["Document content in any language..."],
"metadatas": [{"source": "origin"}]
}'curl -X POST http://localhost:8000/query \
-H "Content-Type: application/json" \
-d '{
"question": "What is machine learning?",
"n_results": 5
}'curl http://localhost:8000/statscohere-multilingual-rag/
├── embeddings.py # Cohere Embed & Rerank integration
├── vectorstore.py # ChromaDB vector operations
├── rag.py # Core RAG pipeline
├── server.py # FastAPI server & web UI
├── requirements.txt # Dependencies
└── README.md # Documentation
┌────────────────────────────────────────────────────────────────────────┐
│ │
│ ◉ MULTILINGUAL CUSTOMER SUPPORT │
│ Answer queries in the customer's native language │
│ │
│ ◉ GLOBAL KNOWLEDGE BASE │
│ Index and retrieve documents across language barriers │
│ │
│ ◉ CROSS-BORDER RESEARCH │
│ Find relevant papers regardless of publication language │
│ │
│ ◉ INTERNATIONAL E-COMMERCE │
│ Product search that transcends linguistic boundaries │
│ │
│ ◉ LEGAL/COMPLIANCE │
│ Search regulations in their original jurisdictional language │
│ │
└────────────────────────────────────────────────────────────────────────┘
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "server.py"]◉ Railway → Set COHERE_API_KEY → Deploy
◉ Render → Set COHERE_API_KEY → Deploy
◉ Fly.io → Set COHERE_API_KEY → Deploy
| Cohere Multilingual LLMs |
ChromaDB Vector Storage |
FastAPI API Framework |
Python Runtime |
═══════════════════════════════════════════════════════════════════════════════
⛧ BUILT FOR THE COHERE ECOSYSTEM ⛧
═══════════════════════════════════════════════════════════════════════════════
MIT License
Language is no barrier. Knowledge flows through all tongues.