What you will achieve now
A decision or applied practice for «Minimal local RAG with SQLite and Ollama».
- 1 Understand the criterion
- 2 Do a small practice exercise
- 3 Save evidence
A short note on what you did, what went well, what failed, and what you would review later.
- Separate documents, index, retrieval, and generation.
- Set up a local experiment with SQLite and Ollama.
- Evaluate citations, out-of-scope answers, and hardware cost.
Minimal architecture
Store fictional or anonymized documents in a folder, keep their name, version, and date, and create a SQLite table with text and metadata. For a first test you can retrieve by words or FTS5; add embeddings only when an evaluation shows that literal search is not enough. Ollama runs the model locally, but the result still needs citations and review.
Flow of a question
- Normalize the question and apply the user's permission.
- Retrieve a few relevant fragments.
- Include `source`, title, version, and date in the context.
- Ask for a brief answer or «not found» if evidence is missing.
- Return citations and log the query, model, and latency.
Contract example
The model must not invent policies. If the fragments do not contain the answer, it must say so and propose which document is missing. The application must never turn recovered text into instructions with permissions.
Technical sources
- Official Ollama API .
- SQLite FTS5 .
- SQLite security .
documentos/ -> SQLite (texto + fuente + versión)
pregunta -> recuperación limitada -> contexto con citas
-> Ollama (localhost)
-> respuesta / abstención / logIf you have saved the evidence from this lesson, continue with «First secure MCP for the office». If not, repeat the check before moving on.
Learn with a verifiable reference
Aulafy distinguishes stable concepts from data that changes —versions, prices, models, and commands—. Check the course sheet for the review date, the verified scope, and the primary sources.
«Editorial review» means that structure, claims, and sources have been reviewed. It does not mean that every command has been executed: when a technical test exists, it will be indicated as such.