Skip to content

2Sigma Backend Documentation

Welcome to the 2Sigma Backend documentation! This is a FastAPI-based learning management system with AI-powered tutoring capabilities.

What is 2Sigma Backend?

2Sigma Backend is a comprehensive learning management system that provides:

  • Multi-tenant architecture for universities, departments, and courses
  • Hierarchical content structure with modules and learning materials
  • AI-powered chat tutoring using Claude (Anthropic API or AWS Bedrock)
  • Progress tracking at module and content levels
  • Authentication & authorization with JWT tokens
  • Langfuse-style versioned prompts for customizable AI behavior

Key Features

Multi-Tenant Learning Platform

Supports multiple universities with departments, courses, and course offerings. Each university operates independently with role-based access control.

AI-Powered Tutoring

Integrated LLM chat system with:

  • Context-aware conversations tied to specific content items
  • Streaming responses for real-time interaction
  • Versioned, label-based prompts (Langfuse-style)
  • Support for both Anthropic API and AWS Bedrock

Flexible Content Management

  • Hierarchical module structure (units, chapters, lessons, topics)
  • Polymorphic content items (videos, quizzes, labs, text, assignments)
  • JSONB-based flexible content storage
  • Reusable assets and templates

Comprehensive Progress Tracking

  • Module-level and content-level progress
  • Completion tracking with timestamps
  • User activity streaks
  • Enrollment management across course offerings

Technology Stack

  • Framework: FastAPI 0.109 (async)
  • Database: PostgreSQL with SQLAlchemy 2.0 (async)
  • Authentication: JWT with bcrypt
  • LLM Integration: LangChain with Anthropic/AWS Bedrock
  • Migrations: Alembic
  • Testing: pytest with async support

Documentation Organization

This documentation follows the Diátaxis framework:

  • Tutorials - Learning-oriented step-by-step guides
  • How-To Guides - Task-oriented practical instructions
  • Reference - Information-oriented technical specifications
  • Explanation - Understanding-oriented conceptual discussions

Contributing

Before contributing, please read:

  1. Local Development Guide
  2. Testing Guide
  3. Architecture Overview

Support

For questions and issues:


Next Steps: Start with the Getting Started Tutorial to set up your development environment.