Trilium Notes (TriliumNext)¶
Trilium Notes is a hierarchical note-taking application with a focus on building large personal knowledge bases. Following the transition of the original project to maintenance mode, the community-driven TriliumNext fork has become the primary active branch, introducing significant modern features for the July 2026 agentic era.
What it is¶
Trilium Notes is a hierarchical note-taking application focused on building large personal knowledge bases. It features deep nesting, powerful scripting (JavaScript), and advanced visualization of note relationships. The TriliumNext fork continues this legacy with improved performance, security, and modern note types like native spreadsheets. In July 2026, it is a primary destination for structured memory for agents like Gemma 3.
What problem it solves¶
Managing thousands of notes with complex inter-relationships is difficult in standard "flat" or "shallow" note apps. Trilium solves this by treating notes as a forest of trees, allowing a single note to exist in multiple places (cloning), and providing an automation engine to manage metadata and note lifecycle. It prevents "knowledge rot" by allowing deep structural organization that mirrors complex mental models.
Where it fits in the stack¶
Category: Services / Knowledge Management. It serves as the core intellectual repository for structured long-term knowledge, research, and documentation. It integrates with the broader homelab via its REST API, acting as a destination for automated data ingestion from n8n or agentic workflows.
Typical use cases¶
- Personal Knowledge Base (PKB): Building a "second brain" with deep hierarchical structure.
- Agentic Journaling: Using scripts to automatically summarize daily logs via Gemma 3 or Claude 4.8 Opus.
- Technical Snippet Management: Storing and executing code snippets within the knowledge tree.
- Structured Data Analysis: Managing household or research data using the built-in Spreadsheet note type.
- Document Archival: Digitizing paper notes and PDFs via built-in OCR and indexing.
Strengths¶
- Extreme Flexibility: Hierarchical structure with support for cloning notes into multiple locations.
- Programmability: Built-in JavaScript scripting engine for automating note behavior and metadata.
- Native Spreadsheets: Integrated Excel-like editing via Univer Sheets, allowing calculations within the KB.
- Advanced OCR: Built-in engine automatically extracts and indexes text from images, PDFs, and Office documents.
- Self-Hostable: Strong synchronization capabilities for private, local-first knowledge management.
Limitations¶
- Learning Curve: The high feature density and scripting capabilities require time to master.
- UI Complexity: The interface can feel cluttered compared to modern minimal "block-based" editors.
- Legacy Scripting: Older scripts using
api.axiosmust be migrated to the nativefetch()API in versions 0.103+.
When to use it¶
- When you need a "forest" rather than a "flat list" for your notes.
- When you want to programmatically automate your knowledge base (e.g., auto-tagging, dynamic dashboards).
- When you require integrated spreadsheet capabilities and deep document search in a single tool.
- When you prefer a local-first, self-hosted solution over proprietary SaaS.
When not to use it¶
- For quick, ephemeral scratchpad notes (use a simple tool like Logseq).
- If you prefer a highly polished, mobile-first SaaS experience with minimal configuration.
Getting started¶
The easiest way to self-host TriliumNext is via Docker.
Installation (Docker)¶
docker run -d -p 8080:8080 -v ~/trilium-data:/home/node/trilium-data triliumnext/notes:latest
Initial Setup¶
- Access the UI at
http://localhost:8080. - Follow the setup wizard to create your account and data directory.
- Enable OCR in the Media options to begin indexing your document attachments.
CLI examples¶
While Trilium lacks a standalone CLI binary, it is fully manageable via the REST API and Docker commands.
# Health Check
curl http://localhost:8080/api/health
# Search via API (requires setup of authentication token)
curl -H "Authorization: <your_token>" "http://localhost:8080/api/notes?search=markdown"
# Note Export
curl -H "Authorization: <your_token>" "http://localhost:8080/api/notes/<note_id>/export?format=html" -o note.html
API examples¶
Create a Note (Python)¶
Utilize Gemma 3 or Claude 4.8 Opus to orchestrate note creation via the REST API and MCP 3.0.
import requests
TRILIUM_URL = "http://localhost:8080/api"
API_TOKEN = "your-api-token"
headers = {"Authorization": API_TOKEN}
note_data = {
"parentNoteId": "root",
"title": "Agentic Insights",
"type": "text",
"content": "Content generated by Gemma 3 via MCP 3.0."
}
response = requests.post(f"{TRILIUM_URL}/notes", json=note_data, headers=headers)
print(response.json())
Modern Scripting (JavaScript)¶
TriliumNext v0.103+ utilizes native fetch.
// Fetch-based pattern for internal scripts
const response = await fetch('https://api.example.com/data');
const data = await response.json();
api.log(`Data retrieved: ${data.message}`);
Related tools / concepts¶
- Obsidian — The primary markdown-based alternative.
- Logseq — For privacy-first outliner-based knowledge.
- Joplin — For a simpler, cross-platform notebook experience.
- AnyType — A decentralized, object-based alternative.
- SilverBullet — A hackable, markdown-based knowledge base.
- n8n — For automating data ingestion into Trilium.
- Paperless-ngx — For dedicated document management and advanced OCR workflows.
- Excalidraw — For embedding hand-drawn diagrams into notes.
- Gemma 3 — For local inference and knowledge synthesis.
- Claude 4.8 — For high-performance agentic reasoning over the PKB.
Sources / references¶
Contribution Metadata¶
- Last reviewed: 2026-07-21
- Confidence: high