Skip to content

ayeshakhalid192007-dev/humanoid-ai-studio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

86 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Humanoid AI Studio

AI-Native Educational Platform for Physical AI & Humanoid Robotics

Live Book Backend Auth Server License: MIT gitagent


Docusaurus FastAPI Python TypeScript


What Is Humanoid AI Studio?

Humanoid AI Studio is a production-grade learning platform for Physical AI and Humanoid Robotics education. It delivers a 4-module interactive curriculum through a Docusaurus book, guided by an embedded RAG-powered chatbot that answers questions directly from the course content, with OAuth2 social login and AI-powered personalization.

The problem it solves:

  • Static documentation sites have no AI layer β€” learners get stuck with no contextual help
  • Robotics education content is scattered with no unified, progressive learning path
  • No personalization β€” every learner gets the same experience regardless of language or background

How it works:

graph LR
    A[Student Signs Up] --> B[OAuth2 Login]
    B --> C[Module 1 Unlocked]
    C --> D{Learn via Book}
    D --> E[Ask RAG Chatbot]
    D --> F[Select Text β†’ Ask About This]
    D --> G[Request Personalized Chapter]
    G --> H[Urdu or Custom Language]
    E --> I[Gemini Streams Response]
    I --> D
    D --> J[Module 2 β†’ 3 β†’ 4]
    J --> K[Capstone: Autonomous Humanoid]
Loading

πŸ—οΈ System Architecture

graph TB
    subgraph Client["Client Layer"]
        FE["Docusaurus Book\n(Netlify)"]
    end

    subgraph Auth["Auth Layer"]
        AUTH["Better-Auth OIDC Server\n(Railway Β· Node.js)"]
        JWKS["JWKS Endpoint\n/.well-known/jwks.json"]
    end

    subgraph API["API Layer"]
        BACKEND["FastAPI Backend\n(Railway Β· Python 3.11)"]
        MW["JWKS Middleware\nJWT Validation"]
    end

    subgraph AI["AI Layer"]
        RAG["RAG Pipeline\nQdrant + Sentence Transformers"]
        GEMINI["Google Gemini\nStreaming SSE"]
        PERSONALIZE["Personalization Agent\nUrdu / Custom Language"]
    end

    subgraph Data["Data Layer"]
        PG[("PostgreSQL\nNeon")]
        REDIS[("Redis\nCache + Rate Limit")]
        QDRANT[("Qdrant\nVector Store")]
    end

    FE -->|"OAuth / Session"| AUTH
    FE -->|"API Calls"| BACKEND
    AUTH --> JWKS
    AUTH --> PG
    BACKEND --> MW
    MW --> JWKS
    BACKEND --> RAG
    BACKEND --> PERSONALIZE
    BACKEND --> PG
    BACKEND --> REDIS
    RAG --> QDRANT
    RAG --> GEMINI
Loading

πŸ”„ Request Flow

sequenceDiagram
    participant U as User
    participant FE as Docusaurus Book
    participant AUTH as Better-Auth OIDC
    participant API as FastAPI Backend
    participant AI as RAG / Gemini
    participant DB as Neon Postgres

    U->>FE: Visit Book
    FE->>AUTH: Sign In (Google / GitHub)
    AUTH-->>FE: JWT Access Token (RS256)
    FE->>API: Chat Request + Bearer Token
    API->>AUTH: Verify via JWKS endpoint
    AUTH-->>API: Token valid
    API->>DB: Fetch user session
    DB-->>API: Session data
    API->>AI: RAG query with curriculum context
    AI-->>API: Streamed response (SSE)
    API-->>FE: Response
    FE-->>U: Answer rendered in chat widget
Loading

πŸŽ“ 4-Module Learning Path

graph LR
    S1["Module 1\nROS 2"]
    S2["Module 2\nSimulation"]
    S3["Module 3\nNVIDIA Isaac"]
    S4["Module 4\nVLA Capstone"]

    S1 --> S2
    S2 --> S3
    S3 --> S4

    style S1 fill:#3B82F6,color:#fff
    style S2 fill:#22C55E,color:#fff
    style S3 fill:#F97316,color:#fff
    style S4 fill:#EF4444,color:#fff
Loading

Each module builds on the previous. All lessons follow the Prediction β†’ Execution β†’ Reflection cycle and include executable code, observable outcomes, and debugging scenarios.


πŸ› οΈ Technology Stack

Frontend

Docusaurus React TypeScript Tailwind CSS Framer Motion

Backend

Python FastAPI Uvicorn Pydantic

Auth Server

Node.js Express Better Auth

AI & ML

Google Gemini OpenAI Sentence Transformers

Databases

Qdrant Neon Postgres Redis

Infrastructure

Railway Netlify Docker OpenTelemetry Prometheus


✨ Key Features

πŸ€– RAG Chatbot

  • Google Gemini + SSE streaming responses
  • Qdrant vector retrieval (cosine similarity)
  • Sentence Transformers β€” local, free embeddings
  • Text-selection triggered queries
  • Full-book or selected-text search modes
  • Rate limiting: 20 queries/hour per user

πŸ” Authentication

  • Better-Auth OIDC (RS256 JWT)
  • Google + GitHub OAuth2 social login
  • JWKS endpoint for token verification
  • Secure cross-domain session management
  • User profiles in Neon Postgres

🌐 AI Personalization

  • Generate custom chapters on demand
  • Urdu language support
  • Translation endpoint for curriculum content
  • Multi-agent skill pipeline orchestration

πŸ“‘ Observability

  • OpenTelemetry distributed tracing
  • Prometheus metrics export
  • Structured JSON logging
  • Health check endpoints on all services
  • Per-user rate limiting via Redis

πŸš€ Getting Started

Prerequisites

Tool Version
Node.js 18+
Python 3.11+
Docker Latest
Ubuntu 22.04 LTS (recommended)
GPU (Module 3+) NVIDIA with 6GB+ VRAM

1. Clone

git clone https://github.com/ayeshakhalid192007-dev/humanoid-ai-studio.git
cd humanoid-ai-studio

2. Configure Environment

cp .env.example .env

Key values in .env:

GEMINI_API_KEY=your_gemini_key
OPENAI_API_KEY=your_openai_key_fallback
QDRANT_URL=https://your-cluster.qdrant.io
QDRANT_API_KEY=your_qdrant_key
DATABASE_URL=postgresql://user:pass@host/db
BETTER_AUTH_SECRET=your_secret
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
CORS_ORIGINS=http://localhost:3000
RATE_LIMIT_QUERIES_PER_HOUR=20

3. Start Auth Server

cd auth-server && npm install && npm start
# Runs on http://localhost:3002

4. Start Backend API

cd backend
pip install -r requirements.txt
uvicorn main:app --reload --port 8000
# API docs: http://localhost:8000/docs

5. Start the Book

cd book && npm install && npm start
# Runs on http://localhost:3000

For detailed setup, see quickstart.md


πŸ€– AI Agent Architecture (gitagent)

Humanoid AI Studio uses gitagent β€” a framework-agnostic, git-native standard for defining AI agents. The agent is version-controlled alongside the codebase, exportable to any LLM framework, and composable across skills.

# Export the agent as a system prompt (works with any LLM)
npx gitagent export --format system-prompt

# Export as Claude Code CLAUDE.md
npx gitagent export --format claude-code

# Validate agent configuration
npx gitagent validate

# View agent info
npx gitagent info

Agent Structure

graph TB
    subgraph Agent["humanoid-ai-studio agent"]
        SOUL["SOUL.md\nAria β€” AI tutor identity"]
        RULES["RULES.md\nSafety & content boundaries"]
        AGENTS["AGENTS.md\nSub-agent delegation map"]
        YAML["agent.yaml\nModel, skills, runtime config"]
    end

    subgraph Skills["skills/"]
        S1["rag-tutor\nCurriculum Q&A via Qdrant"]
        S2["personalize-chapter\nAdaptive chapter generation"]
        S3["translate-urdu\nRTL Urdu translation"]
        S4["ros2-guide\nROS 2 Humble step-by-step"]
        S5["code-explainer\nRobotics code walkthrough"]
    end

    subgraph Knowledge["knowledge/"]
        K["index.yaml\nCurriculum + spec document registry"]
    end

    YAML --> Skills
    SOUL --> YAML
    RULES --> YAML
    AGENTS --> YAML
    Skills --> Knowledge
Loading

Skills

Skill Purpose Trigger
rag-tutor Answers curriculum questions via Qdrant + Gemini RAG Any factual robotics question
personalize-chapter Rewrites chapters for learner's background + language "Personalize this chapter"
translate-urdu Translates prose to Urdu RTL, preserves all code "Translate to Urdu"
ros2-guide Step-by-step ROS 2 Humble Hawksbill guidance ROS 2 how-to questions
code-explainer Explains robotics Python/YAML/SDF code line by line "Explain this code" / debug requests

Sub-Agents

graph LR
    O["Orchestrator\nhumanoid-ai-studio"]
    O -->|"curriculum question"| R["rag-tutor\nQdrant + Gemini SSE"]
    O -->|"personalize request"| P["personalization-agent\nProfile + RAG + Gemini"]
    O -->|"translate request"| T["translation-agent\nUrdu RTL output"]
    O -->|"auth / session"| A["auth-agent\nBetter-Auth OIDC"]
Loading

πŸ“ Project Structure

humanoid-ai-studio/
β”œβ”€β”€ book/                    # Docusaurus 3 frontend (React, TypeScript, Tailwind)
β”‚   β”œβ”€β”€ docs/                # Curriculum markdown (modules 1–4, capstone)
β”‚   └── src/                 # React components, pages, context, plugins
β”‚
β”œβ”€β”€ backend/                 # FastAPI RAG backend (Python 3.11)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/             # Endpoints: chat, personalize, translate, sessions, auth
β”‚   β”‚   β”œβ”€β”€ ai/              # Gemini client, orchestrator, RAG/personalization agents
β”‚   β”‚   β”œβ”€β”€ db/              # Qdrant (vector) + Neon Postgres clients
β”‚   β”‚   β”œβ”€β”€ models/          # Pydantic schemas
β”‚   β”‚   └── utils/           # Logging, monitoring, rate limiting
β”‚   └── main.py              # FastAPI app entry point
β”‚
β”œβ”€β”€ auth-server/             # Better Auth server (Node.js, Express)
β”‚   └── src/
β”‚       β”œβ”€β”€ index.js         # Express + Better Auth setup
β”‚       └── auth.js          # OAuth2/OIDC authentication logic
β”‚
β”œβ”€β”€ agent.yaml               # gitagent manifest β€” model, skills, runtime config
β”œβ”€β”€ SOUL.md                  # Agent identity (Aria β€” the AI tutor)
β”œβ”€β”€ RULES.md                 # Agent safety and content boundaries
β”œβ”€β”€ AGENTS.md                # Sub-agent delegation architecture
β”œβ”€β”€ skills/                  # Reusable AI skill modules (rag-tutor, ros2-guide, etc.)
β”œβ”€β”€ knowledge/               # Curriculum document registry for RAG
β”œβ”€β”€ specs/                   # SDD-RI feature specs (spec.md, plan.md, tasks.md)
β”œβ”€β”€ history/                 # Prompt History Records + Architecture Decision Records
└── .specify/                # SDD templates, scripts, project constitution

πŸ§ͺ Testing

Backend

cd backend
pytest

Book (Frontend)

cd book
npm run build    # type-check + production build

Standard testing environment:

  • OS: Ubuntu 22.04 LTS
  • ROS 2: Humble Hawksbill
  • Gazebo: Gazebo 11 (Module 2)
  • Isaac Sim: NVIDIA Isaac Sim 2023.1.1 (Module 3)

🚒 Deployment

All deployments are automated via GitHub Actions on push to main:

Workflow Path Trigger Target
deploy-book.yml book/** Netlify
deploy-backend.yml backend/** Railway
deploy-auth.yml auth-server/** Railway

Required GitHub Secrets: RAILWAY_TOKEN, NETLIFY_SITE_ID, NETLIFY_AUTH_TOKEN


πŸ“Š Implementation Progress

Auth & OAuth2 Login      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  Complete
RAG Chatbot              β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  Complete
Module 1 β€” ROS 2         β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  Complete
Module 2 β€” Simulation    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  Complete
Module 3 β€” NVIDIA Isaac  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  Complete
Module 4 β€” VLA Capstone  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  Complete
AI Personalization       β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  Complete
Observability            β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  Complete
CI/CD Deployment         β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  Complete

🀝 Contributing

  1. Fork the repository and create a branch: git checkout -b feature/<name>
  2. Follow SDD-RI: Specify β†’ Plan β†’ Implement β†’ Validate
  3. All Python-ROS 2 bridges must be reusable and documented
  4. Validate in the Standard Testing Environment before opening a PR

Code Standards: Python β€” PEP 8, type hints, async-first Β· TypeScript β€” strict mode Β· React β€” functional components only Β· All changes must include observable outcome verification


πŸ“„ License

MIT β€” see LICENSE


Contact

Maintainer contact information and community links to be added.

Constitution Version: 1.2.0 | Last Updated: 2026-03-27


DEVELOP AND DEPLOY THIS SO IT WILL BE BENEFICIAL FOR EVERYONE

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors