A portable, self-contained learning system built on top of an agentic coding framework (I'm using opencode).
The system asks questions to gauge your understanding of a topic, and creates a learning plan for you. It then continues to ask and teach you based on where you are. You can also watch your understanding of each topic develop over time.
Each topic is an independent agent with its own persistent memory, gap document, and tailored learning plan.
new_topic.sh script initializes a new directory for each topic you want to learn about.
Mainly to get familiar with opencode, agents and subagents. It's probably all in the wrong places but it seems to work. Also to explore how a LLM might be used for tailored learning about a topic.
The secretary subagent is unnecessary if you were to do this using another agentic framework or as a chat app but I included it so opencode doesn't show all the details of what it wants to write, for example all the blurb in gaps and context.
It might use too much context as it goes on - for example the directive to read learning-plan.md and gaps.md before every response. This might be a kind of "token spending fear" on my part.
- Create a main agent so you can use /learn to start the process. At the moment the main default /build agent will read AGENTS and get started correctly.
- Make it more explicit to the user how to end the session.
- I think just quitting via /exit wouldnt do the session close tasks.
- Evaluate how the external tools e.g. web_fetch and the code runner are used, and how to trigger them by the user
Running new-topic.sh will create the files in the topics directory based on the templates, and then will store the topic specific files within this new topic sub directory:
okls/
├── _template/
│ └── .opencode/skills/ skill definitions (interviewer / mapper / teacher)
│ └── .opencode/agent/ sub agent for secretary tasks (write and update to files)
├── topics/
│ ├── index.md auto-updated list of all topics
│ └── <topic>/ one directory per topic
│ ├── AGENTS.md main agent orchestrator
│ ├── .opencode/skills/ skill definitions (interviewer / mapper / teacher)
│ ├── .opencode/agent/ sub agent for secretary tasks (write and update to files)
│ ├── TOOLS.md tool usage guidance
│ ├── gaps.md live knowledge map (written by agent)
│ ├── learning-plan.md tailored curriculum (written by agent)
│ ├── context.md working memory across sessions (written by agent)
│ └── sessions/ per-session transcripts (written by agent)
└── new-topic.sh bootstrap script
./new-topic.sh "fermentation science"
cd topics/fermentation-science
opencodeThe agent reads AGENTS.md on startup and begins the interview.
cd topics/quantum-computing
opencodeThe agent reads context.md first and picks up where you left off.
The agent follows a three-phase loop:
Phase 1 — Interview
The agent asks one Socratic question at a time. It silently scores your answers, records structured entries in gaps.md, and continues until it maps at least five concept areas.
Phase 2 — Map & Plan
The agent reviews gaps.md, identifies your learning path, and writes learning-plan.md.
Phase 3 — Teach & Augment During each session, the agent reads your learning plan and recorded knowledge gaps. It teaches one concept at a time using an intuition → mechanism → check sequence, then updates its memory after every turn.