How jaganparab02/samasocial-ai works
SamaSocial is an education platform with two user-facing workflows: a conversational assistant that ingests learning sources and answers with citations, and a course planner that generates and edits structured curricula. The graph follows documented frontend-to-backend access, then the sampled ingestion, retrieval, chat, and planner orchestration, with shared model and integration layers. Some router-to-service wiring and frontend learning-assistant wiring are not shown in the excerpts, so those connections are omitted or marked unverified rather than inferred.
Main entry points: document_pipeline.py Document ingestion · chat_pipeline.py RAG chat orchestration · service.py Plan generation · api FastAPI routers
Components 28
Frontend
- App routing
frontend/src/App.tsx - Learning assistant
frontend/src/pages/LearningAssistant.tsx - Course planner
frontend/src/pages/CoursePlanner.tsx - Chat state
frontend/src/hooks/useChat.ts - Planner state
frontend/src/hooks/usePlanner.ts - API client
frontend/src/services/apiClient.ts - Chat requests
frontend/src/services/chatService.ts - Response streaming
frontend/src/services/streamService.ts - Conversation persistence
frontend/src/services/conversationService.ts - Plan editor and preview
frontend/src/components/planner/CoursePlanPreview.tsx
Backend API
- FastAPI routers
backend/app/api
Learning Assistant
- Document ingestion
backend/app/rag/document_pipeline.py - Source parsers
backend/app/parsers - Document chunking
backend/app/rag/chunk_service.py - Source registry
backend/app/services/source_service.py - RAG chat orchestration
backend/app/chat/chat_pipeline.py - Semantic retrieval
backend/app/rag/retriever.py
Course Planning
- Plan generation
backend/app/planner/service.py - Curriculum services
backend/app/services/curriculum_service.py - Recommendations
backend/app/services/recommendation_service.py - Plan export
backend/app/services/export_service.py
Shared foundation
- Embeddings
backend/app/embeddings/service.py - Vector store
backend/app/vectordb/service.py - Prompt construction
backend/app/llm/prompt_builder.py - Groq LLM client
backend/app/llm/client.py - Session state
backend/app/chat/session_manager.py
Other components
- Educator
- Supabase
Connections 34
- Educator → App routing: uses
README.md - App routing → Learning assistant: routes to
frontend/src/App.tsx - App routing → Course planner: routes to
frontend/src/App.tsx - Learning assistant → FastAPI routers: uses REST/SSE
README.md - Course planner → Planner state: uses
frontend/src/pages/CoursePlanner.tsx - Course planner → Plan editor and preview: renders
frontend/src/pages/CoursePlanner.tsx - Chat state → Response streaming: streams via
frontend/src/hooks/useChat.ts - Chat state → Chat requests: calls
frontend/src/hooks/useChat.ts - Chat state → Conversation persistence: persists with
frontend/src/hooks/useChat.ts - Planner state → Conversation persistence: persists with
frontend/src/hooks/usePlanner.ts - Chat requests → API client: calls
frontend/src/services/chatService.ts - Response streaming → API client: calls
frontend/src/services/streamService.ts - Planner state → FastAPI routers: uses REST
README.md - Conversation persistence → Supabase: reads/writes
frontend/src/services/conversationService.ts - FastAPI routers → Document ingestion: dispatches to
- FastAPI routers → RAG chat orchestration: dispatches to
- FastAPI routers → Plan generation: dispatches to
- Document ingestion → Source parsers: extracts with
backend/app/rag/document_pipeline.py - Document ingestion → Document chunking: chunks via
backend/app/rag/document_pipeline.py - Document ingestion → Embeddings: generates
backend/app/rag/document_pipeline.py - Document ingestion → Vector store: indexes in
backend/app/rag/document_pipeline.py - Document ingestion → Source registry: registers source
backend/app/rag/document_pipeline.py - Semantic retrieval → Embeddings: embeds query
backend/app/rag/retriever.py - Semantic retrieval → Vector store: searches
backend/app/rag/retriever.py - RAG chat orchestration → Session state: manages sessions
backend/app/chat/chat_pipeline.py - RAG chat orchestration → Semantic retrieval: retrieves context
backend/app/chat/chat_pipeline.py - RAG chat orchestration → Prompt construction: builds prompts
backend/app/chat/chat_pipeline.py - RAG chat orchestration → Groq LLM client: generates answer
backend/app/chat/chat_pipeline.py - Plan generation → Semantic retrieval: retrieves context
backend/app/planner/service.py - Plan generation → Groq LLM client: generates plans
backend/app/planner/service.py - Plan generation → Curriculum services: uses
backend/app/planner/service.py - Plan generation → Recommendations: uses
backend/app/planner/service.py - Plan editor and preview → Planner state: edits plan
frontend/src/components/planner/CoursePlanPreview.tsx - Plan editor and preview → Plan export: exports plan