DEV Community

diwushennian4955
diwushennian4955

Posted on • Originally published at nexa-api.com

DBay MCP + NexaAPI: Build AI Agents with Persistent Memory and Multimodal Generation (2026)

DBay MCP + NexaAPI: Build AI Agents with Persistent Memory and Multimodal Generation (2026)

DBay MCP just launched on PyPI — a Model Context Protocol (MCP) server that gives your AI agents persistent memory and knowledge base capabilities. Your agents can now remember context across sessions.

But memory is only half the equation. What do your agents actually do with that memory? If they're generating images, videos, or audio — they need NexaAPI: 56+ models at $0.003/image.

What is DBay MCP?

dbay-mcp is a Model Context Protocol server that provides:

  • Persistent agent memory — store and retrieve context across sessions
  • Knowledge base management — structured storage for agent knowledge
  • MCP protocol support — works with Claude, GPT-4, and other AI tools

Source: pypi.org/project/dbay-mcp | Retrieved: 2026-03-27

The Stack: DBay MCP + NexaAPI

DBay MCP (memory/knowledge) + NexaAPI (multimodal generation)
= AI agents that remember AND create
Enter fullscreen mode Exit fullscreen mode

Installation

pip install dbay-mcp nexaapi
Enter fullscreen mode Exit fullscreen mode

Python Example — AI Agent with Memory + Multimodal Generation

# pip install dbay-mcp nexaapi
from nexaapi import NexaAPI

client = NexaAPI(api_key='YOUR_NEXAAPI_KEY')  # Get at https://nexa-api.com

class MultimodalAgent:
    """AI agent with persistent memory (DBay MCP) and generation (NexaAPI)."""

    def __init__(self, api_key: str):
        self.client = NexaAPI(api_key=api_key)
        self.memory = {}  # In production: use DBay MCP for persistence

    def remember(self, key: str, value: str):
        """Store context in agent memory (DBay MCP)."""
        self.memory[key] = value
        print(f"Remembered: {key} = {value}")

    def recall(self, key: str) -> str:
        """Retrieve context from agent memory."""
        return self.memory.get(key, "No memory found")

    def generate_image(self, prompt: str) -> str:
        """Generate an image using NexaAPI."""
        result = self.client.image.generate(
            model='flux-schnell',
            prompt=prompt,
            width=1024,
            height=1024
        )
        # Store the generated URL in memory
        self.remember(f"image:{prompt[:30]}", result.url)
        return result.url

    def generate_video(self, prompt: str) -> str:
        """Generate a video using NexaAPI."""
        result = self.client.video.generate(
            model='kling-v1',
            prompt=prompt
        )
        self.remember(f"video:{prompt[:30]}", result.url)
        return result.url

# Example: Agent that remembers brand guidelines and generates consistent assets
agent = MultimodalAgent(api_key='YOUR_NEXAAPI_KEY')

# Store brand context in memory (DBay MCP in production)
agent.remember('brand_style', 'minimalist, dark mode, neon accents')
agent.remember('product_name', 'NexaFlow AI')

# Generate assets using stored context
style = agent.recall('brand_style')
product = agent.recall('product_name')

image_url = agent.generate_image(
    f"Product hero image for {product}: {style}, professional studio lighting"
)
video_url = agent.generate_video(
    f"Product demo video for {product}: {style}, cinematic"
)

print(f"Hero image: {image_url}")
print(f"Demo video: {video_url}")
print(f"Total cost: $0.003 + video")
Enter fullscreen mode Exit fullscreen mode

JavaScript Example

// npm install nexaapi
import NexaAPI from 'nexaapi';

const client = new NexaAPI({ apiKey: 'YOUR_NEXAAPI_KEY' });

// Agent memory (integrate with DBay MCP in production)
const agentMemory = new Map();

async function generateWithMemory(context, prompt) {
  // Retrieve stored context
  const brandStyle = agentMemory.get('brand_style') || 'professional';
  const fullPrompt = `${prompt}, style: ${brandStyle}`;

  // Generate with NexaAPI
  const result = await client.image.generate({
    model: 'flux-schnell',
    prompt: fullPrompt,
    width: 1024,
    height: 1024
  });

  // Store result in memory
  agentMemory.set(`generated:${context}`, result.url);
  return result.url;
}

// Store brand context
agentMemory.set('brand_style', 'minimalist, dark mode, neon accents');

// Generate consistent assets
const heroImage = await generateWithMemory('hero', 'product hero banner for AI tool');
console.log('Hero image URL:', heroImage);
console.log('Cost: $0.003');
Enter fullscreen mode Exit fullscreen mode

Pricing: NexaAPI vs Alternatives

Provider Image Video 100 images
NexaAPI $0.003 ~$0.50/min $0.30
Replicate ~$0.04 ~$2/min ~$4.00
FAL.ai ~$0.03 ~$1.50/min ~$3.00
DALL-E 3 $0.04-0.12 N/A ~$8.00

Get Started

Originally published at nexa-api.com | Source: PyPI 2026-03-27

Top comments (0)