How facebookresearch/parlai works
ParlAI is a research framework for training and evaluating dialogue and multimodal agents against a shared catalog of tasks, as well as connecting agents to human participants. A typical workflow configures a run, loads a task and agent, exchanges observations and actions in a world, and evaluates model output. Core abstractions support that workflow; separate subsystems provide retrieval, pretrained models, crowdsourcing, and live chat. The relationships shown are limited to README statements and SOURCE INDEX references; unsampled components are represented at their existing directory paths.
Main entry points: agents.py Agent lifecycle · chat_service_manager.py Chat service manager · params.py Argument parsing · agents Reference agents
Components 20
Run configuration
- Argument parsing
parlai/core/params.py - Run options
parlai/core/opt.py
Core framework
- Task catalog
parlai/tasks - Dataset teachers
parlai/core/teachers.py - Dialogue worlds
parlai/core/worlds.py - Observations and actions
parlai/core/message.py - Agent lifecycle
parlai/core/agents.py - Torch agent base
parlai/core/torch_agent.py - Token dictionary
parlai/core/dict.py - Evaluation metrics
parlai/core/metrics.py
Agents and retrieval
- Reference agents
parlai/agents - RAG dialogue model
parlai/agents/rag/rag.py - Retrieval backends
parlai/agents/rag/retrievers.py - TF-IDF retrieval
parlai/agents/tfidf_retriever/tfidf_retriever.py - Pretrained models
parlai/zoo
Human interaction
- Crowdsourcing tasks
parlai/crowdsourcing - Chat service manager
parlai/chat_service/core/chat_service_manager.py - Chat channels
parlai/chat_service/services
Other components
- Researcher
- Human participant
Connections 22
- Researcher → Argument parsing: configures run
README.md - Argument parsing → Run options: builds options
parlai/core/params.py - Argument parsing → Task catalog: loads task options
parlai/core/params.py - Researcher → Task catalog: selects dataset
README.md - Task catalog → Dataset teachers: provides datasets
README.md - Dataset teachers → Dialogue worlds: supplies examples
README.md - Dialogue worlds → Agent lifecycle: runs agents
README.md - Agent lifecycle → Observations and actions: observes and acts
parlai/core/agents.py - Agent lifecycle → Run options: loads model options
parlai/core/agents.py - Agent lifecycle → Token dictionary: uses dictionary
parlai/core/agents.py - Researcher → Reference agents: chooses model
README.md - Reference agents → Torch agent base: extends agent base
parlai/agents/rag/rag.py - Torch agent base → Evaluation metrics: tracks evaluation
- Reference agents → Pretrained models: loads pretrained weights
README.md - RAG dialogue model → Retrieval backends: uses retrieval
parlai/agents/rag/rag.py - Retrieval backends → TF-IDF retrieval: supports TF-IDF
parlai/agents/rag/retrievers.py - Researcher → Crowdsourcing tasks: runs human evaluation
README.md - Researcher → Chat service manager: connects agent
README.md - Chat service manager → Chat channels: serves channels
parlai/chat_service/services/messenger/messenger_manager.py - Human participant → Chat channels: sends messages
- Chat service manager → Agent lifecycle: creates agents
parlai/chat_service/core/chat_service_manager.py - Chat service manager → Dialogue worlds: runs worlds
parlai/chat_service/core/chat_service_manager.py