# Synapse

> A local notes and RAG lab: Markdown notes are indexed and answered with source citations, or refused when there is no source.

- Type: Side project by Maximilian Mitterbauer
- Stack: Docker Compose, FastAPI, Qdrant, Ollama, RAG
- Source: https://github.com/max-vie/synapse
- Page: https://www.mitmax.at/projects/synapse/

The text below is quoted from the project page, where Maximilian Mitterbauer writes in the first person.

## What

A private search over my own Markdown notes. Notes are published to Wiki.js and indexed in Qdrant, and questions come back as answers that cite the note they came from. Everything runs locally in Docker Compose, with local Ollama models.

## Why

I wanted answers I can check. An assistant that answers from my notes is only useful if I can see where each claim came from. Synapse refuses when there is no source instead of guessing.

## How

One FastAPI service, tested without Docker. Ingest, retrieval and the answer gate are plain Python behind typed interfaces, covered by 408 tests. An offline evaluation checks grounding, refusal, citations and prompt injection with fixed inputs; a separate proof runs the real stack. Neither is a claim about model quality.

## Steps, in order

- NOTE, Plain Markdown notes (Markdown): The Markdown file stays the source of truth. Each note gets a deterministic ID from its path and a SHA-256 content hash, so an edit or a new title updates the same note instead of adding another.
- PUBLISH, A readable copy (Ollama, Wiki.js): A local Ollama model formats the note and Synapse publishes it to Wiki.js over GraphQL. It checks the GraphQL response, not just the HTTP 200.
- INDEX, Indexed once (Qdrant): Chunks are embedded with nomic-embed-text and written to Qdrant with their metadata. Old chunks are removed only after the new ones are verified, so a re-run never piles up duplicates.
- RETRIEVE, Retrieval with a policy (Ollama, Qdrant): The question is embedded and searched in Qdrant. Candidates must clear a score threshold and match the question’s key terms before top-k applies, so similarity alone never counts as evidence.
- VALIDATE, An answer gate (FastAPI): Every citation must name a retrieved source with a locator, and the answer has to overlap the text quoted from that source. A draft that fails the gate is not shown.
- ANSWER, Cited, or refused (Ask): The terminal client shows the answer with its source path and the quoted support behind it. Without support it says: “I do not have enough indexed note context to answer that reliably.”

## Stack in detail

- Service: Python, FastAPI
- Data: Qdrant, Wiki.js over GraphQL, a Markdown vault
- Models: Ollama: nomic-embed-text and tinyllama by default
- Client: Ask, a terminal UI and CLI in Python
- Runtime: Docker Compose, bound to localhost
- Checks: pytest, offline evaluation, GitHub Actions

## Screens

- [Synapse](https://www.mitmax.at/projects/synapse/ask.gif): Synapse Ask answering from an indexed demo note. Recorded from the real terminal client against a deterministic local harness, not a live model. Image: Synapse Ask terminal UI. The question “What tools make up my knowledge system, and what are they used for?” is typed, the client shows Thinking, then answers that Markdown notes are the source of truth, Ollama provides local models, Qdrant stores searchable vectors, Wiki.js publishes readable copies and Ask is the terminal interface, ending in citation [1]. Below it the source: My Knowledge System, Synapse-Demo/knowledge-system-notes.md.

Read the source: https://github.com/max-vie/synapse. The repository is public under the MIT License.
