Creating a New Topic
Create a topic node
Start by creating a topic with a clear title and description. The topic represents what you want to learn — for example, “Linear Algebra” or “React Hooks”.Topics are stored as nodes with
type="root" in the database. Each topic belongs to a branch and is associated with your user account.Upload learning materials
Upload documents that contain the content you want to learn. Sprout supports:
- PDF files (
application/pdf) - Plain text files (
text/plain) - Markdown files (
text/markdown,text/x-markdown)
- Uploaded to S3 storage
- Text is extracted and stored in the database
- Extraction status is tracked (
pending,completed, orfailed)
Generate your learning path
Once documents are uploaded, trigger the Topic Agent to generate your personalized learning path:The Topic Agent will:
- Analyze your uploaded documents
- Generate 6-10 major concepts (or 1-2 if
small: true) - Extract relevant context from your documents for each concept
- Create dependency relationships between concepts
- Stream progress updates via Server-Sent Events (SSE)
The learning path generation happens in two phases:
- Topic Agent creates the concept sequence
- Subconcept Bootstrap Agents run in parallel (max 3 concurrent) to build the learning structure for each concept
Document Management
Viewing Uploaded Documents
Retrieve all documents for a topic:- Document ID and filename
- File size and MIME type
- Extraction status
- Upload timestamp
Deleting Documents
Remove a document from your topic:Behind the Scenes: How Topics Are Generated
When you run the Topic Agent, it uses Claude to:- Plan the concept sequence — Decides which major concepts to teach and in what order
- Extract document context — Uses the
extract_all_concept_contextstool to batch-extract relevant sections from your uploaded documents - Save concepts — Creates each concept node using the
save_concepttool - Wire dependencies — Creates edges between concepts using
save_concept_edgeto represent the learning order
Real-Time Progress Updates
The agent streams events via SSE so you can track progress:| Event | Description |
|---|---|
agent_start | Topic Agent has started |
agent_reasoning | Claude’s reasoning between tool calls |
tool_call | Tool invocation (e.g., saving a concept) |
node_created | New concept node created |
edge_created | Dependency edge created |
agent_done | Topic Agent completed successfully |
After the Topic Agent completes, Subconcept Bootstrap Agents automatically run for each concept to create diagnostic questions and subconcepts. This happens concurrently with a limit of 3 agents at a time to prevent rate limiting.
Small Mode for Testing
During development or testing, usesmall: true to generate a minimal learning path:
- 1-2 concepts instead of 6-10
- 2-3 subconcepts per concept instead of 8-12
- 2-3 diagnostic questions instead of 5-10
Next Steps
After your topic is created and the learning path is generated:- Take the diagnostic assessment for each concept to personalize your learning
- Review the adaptive learning graph that Sprout builds based on your answers
- Start learning with the AI tutor
You can view your learning path structure by querying nodes and edges for your topic. Each concept contains multiple subconcepts arranged in a DAG (Directed Acyclic Graph) that represents prerequisite relationships.