Skip to main content
Glama

ask_memory

Retrieve relevant passages from your personal knowledge base and generate answers using a local LLM, keeping your data private.

Instructions

Search the knowledge base and generate an answer using a local LLM.

    Retrieves the top-k most relevant passages via hybrid search, builds a
    RAG prompt, and calls the local Ollama LLM to generate an answer.

    When Ollama is unavailable the ``answer`` field is ``null`` and a
    ``hint`` field explains how to install Ollama and pull a model.

    Args:
        question: The question to answer.
        top_k: How many passages to retrieve (clamped to 1-20).
        model: Optional model override.

    Returns:
        Dict with keys ``answer``, ``sources``, ``model``, ``ollama_available``.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYes
top_kNo
modelNo
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses key behaviors: top_k clamping (1-20), hybrid search, RAG prompt building, and the null answer with hint when Ollama is unavailable. However, it doesn't cover edge cases like no relevant passages found or other error conditions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise yet thorough, with clear sections for parameters and return values. Every sentence adds value, and the structure (bullet points, code block) enhances readability without wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description explains return keys well. It covers input, behavior, and a key failure mode (Ollama unavailable). However, it could address more error scenarios or mention performance considerations like rate limits.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description adds significant meaning: question is the query, top_k is clamped 1-20 with default 5, model is an optional override. This fully compensates for the schema's lack of descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it searches the knowledge base and generates an answer using a local LLM, distinguishing it from sibling tools like search_memory that likely only retrieve passages. The verb+resource combination 'search and generate an answer' is specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides context on when Ollama is unavailable and explains the fallback behavior. While it doesn't explicitly state when to use versus siblings, the name and description imply it's for question-answering. It lacks explicit exclusions or alternative tool references.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kilhubprojects/memory-mesh'

If you have feedback or need assistance with the MCP directory API, please join our Discord server