feat: documents contribute to the knowledge graph
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 28/100
Línea de trabajo
Start by reading ExtractKnowledgeUseCase, InferenceScheduler, PromptBudget, and RagPipeline to understand the existing note extraction and retrieval paths. Work out how document identity and long inputs should be handled before implementation; the issue leaves both open. Done means a document is extracted once per document, participates in graph expansion, and long inputs are handled without silent truncation.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Notes participate in a knowledge graph — e tags are edges, t tags are topic nodes, and ExtractKnowledgeUseCase pulls entities and relations that feed graph expansion during retrieval. A document's chunks participate in none of it. They are retrieved by vector similarity alone, then explicitly skip graph expansion and memory lookup, because a chunk is not a graph node (RagPipeline).
So a PDF that is entirely about a topic the user has notes on contributes nothing to the graph around that topic, and a question answered from the graph never reaches the document.
What to build
Let a document contribute to the graph — one extraction pass per document, not per chunk.
Per-chunk extraction is the wrong shape and worth stating plainly: a long PDF is dozens of chunks, each pass is an LLM call on a device already contending for the model with chat and Gana, and chunk boundaries cut mid-argument so the extracted relations would be worse than from whole text. Document-level extraction is one call over the joined text, which is also what the existing note path already does.
Pointers:
ExtractKnowledgeUseCaseis the existing extraction path; the question is whether it generalises or needs a document-shaped siblingInferenceSchedulerhas a T2 extract tier — document extraction belongs there, not on the chat pathPromptBudgetcaps what one call can carry; a long document will not fit in one pass on the smallest local model, so this needs a real answer for long inputs rather than silent truncation
Open questions
- What is a document's node identity in the graph? The attaching note, or the document itself? A document can be attached to more than one note.
- Does a not-searchable scan get any graph presence at all?
Part of #228 · Feature it follows from: #226
Status: backlog (2026-10-13)
Not feasible to do well with on-device compute today, so this is parked. The reasoning is in the comment below; the short version: local models cap one call at 1k-8k tokens (PromptBudget), a PDF is 10k-100k+, and every workaround (truncate, per-chunk calls, map-reduce) is either wrong or too expensive on a phone that is already contended. Revisit when local context and throughput improve, or when UNIUN Cloud is the default for extraction.
Options to consider later (no LLM call, not built)
- Attachment edge. A document is already attached to a note. Treat that as a graph edge so expansion reaching the note brings its document's top chunks. Zero cost; overlaps with #236.
- Vector-derived related edges. At index time compare a document's chunk vectors (or centroid) to existing note vectors and store the top matches as note-document edges. A few dot products, no model call.
- Non-LLM topic nodes. RAKE or TF-IDF keyphrases over the already-extracted text become topic nodes, the way
ttags do for notes. - Cloud-only extraction, opt-in. A single full-document pass is realistic only with a large cloud context window. Gate on
LlmBackendType.uniunCloud; needs a privacy note since document text leaves the device.
Still to answer before building any of these: is a document's node identity the attaching note or the document itself (it can be attached to several notes), and does a not-searchable scan get any graph presence?
- Lenguaje dominante
- Dart
- Estrellas
- 2
- Forks
- 2
- Merge medio
- 1 d 7 h
- PR fusionados (30 d)
- 35
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de basictech01/uniun
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
basictech01/uniun#300 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue P2-Medium
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
basictech01/uniun#296 ·
Los mantenedores suelen responder en 1 día
-
bug good first issue P2-Medium
Dificultad 4/5 1-2 días Aptitud para principiantes 22/100
basictech01/uniun#293 ·
Los mantenedores suelen responder en 1 día
-
bug P1-High
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
basictech01/uniun#286 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
P3-Low
Dificultad 4/5 1-2 días Aptitud para principiantes 30/100
basictech01/uniun#282 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de basictech01/uniun
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
0niel/university-app#617 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
linagora/tmail-flutter#5010 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
chriskelly/wish-together#36 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Web Guide has broken linksAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AppFlowy-IO/AppFlowy#9075 ·
-
[web] Semantics `lang` attribute uses `Locale.toString()`, producing invalid tags like `es_US`Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día