
How Slogs LLM Wiki retrieves memories
Public postsEnglish
How Slogs LLM Wiki retrieves memories using EmbeddingGemma, pgvector, graph signals, and retrieval diagnostics.

In LLM Wiki, searching is not just “finding documents containing keywords”. The Agent needs to find memories that can be used for the next action. Therefore, the search in Slogs and LLM Wiki considers three signals together.
- What does the user's question mean?
- How close is the meaning vector of the stored memory?
- The categories, tags, and related item connections between memories form a certain graph
In this article, the search flow of Slogs and LLM Wiki is organized from the perspective of GraphRAG.
1. Convert the question into an embedding.
The first step in search is to convert questions into embedding vectors. In Slogs, the policy sets the use of the server-local EmbeddingGemma model. This is done so that instead of sending data to an external hosted API every time, an embeddable embedding can be generated within the server itself.
This option has advantages.
- The API key does not get included in the search path.
- It is easier to repeatedly measure the search quality in a local environment.
- The cause of the failure does not spread due to network/API/charging issues.
Of course, using a local model increases deployment size and initial loading time. Therefore, Slogs accepts model calls as the primary path and avoids silently bypassing through other searches in case of failure. To ensure search quality, failures must be exposed.
2. Select a close candidate using pgvector
When the embedding is created, a candidate for a close match is found through pgvector in PostgreSQL. pgvector is an extension that allows similarity search on vector types within PostgreSQL.
This stage is similar to seed retrieval. Instead of choosing a single “correct answer” from the start, a group of candidates with similar meanings is formed.
If too many candidates are provided, the context sent to the Agent increases; if too few are provided, important memories are lost. Therefore, Slogs and MCP tools set a low default limit and only perform a narrow query/categoryPath/minRelevancePercent lookup when necessary.
3. Re-examining candidates using graph signals
The core idea of GraphRAG is to use the relationships between knowledge instead of merely treating document fragments as vectors. Slogs LLM Wiki also follow this approach.
For example, if one memory belongs to the slogs/llm-wiki/graphrag category and another memory belongs to slogs/deployment/wasm-aot, both are memories of the Slogs project, but their application contexts are different. Even if the words are the same, if the categoryPath is different, the Agent must interpret them differently.
So, categoryPath is not just a simple classification label. It is a structural information that narrows the search scope and determines the range of memory application.
A good categoryPath usually looks like this.
project/domain/topic
project/feature/decision
preference/domain/project
codex/mcp/slogs
Conversely, paths like general, misc, and notes make later searching difficult. If the topic is known, it should be stored specifically.
4. View search quality through Retrieval Diagnostics
The most dangerous situation in Agent search is mistaking “a search was conducted but essentially failed” for a success. Even when there are zero results, the top results are irrelevant, or the search covers an overly broad range that yields only useless context, yet the Agent still provides plausible answers—this makes the memory system even more risky.
So, the responses for Slogs and LLM Wiki are labeled with Retrieval Diagnostics.
- result count
- effectiveLimit
- categoryPath
- minRelevancePercent
- elapsedMs
The agent needs to check this value to determine if the query was sufficient. If the results are poor, it should change the query, narrow down the categoryPath, or adjust the limit before performing another query. If the search is slow or the results are too large, that itself is also a signal.
5. Search and recall are written differently.
Slogs MCP has llm_wiki_search and llm_wiki_recall with different roles intentionally.
search is a candidate screening tool. It only provides the title, summary, tags, and categoryPath, allowing you to choose “what to read”.
recall brings a compact context that can be applied to actual responses or implementations. Therefore, it returns more context, but it’s better to keep the default limit small.
If you need the entire original text or raw provenance, use read. This way, the Agent reads only as much as required, and the correct item can be opened at the moment where evidence is needed.
Conclusion from a operational perspective
Compared to a flashy name, operational rules are more important in GraphRAG. In Slogs and LLM Wiki, the four things that were truly important were as follows.
- Treat the local embedding model as the official search path.
- Use pgvector to reliably extract meaning candidates.
- Use the related items of categoryPath as graph signals.
- With Retrieval Diagnostics, the agent determines the search quality.
With this structure, the Agent does not stop at “retrieved memories”, but becomes closer to “retrieved usable memories”.
Reference link
- Microsoft GraphRAG: https://microsoft.github.io/graphrag/
- pgvector: https://github.com/pgvector/pgvector
- EmbeddingGemma: https://ai.google.dev/gemma/docs/embeddinggemma
- Ollama API: https://github.com/ollama/ollama/blob/main/docs/api.md



Comments: 0
Sign in to leave a comment.
No comments yet. Write the first one.