This project processes an Obsidian vault, generates flashcards, and provides a web UI to practice them. Key features include:
- Automatic vault ingestion into a PostgreSQL database.
- Flashcard generation using LLMs (Ollama, OpenAI, or Azure).
- A React frontend for reviewing flashcards.
- Optional semantic search capability using Qdrant for embeddings.
- Python 3.10+ and uv (https://docs.astral.sh/uv/)
- Node 20+ and pnpm (or npm)
- PostgreSQL (for storing flashcards and metadata)
- Qdrant vector database (for embeddings and semantic search)
- Ollama running locally (recommended), or OpenAI/Azure OpenAI key for LLM operations
- Copy the env template and edit configuration:
cp .env.example .env-
Edit
.envto configure:VAULT_DIR: path to your Obsidian vaultPOSTGRES_*: PostgreSQL connection details (default: localhost:5432)QDRANT_URL: Qdrant connection URL (default: http://localhost:6333)- LLM settings (
LLM_BACKEND=ollama|openai|azure)
-
Start required services:
# Start PostgreSQL (if not already running)
brew services start postgresql@14 # macOS
# or use your system's PostgreSQL service
# Start Qdrant using Docker
docker run -d -p 6333:6333 -v $(pwd)/qdrant_data:/qdrant/storage qdrant/qdrantInstall dependencies first:
cd backend
uv syncStart the server:
uv run python main.pyThe server will:
- Initialize the PostgreSQL database tables.
- Automatically ingest your Obsidian vault if the database is empty.
- Start the FastAPI server at
http://localhost:8000.
cd frontend
pnpm i # or: npm i
pnpm dev # or: npm run devOpen the shown local URL. The frontend will connect to the backend API to load flashcards.
{
"cards": [
{
"question": "string (Markdown supported; code fences allowed)",
"choices": ["A", "B", "C", "D"],
"correct_index": 0,
"hint": "optional"
}
]
}Questions can include code fences (js ... ). In the UI, hit V (or the Code button) to open the code preview pane and even Open Preview for html/js snippets.
The backend provides a REST API with the following endpoints (all under the /api/v1 prefix):
GET /health: Check server health and card count.GET /stats: Get statistics about the vault and database.GET /question/random: Get a single random flashcard.GET /questions/random?count=N: GetNrandom flashcards.
You can use these endpoints to build your own clients or integrate with other tools.
- If no LLM is configured, summarization/flashcards will fall back to a placeholder so the pipeline still runs.
- For best results: set
LLM_BACKEND=ollama(local) oropenaiand a suitable model in.env. - Make sure both PostgreSQL and Qdrant are running before starting the backend server
- The frontend automatically connects to the backend API for flashcard operations
Happy studying! 🎯