DEV Community

Pranav
Pranav

Posted on AI-assisted

Building Context-Aware Multilingual AI Agents with Cognee and Crowdin

In the era of autonomous AI applications, LLMs are increasingly deployed to interact with global audiences across dozens of languages. From multilingual customer support agents to automated documentation generators, modern systems must communicate fluently and accurately in the target dialect.

However, LLMs possess a well-known vulnerability: terminology drift. When asked to translate domain-specific software concepts, models frequently invent literal, inconsistent, or prohibited translations rather than adhering to officially approved glossaries.

Enter Crowdin: the enterprise localization platform trusted by GitHub, GitLab, Discord, and Microsoft open source to orchestrate translations, brand glossaries, and string catalogs.

With the release of the Crowdin Connector for Cognee, engineering teams can now stream localization repositories, approved terminology glossaries, and translation memory directly into Cognee's AI-native knowledge graph.


Why Connect Crowdin to Cognee?

Integrating Crowdin into Cognee's memory engine empowers autonomous agents with:

  1. Deterministic Terminology Grounding: When an AI agent responds in German, French, or Japanese, it queries Cognee's memory graph to ensure it uses the approved glossary term (e.g., using "Passkey" instead of a mistranslated "Passwort").
  2. Context-Aware Translation: LLMs can inspect string keys, UI context descriptions, and character limits stored in Cognee memory before generating localized copy.
  3. Automated Localization Audits: Autonomous agents can inspect translation completion metrics across branches, flagging missing translations or out-of-date strings.
  4. Orphan Cleanup: When outdated strings or deprecated terms are removed from Crowdin, Cognee's write_disposition="replace" ensures they are automatically forgotten from graph memory.

Architectural Deep Dive

The Crowdin connector is designed for production reliability:

  • Full Data Ingestion:
    • Projects: Ingests project identifiers, source languages, target locales, and web dashboard links.
    • Glossaries: Maps approved terminology, prohibited synonyms, parts of speech, and linguistic definitions.
    • Localization Strings: Ingests developer context comments, string keys, English source text, and target translations.
  • Cognee Pipeline Integration:
    • Sets DOCUMENT_SOURCE_ATTR = "crowdin" on all emitted documents, ensuring seamless processing through Cognee's cognify() pipeline.
    • Employs write_disposition="replace" on the crowdin_localization table to clean up deleted or deprecated terms.
    • Generates deterministic uuid5 document IDs based on project IDs and report types, preventing duplicate nodes in the knowledge graph.
  • Enterprise-Grade Resilience:
    • Exponential backoff with jitter on HTTP 429 rate limits and 5xx transient server errors.
    • Automatic credential and token sanitization ([REDACTED_CROWDIN_TOKEN]) in all logs and exception messages.
    • Clean Markdown document generation structured for optimal chunking and embedding retrieval.

Quickstart Guide

1. Installation

Install Cognee and the community Crowdin connector:

pip install cognee cognee-community-connector-crowdin
Enter fullscreen mode Exit fullscreen mode

Or using uv:

uv add cognee cognee-community-connector-crowdin
Enter fullscreen mode Exit fullscreen mode

2. Ingesting Localization Knowledge

import asyncio
import os
import cognee
from cognee_community_connector_crowdin import (
    CrowdinConfig,
    crowdin_connector,
)

async def main():
    # Configure the connector
    config = CrowdinConfig(
        api_token=os.getenv("CROWDIN_PERSONAL_TOKEN", "your-crowdin-token"),
        include_glossaries=True,
        include_strings=True,
    )

    print("Fetching Crowdin localization knowledge...")
    documents = await crowdin_connector(config)
    print(f"Retrieved {len(documents)} localization documents.")

    # Ingest into Cognee Memory
    print("Ingesting into Cognee...")
    await cognee.add(documents, dataset_name="localization_knowledge")
    await cognee.cognify(dataset_name="localization_knowledge")

    # Natural Language Terminology Reasoning
    query = "What is the approved German translation for Passkey?"
    print(f"\nQuerying Cognee: '{query}'")
    results = await cognee.search(query, dataset_name="localization_knowledge")

    for r in results:
        print(f"\nMemory Result: {r}")

if __name__ == "__main__":
    asyncio.run(main())
Enter fullscreen mode Exit fullscreen mode

What Does Ingested Memory Look Like?

The connector parses Crowdin REST API v2 JSON into structured Markdown reports optimized for graph extraction:

# Terminology Glossary: Acme Technical Lexicon (ID: 501)

**Total Terms Recorded**: 2

## Approved Terms & Conceptual Definitions
### Term: `Passkey` (EN)
- **Term ID**: 9001
- **Part of Speech**: noun
- **Status**: approved
- **Definition / Context**: FIDO2 WebAuthn cryptographic credential.

### Term: `Passkey` (DE)
- **Term ID**: 9002
- **Part of Speech**: noun
- **Status**: approved
- **Definition / Context**: Do not translate as Passwort. Keep as Passkey.
Enter fullscreen mode Exit fullscreen mode

When Cognee processes this markdown through cognify(), it constructs knowledge graph nodes representing:

  • Terms (e.g., Passkey)
  • Languages (e.g., EN, DE)
  • Concepts & Guidelines (e.g., Do not translate as Passwort)
  • Relationships (e.g., Acme Technical Lexicon -> CONTAINS -> Passkey, Passkey -> HAS_RESTRICTION -> Do not translate as Passwort)

Open Source & Community

The Crowdin connector is an open-source contribution to the Cognee Community ecosystem.

Empower your AI agents with reliable, multilingual memory today!

Top comments (0)