Skip to main content
Glama
QuixiAI

AGI MCP Server

by QuixiAI

create_working_memory

Create temporary working memory with expiration for AI systems to maintain conversation continuity through episodic and semantic storage.

Instructions

Create a temporary working memory with expiration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesContent of the working memory
embeddingYesVector embedding for the content
contextNo

Implementation Reference

  • Core implementation of createWorkingMemory: inserts a new working memory record into the database with computed expiration time based on TTL.
    async createWorkingMemory(content, embedding, context = {}) {
      try {
        const ttl = context.ttl || 3600; // Default 1 hour
        const expirationTime = new Date(Date.now() + ttl * 1000);
    
        const [workingMemory] = await this.db
          .insert(schema.workingMemory)
          .values({
            content,
            embedding: embedding,
            expiry: expirationTime
          })
          .returning();
    
        return workingMemory;
      } catch (error) {
        console.error('Error creating working memory:', error);
        throw error;
      }
  • mcp.js:656-662 (handler)
    MCP CallToolRequestSchema handler for 'create_working_memory': extracts arguments and delegates to memoryManager.createWorkingMemory, returns JSON response.
    case "create_working_memory":
      const workingMemory = await memoryManager.createWorkingMemory(
        args.content,
        args.embedding,
        args.context || {}
      );
      return { content: [{ type: "text", text: JSON.stringify(workingMemory, null, 2) }] };
  • Input schema and tool metadata definition returned by ListToolsRequestSchema handler.
    name: "create_working_memory",
    description: "Create a temporary working memory with expiration",
    inputSchema: {
      type: "object",
      properties: {
        content: {
          type: "string",
          description: "Content of the working memory"
        },
        embedding: {
          type: "array",
          items: { type: "number" },
          description: "Vector embedding for the content"
        },
        context: {
          type: "object",
          properties: {
            ttl: {
              type: "integer",
              description: "Time to live in seconds",
              default: 3600
            }
          },
          default: {}
        }
      },
      required: ["content", "embedding"]
    }
  • Tool schema definition exported from memory-tools.js (matches mcp.js version, possibly source template).
    name: "create_working_memory",
    description: "Create a temporary working memory with expiration",
    inputSchema: {
      type: "object",
      properties: {
        content: {
          type: "string",
          description: "Content of the working memory"
        },
        embedding: {
          type: "array",
          items: { type: "number" },
          description: "Vector embedding for the content"
        },
        context: {
          type: "object",
          properties: {
            ttl: {
              type: "integer",
              description: "Time to live in seconds",
              default: 3600
            }
          },
          default: {}
        }
      },
      required: ["content", "embedding"]
    }
Behavior2/5

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

With no annotations provided, the description carries full burden. It discloses the temporary/expiring nature (useful behavioral context), but doesn't mention permissions needed, rate limits, whether it's idempotent, what happens on failure, or the response format. For a creation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 a single, efficient sentence that front-loads the core purpose. Every word earns its place—'temporary' and 'with expiration' add important qualifiers without redundancy. No wasted words or unnecessary elaboration.

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

Completeness2/5

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

For a creation tool with 3 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what a 'working memory' is in this system, how it differs from regular memories, what happens after creation, or error conditions. The agent would need to guess about many aspects of tool behavior.

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

Parameters3/5

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

Schema description coverage is 67% (2 of 3 parameters have descriptions). The description doesn't add any parameter-specific information beyond what's in the schema. It mentions 'expiration' which relates to the 'ttl' parameter, but doesn't explain the relationship between content and embedding, or provide context for the nested 'context' object. Baseline 3 is appropriate given moderate schema coverage.

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

Purpose4/5

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

The description clearly states the action ('Create') and resource ('temporary working memory'), specifying it has expiration. It distinguishes from siblings like 'create_memory' by emphasizing the temporary nature, but doesn't explicitly contrast with other creation tools like 'create_memory_cluster' or 'create_memory_relationship'.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'create_memory' (which might be permanent) or 'create_memory_cluster'. It mentions expiration but doesn't specify scenarios where temporary vs. permanent storage is appropriate, nor prerequisites for use.

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/QuixiAI/agi-mcp-server'

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