mcp-rag-local
Uses Ollama to generate text embeddings for semantic search and retrieval of stored passages.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-rag-local What is Singapore?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Memory Server (mcp-rag-local)
This MCP server provides a simple API for storing and retrieving text passages based on their semantic meaning, not just keywords. It uses Ollama for generating text embeddings and ChromaDB for vector storage and similarity search. You can "memorize" any text and later retrieve the most relevant stored texts for a given query.
Example Usage
Memorize a Text
You can simply ask the LLM to memorize a text for you in natural language:
User: Memorize this text: "Singapore is an island country in Southeast Asia."
LLM: Text memorized successfully.
Memorize Multiple Texts
You can also ask the LLM to memorize several texts at once:
User: Memorize these texts:
Singapore is an island country in Southeast Asia.
It is about one degree of latitude north of the equator.
It is a major financial and shipping hub.
LLM: All texts memorized successfully.
This will store all provided texts for later semantic retrieval.
Memorize a PDF File
You can also ask the LLM to memorize the contents of a PDF file via memorize_pdf_file. The MCP tool will read up to 20 pages at a time from the PDF, return the extracted text, and have the LLM chunk it into meaningful segments. The LLM then uses the memorize_multiple_texts tool to store these chunks.
This process is repeated: the MCP tool continues to read the next 20 pages, the LLM chunks and memorizes them, and so on, until the entire PDF is processed and memorized.
User:
Memorize this PDF file: C:\path\to\document.pdf
LLM: Reads the first 20 pages, chunks the text, stores the chunks, and continues with the next 20 pages until the whole document is memorized.
You can also specify a starting page if you want to begin from a specific page:
MCP to LLM:
Memorize this PDF file starting from page 40: C:\path\to\document.pdf
LLM: Reads pages 40–59, chunks and stores the text, then continues with the next set of pages until the end of the document.
Example: Conversational Chunking and Memorizing Large Text
If you have a long text, you can ask the LLM to help you split it into short, meaningful chunks and store them. For example:
User: Please chunk the following long text and memorize all the chunks.
{large body of text}
LLM:
Splits the text into short, relevant segments and calls memorize_multiple_texts to store them. If the text is too long to store in one go, the LLM will continue chunking and storing until the entire text is memorized.
User: Are all the text chunks stored?
LLM: Checks and, if not all are stored, continues until the process is complete.
This conversational approach ensures that even very large texts are fully chunked and memorized, with the LLM handling the process interactively.
Retrieve Similar Texts
To recall information, just ask the LLM a question:
User: What is Singapore?
LLM: Returns the most relevant stored texts along with a human-readable description of their relevance.
Setup Instructions
Related MCP server: Qdrant MCP Server
0. Clone this repository
First, clone this git repository and change into the cloned directory:
git clone <repository-url>
cd mcp-rag-local1. Install uv
Install uv (a fast Python package manager):
curl -LsSf https://astral.sh/uv/install.sh | sh1a. Windows Installation
If you are on Windows, install uv using PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"2. Start the services
Run the following command to start ChromaDB and Ollama using Docker Compose:
docker-compose up3. Pull the embedding model
After the containers are running, pull the embedding model for Ollama:
docker exec -it ollama ollama pull all-minilm:l6-v24. MCP Server Config
Add the following to your MCP server configuration:
"mcp-rag-local": {
"command": "uv",
"args": [
"--directory",
"path\\to\\mcp-rag-local",
"run",
"main.py"
],
"env": {
"CHROMADB_PORT": "8321",
"OLLAMA_PORT": "11434"
}
}5. Viewing and Managing Memory (ChromaDB Admin GUI)
A web-based GUI for ChromaDB(Memory Server's db) is included for easy inspection and management of stored memory.
The admin UI is available at: http://localhost:8322
You can use this interface to browse, search, and manage the vector database contents.
Available Tools
5 toolsgreet_userC
Greet the user with their name and the server's name.
Returns:
str: A greeting message.
Inputs: no named parameters.
memorize_multiple_textsB
Memorize multiple texts for later retrieval based on relevance in meaning, not just keywords.
Args:
texts (list): A list of texts to memorize.
Returns:
str: A message indicating success or failure of the operation.
Inputs: texts (required), metadata.
memorize_pdf_fileA
Chunk the contents of a PDF file into meaningful segments and store them in memory for later retrieval based on relevance in meaning, not just keywords.
Args:
ctx (Context): The context of the request.
file_path (str): The path to the PDF file.
page (int, optional): The starting page number to read from the PDF file. Defaults to 0.
metadata (dict, optional): Metadata to associate with the memorized content.
Returns:
str: A message indicating success or failure of the operation.
Inputs: file_path (required), page, metadata.
memorize_textC
Memorize a text for later retrieval based on relevance in meaning, not just keywords.
Args:
text (str): The text to memorize.
Returns:
str: A message indicating success or failure of the operation.
Inputs: text (required), metadata.
remember_similar_textsA
Query memory for texts similar in meaning to the query text.
Args:
query_text (str): The text to find similar meanings for.
n_results (int): The number of results to return. This is recommended to be more than 10.
Returns:
str: A human-readable string with the results and their relevance.
Inputs: query_text (required), n_results.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: greeting, memorizing text, memorizing multiple texts, memorizing PDF files, and retrieving similar texts. No ambiguity between tools.
All tool names follow a consistent snake_case pattern with verb_noun or verb_adjective_noun structure (e.g., greet_user, memorize_text, remember_similar_texts).
5 tools is appropriately scoped for a simple RAG local server, covering core operations without being overwhelming. Slightly on the low side but reasonable.
The tool set provides storage and retrieval but lacks update, delete, or listing operations, which are common in memory systems. This could limit agent capabilities.
Maintenance
Related MCP Connectors
Universal persistent memory and knowledge retrieval layer for AI agents and LLMs.
Memory system for AI agents with semantic search. Store and recall memories with ease.
Persistent memory for AI agents. Search, store, and recall across sessions.
Persistent personal memory for AI assistants: search what you told it before and save new facts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to store and retrieve memories with semantic search capabilities using vector embeddings. Provides persistent memory storage with SQLite backend for context retention across conversations.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables storing and retrieving information using semantic search with Qdrant vector database. Acts as a memory layer for LLMs to persistently store and semantically search through information and metadata.Apache 2.0
- AlicenseAqualityDmaintenanceProvides AI assistants with long-term semantic memory capabilities through local vector-based storage. Enables storing, recalling, and managing information across sessions with complete privacy using ChromaDB, with no data ever leaving your machine.39MIT
- AlicenseNot gradedqualityDmaintenanceEnables persistent memory management using ChromaDB vector store, with Docker support for easy deployment.5MIT