Skip to content

iyulab/topica

Repository files navigation

Topica

Local-first AI learning companion — turn any topic into a full study kit, running entirely on your machine.

License: MIT Status Platform


What It Does

Enter a topic. Topica runs web research and a short survey in parallel, then automatically generates a full learning kit — summary, lecture, flashcards, quiz, and mind map — all stored locally.

A built-in RAG chat lets you ask questions grounded in your own research docs. A knowledge graph tracks tag-based and embedding-based relationships between topics. Content adapts to your level (Lv 1–10), calibrated by quiz performance — and the system recommends the right level for your next session.


Features

Feature Description
6-tab Studio Summary · Lecture · Flashcard · Quiz · Mind map · RAG Chat — all generated per topic
Level Adaptation Quiz results adjust your level (Lv 1–10); GET /recommendation suggests the next content level
Knowledge Graph AI-extracted tags, OpenAI embeddings, cosine similarity — interactive SVG graph with force-directed layout
RAG Chat Answers grounded in your per-topic research documents
Survey SSE-streamed question flow to refine the topic description before generation
Queue Persistence Content generation queue survives app restarts (SQLite-backed)
Settings Chat model, embedding model, and prompt language — all configurable via UI

Philosophy

Principle What it means
Local AI first Designed for local models (in progress); currently requires an OpenAI API key for AI features. Stub mode runs without a key.
Privacy by design All data stays on your machine — SQLite, no telemetry, no cloud dependency.
Generation, not authoring You provide the topic; Topica builds the curriculum. Not a note-taking tool.
Open source, zero cost Quality learning tools should be accessible to everyone.

UI Design Principles — the UX guidelines that shape how Topica looks and feels.


Scope

In scope

  • Topic → auto-generated learning kit (Summary · Lecture · Flashcard · Quiz · Mind map)
  • Level-adaptive content (Lv 1–10), adjusted by quiz performance and history-based recommendation
  • Knowledge graph: tag extraction, embedding-based similarity, force-directed SVG visualization
  • RAG chat scoped to each topic's research documents
  • Windows, macOS, Linux desktop app (Tauri)

Non-goals

Contributions or feature requests in these areas will be declined:

  • Cloud sync / multi-device — local-only is a core design constraint, not a missing feature
  • Collaboration / content sharing — single-user learning tool
  • General-purpose AI chat — chat is topic-scoped Q&A; Topica is not a ChatGPT replacement
  • Manual content editing — content is generated by AI; manual authoring is out of scope

Architecture

Tauri shell (Rust)
  ├── Frontend   Vite + React 19 + TypeScript
  │                HTTP REST + WebSocket — localhost, dynamic port
  └── Backend    C# ASP.NET Core sidecar (Minimal API)
                   ├── TopicModule · ContentModule · ChatModule
                   ├── GraphModule · EvalModule · TagModule
                   ├── RAGModule · SurveyModule · SettingsModule
                   └── SQLite (EF Core 10) · ContentQueueWorker

Stack: Tauri 2, React 19, TypeScript, C# .NET 10, EF Core 10, SQLite, Microsoft.Extensions.AI, WebLookup, Zustand


Status

Phase Status Summary
Phase 1: Foundation ✅ Done Tauri + C# sidecar + SQLite schema + REST/WS
Phase 2: Topic Pipeline ✅ Done Topic CRUD · web research · content generation
Phase 3: Studio + Chat ✅ Done 6-tab studio · RAG chat · OS notifications · AI settings
Phase 3.5: RAG + Survey ✅ Done Embedding-based RAG · SSE survey streaming
Phase 4: Knowledge Graph ✅ Done EvalSession · tags · embeddings · graph UI
Phase 5: Stabilization ✅ Done 30/30 tests · force layout · level recommendation · queue persistence · installer
Phase 6: CI + Resilience ✅ Done CI workflow (push/PR) · WS exponential back-off reconnect · content regeneration UX · 33/33 tests

Pre-built releases (Windows NSIS/MSI, macOS dmg, Linux AppImage/deb) are published on GitHub Releases.

Requires .NET 10 Runtime on the target machine.


Getting Started (Development)

Prerequisites: Tauri v2 prerequisites · pnpm · .NET 10 SDK

git clone https://github.com/iyulab/topica
cd topica
pnpm install

Build the C# sidecar before first run (the binaries/ directory is gitignored):

# Windows
dotnet publish backend/Topica.Api/Topica.Api.csproj \
  -c Release -r win-x64 --self-contained false \
  -o src-tauri/binaries/pub-temp
# copy Topica.Api.exe → src-tauri/binaries/Topica.Api-x86_64-pc-windows-msvc.exe
# copy *.dll, *.json → src-tauri/binaries/
# remove pub-temp

Then start the dev server:

pnpm tauri dev

The C# backend starts automatically as a sidecar on a dynamic port. No separate server process needed.

AI Setup

Open Settings in the app and enter your OpenAI API key. Without a key, Topica runs in stub mode — the app works but AI-generated content is replaced with a placeholder.


Contributing

Issues and pull requests are welcome. Before opening a feature request, read Scope — the Non-goals section is an explicit policy, not a backlog.


License

MIT

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages