Persian-first · Graph-native · Open-source

Persian language, inside a living graph of meaning

At Haman Labs, we build infrastructure that makes relationships among Persian words, sentences, and documents part of a model's intelligence—from raw text to graphs, language models, and extensible products—so our technology can understand Persian more deeply.

An open-source project by Aria Haman Mehr Parseh Knowledge-Based Software Company
A conceptual graph of Persian language intelligence Word, sentence, document, relation, memory, and model nodes connected in a graph. WORDTOKEN SENTENCECONTEXT GRAPHRELATION MEMORYRETRIEVAL MODELGRAPH-LM DOCCORPUS PERSIANLANGUAGE AI
Rakhshai Graph-based NLP (RGN)Relations, context, and memory for deeper Persian understanding
RGN · CAPABILITY MAP

What can Rakhshai Graph-based NLP (RGN) do?

In simple terms, the platform takes Persian text and provides one path for building graphs, training and running models, analyzing or generating text, and connecting the result to a product—so Persian can be understood more deeply and Persian speakers can receive more accurate outputs.

  1. Prepare Persian text

    Normalize characters, clean and tokenize text, and prepare a corpus for processing and training.

  2. Turn text into several graph types

    Represent word and document relations, text similarity, syntax, and semantics as simple or multi-relation graphs.

  3. Train graph neural networks

    Learn from graph structure and relations with models such as GCN, GraphSAGE, GAT, and RGCN.

  4. Combine graphs with a language model

    Bring graph information and Transformer tokens together so the model can use both sequence and relation when understanding or generating text.

  5. Run the full model lifecycle

    Follow one reproducible path from data preparation and training to evaluation, prediction, inference, and text generation.

  6. Analyze and classify text

    Classify Persian text and extract keywords, concepts, entities, and semantic signals.

  7. Summarize and find related content

    Rank important sentences with graph evidence, create extractive summaries, and recommend nearby documents.

  8. Build knowledge, memory, and explanations

    Store knowledge in nodes and relations, retrieve relevant context, and expose the evidence behind a result.

  9. Generate text and structured articles

    The lower-level Graph-LM engine generates text, while the current llm.article workflow prepares, trains, audits, and generates structured Persian articles.

  10. Connect products, agents, and tools

    Use the Python API, CLI, Web UI, or MCP from applications, development environments, and chatbots; MCP project resources remain controlled and read-only.

The current RGN release focuses on Persian text processing, modeling and generation, linguistic graph construction, and product integration.

Persian-firstTokenizer to model
Graph-nativeMulti-relation language graphs
Open-sourceMIT License
ConnectablePython · CLI · MCP
Our mission

Give Persian greater power in the age of large models

We are not building just another text-processing tool. We are building open infrastructure that helps models represent the structure, context, and relationships of Persian more effectively—and gives Iranian researchers and builders a foundation they can inspect, extend, and own.

“From deeper understanding of Persian words and sentences to native Iranian language models—knowledge rooted in our language and built to work with the world.”

01 / LANGUAGE

Relationships, not sequence alone

Bring graph structure into the pipeline so connections among words, documents, topics, and linguistic relations become part of the model's representation.

02 / INFRASTRUCTURE

Native, reproducible infrastructure

Build the tokenizer, graph, training engine, evaluation, and inference stack for Persian—not a thin wrapper around an external ready-made model.

03 / COMMUNITY

More power for builders

Shorten the route from research to product for developers, researchers, and teams shaping the future of Persian artificial intelligence.

Rakhshai Graph-based NLP (RGN)

The first integrated graph-oriented NLP platform for Persian

Rakhshai Graph-based NLP (RGN) is our open-source infrastructure for turning raw Persian data into multi-relation graphs, graph models, and deployable language workflows. It brings data preparation, graph construction, training, evaluation, inference, and external-tool integration into one coherent path.

Persian textRaw data and corpus
Persian processingNormalization and tokenization
Multi-relation graphWords, documents, syntax, semantics
Graph reasoningGCN · GAT · RGCN
Model and productAnalysis, generation, integration
rakhshai_graph_nlp.lm

The reusable Graph-LM engine

The lower layer for tokenization, graph building, graph encoders, graph-token fusion, training, graph memory, and text generation.

rakhshai_graph_nlp.llm

Product-level LLM workflows

The high-level layer for task-specific native models, beginning with llm.article for preparing, auditing, training, and generating structured Persian articles.

Rich graphs for Persian text

Build co-occurrence, word-document, document-similarity, dependency, semantic, and multi-relation graphs to represent connections hidden by linear text.

co-occurrenceword-documentdependencysemanticmulti-relation

Graph neural models and adaptive fusion

Graph encoders alongside a causal Transformer and a learnable gate, allowing the model to decide how strongly text and graph representations should contribute in context.

GCNGraphSAGEGATRGCNcontext-gated fusion

Analysis and classification

Persian text classification, semantic analysis, graph-signal extraction, and practical training, evaluation, and prediction paths.

Summarization and recommendation

Graph-evidence sentence ranking, extractive summarization, and related-content retrieval built around textual structure.

Developer interfaces

A stable Python API, command-line tooling, a Persian RTL web interface, and structured outputs for integration into products.

PROJECT QUICK START

Install and run the first project example

Clone the repository, create a virtual environment, and install the machine-learning base. The final command runs a built-in CPU example that checks installation, word-document graph construction, and the GCN model.

This path exercises the general project and engine capabilities. The Haman article model in the next section runs through the higher-level llm.article workflow.

Read the complete API and CLI guide
install-and-check.sh
git clone https://github.com/bazpardazesh-org/Rakhshai-Graph-based-NLP.git
cd Rakhshai-Graph-based-NLP

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[ml]"

# Built-in CPU smoke example
rgnn-cli --model gcn --device cpu
The platform's first flagship output

The Haman Persian article model

A native language model for structured article generation—and a working demonstration of how Rakhshai Graph-based NLP (RGN) moves from architecture research to a reproducible training and generation workflow.

125M PARAMETERS · PERSIAN ARTICLE LLM

Haman Persian Article Graph-LLM 125M

At Aria Haman Mehr Parseh, we developed this model for structured Persian article generation. It takes a topic, audience, tone, and section count, then returns an article in Markdown or JSON.

The first Iranian LLM with an Iranian-produced architecture

The architecture combines a decoder-only Transformer with a corpus-level lexical GCN and context-gated graph-token fusion. Its weights were trained from random initialization, while the tokenizer, graph, and training pipeline were built for Persian.

Language architectureDecoder-only Transformer
Graph encoderCorpus-level lexical GCN
FusionContext-gated graph-token fusion
Training pathNative, from random initialization
Generation controlsTopic, audience, tone, sections
OutputStructured Markdown / JSON
This release is not instruction-tuned and must not be treated as a factual authority or definitive question-answering system.
MODEL QUICK START

Download and run the Haman model

Download the published weights from Hugging Face, then provide a topic, audience, tone, and section count to generate a structured article.

Run this model with article-generate. The generic generate command belongs to the lower-level rakhshai_graph_nlp.lm engine.

View the model card and files
run-haman-model.sh
python -m pip install -e .
python -m pip install huggingface_hub

python -c 'from huggingface_hub import snapshot_download; snapshot_download(repo_id="aria-haman/haman-fa-article-graph-llm-125m", local_dir="models/haman-fa-article-graph-llm-125m")'

rgnn-cli article-generate \
  --model models/haman-fa-article-graph-llm-125m \
  --topic "آینده هوش مصنوعی در آموزش فارسی" \
  --audience "دانشجویان" \
  --tone "تحلیلی" \
  --sections 4 \
  --max-new-tokens 700 \
  --output-format markdown \
  --output-path haman-article.md
NEXT
More practical models are on the way

As the required compute infrastructure becomes available, we plan to add more practical and varied task-focused language models to this foundation soon.

OPEN DATA · REPRODUCIBLE PIPELINE

The Haman Persian article dataset

Haman Persian Wikipedia Articles 186K makes the article model's data path inspectable and reproducible—from downloading records to preparing input for the article workflow.

DATASET QUICK START

From Hugging Face to RGN training input

Load the data with the datasets library and export it as JSONL. Then article-prepare converts the title and text records through wikipedia_prompt into corpus, training, and validation files.

titletextJSONLwikipedia_prompt

Outputs include corpus.txt, train.txt, validation.txt, accepted and rejected records, and manifest.json.

prepare-haman-dataset.sh
python -m pip install -e ".[data]"
mkdir -p data

python - <<'PY'
from datasets import load_dataset

dataset = load_dataset(
    "aria-haman/haman-fa-wikipedia-articles-186k",
    split="train",
)
print(dataset.column_names)
dataset.to_json(
    "data/haman-fa-wikipedia-articles-186k.jsonl",
    force_ascii=False,
)
PY

rgnn-cli article-prepare \
  --input data/haman-fa-wikipedia-articles-186k.jsonl \
  --output-dir runs/haman-dataset-prepared \
  --input-format jsonl \
  --training-format wikipedia_prompt \
  --min-body-chars 400 \
  --validation-ratio 0.1
MODEL CONTEXT PROTOCOL

Rakhshai Graph-based NLP (RGN) capabilities, available to AI agents and tools

The MCP integration is a controlled, standards-based adapter around the Rakhshai Graph-based NLP (RGN) core—not a replacement architecture. It lets AI agents, IDEs, chatbots, and automated workflows use Persian graph intelligence.

LIVE API EVALUATION · SINGLE SAMPLE

A live test of Persian poetry understanding and analysis

In a live API evaluation, the same poem and question were sent to GPT-5.4 twice: once directly and once with RGN graph evidence supplied through MCP. The evidence-assisted response used four times as many relevant evidence signals in the automatic metric and received a 19% higher judged score.

evidence signals for poem understanding
19%higher overall score
21 → 25judged score

در آینه، سایه‌ام از من قدیمی‌تر بود
و نامم از دهانِ پنجره به باران می‌ریخت

چراغی که خوابِ خاکستر می‌دید
راه را به پای گم‌شده‌ام نشان نمی‌داد

رود از کنار من گذشت
اما تشنگی در مشت‌هایم لانه کرده بود

گفتم: کدام سو خانه است؟
باد، کلیدی زنگ‌زده را در سکوت چرخاند

Why did we choose poetry?

Persian poetry is denser than everyday prose in symbolism, implicit meaning, and long-range relationships among images. This sample connects mirror, shadow, name, lamp, river, thirst, home, and key, so recognizing isolated words is not enough—the model must follow and explain the relationships among them.

This is a single-sample evaluation. It is useful evidence, but it does not replace broader testing across a diverse poetry benchmark.

Read the complete reproducible evaluation report
AGENT ECOSYSTEM

Why have AI agents become so popular?

Instead of producing one isolated answer, an AI agent can break a goal into steps, call the right tools, inspect evidence, and hand the result to the next system. That makes agents a useful pattern for research, coding, support, document analysis, and workflow automation.

Through MCP, RGN gives these agents controlled access to Persian analysis, graph construction, Graph Memory, and explainability.

Research and evidence gatheringCoding assistanceDocument analysis and summarizationChatbots and supportWorkflow automation

One interface, several capabilities

Persian input becomes graph evidence, relevant memory, and explainable context, while project resources remain bounded to approved, read-only paths.

  • Persian analysis with keywords, concepts, entities, and signals
  • Knowledge graph construction and graph-evidence summarization
  • Graph memory retrieval and prompt-relevant generation context
  • Explanations through nodes, relations, and reasoning paths
  • Read-only resources restricted to whitelisted project paths
rakhshai-mcp / graph_reasoning
01Persian question
rakhshai_analyze_persian_text
rakhshai_build_knowledge_graph
graph memory + relevant evidence
02grounded, explainable context
03agent / IDE / chatbot / workflow
Development horizon

From text infrastructure to a new generation of Persian AI

Rakhshai Graph-based NLP (RGN) is not an endpoint. It is a foundation for models and products that understand Persian more deeply while keeping their technical knowledge open to the community that builds them.

NOW

Persian text processing and modeling

Normalization and tokenization through multi-relation graphs, graph neural models, classification, summarization, and text generation.

IN PROGRESS

Native Iranian language models

Task-specific models trained on Persian corpora, with the ability to measure the real contribution of graph components under a native recipe.

FUTURE

Comprehensive, reproducible Persian evaluation

Expand datasets, evaluation metrics, and disaggregated reports to compare models, measure output quality, and quantify the real contribution of graph components.

Aria Haman Mehr Parseh company mark
The company behind the work

Aria Haman Mehr Parseh Knowledge-Based Software Company

Haman Labs and Rakhshai Graph-based NLP (RGN) are part of our long-term path toward Persian-centered technology, AI infrastructure, and extensible knowledge tools. For us, native technology begins with Iran's language, culture, and data while remaining interoperable with open standards and global tools.

The “Graph-Based Natural Language Processing Service Library” based on Rakhshai Graph-based NLP (RGN) has received knowledge-based product certification in Iran.

ABOUT US · A PRIVATE-SECTOR INITIATIVE

Built in the private sector, for a human purpose

This project has been researched, funded, and developed by the private sector. Our ultimate aim is not technology alone: we want AI to serve peace, friendship, and dialogue—and to reveal the expressive, semantic, and knowledge-bearing power of Persian in the age of artificial intelligence.

PeaceFriendshipPersianOpen knowledge
Open, so you can build

Inspect, run, and extend Persian language infrastructure

Rakhshai Graph-based NLP (RGN) is released under the MIT License. Its architecture, command-line tools, Python API, documentation, and model-building workflows are available in the project repository.