How Do My Agents Get Memory Independent of the LLM? Wie bekommen meine Agenten unabhängig vom LLM ein Gedächtnis?

Adil El Madbouh 7. März 2026 12 Min. Lesezeit
KI-Agenten Gedächtnis mit PostgreSQL Vector-Datenbank und MCP Server

Das ist keine Zukunftsvision.This is not a future vision. Es gibt dafür heute kein fertiges Produkt, das Sie aus der Schachtel nehmen und installieren können. Aber Sie können es selbst bauen – und zwar mit Technologien, die bereits existieren und produktionsreif sind. There is no ready-made product that you can take out of the box and install today. But you can build it yourself – using technologies that already exist and are production-ready.

Wenn Sie mit KI-Agenten arbeiten, kennen Sie das Problem: Jede Konversation startet bei Null. Der Agent weiß nichts über vergangene Gespräche, über Ihre Präferenzen oder über den Kontext früherer Projekte. Das Context-Fenster des LLM ist begrenzt – und mit dem Ende der Session ist alles vergessen. If you work with AI agents, you know the problem: every conversation starts from scratch. The agent knows nothing about past conversations, your preferences, or the context of previous projects. The LLM's context window is limited – and when the session ends, everything is forgotten.

Die Lösung? Ein persistentes, LLM-unabhängiges Gedächtnis. The solution? A persistent, LLM-independent memory.

Was Sie dafür brauchenWhat You Need

Die Architektur besteht aus drei Komponenten, die Sie zusammenstecken: The architecture consists of three components that you connect together:

Die ArchitekturThe Architecture

🤖 Agent
🔌 MCP Server
🐘 PostgreSQL + pgvector

1. Eine PostgreSQL Vector-DatenbankA PostgreSQL Vector Database

PostgreSQL kennen die meisten als klassische relationale Datenbank. Aber mit der Extension pgvector wird daraus eine vollwertige Vektordatenbank. Das bedeutet: Sie können nicht nur Text speichern, sondern auch semantische Embeddings – also mathematische Repräsentationen von Bedeutung. Most people know PostgreSQL as a classic relational database. But with the pgvector extension, it becomes a full-fledged vector database. This means you can store not just text, but also semantic embeddings – mathematical representations of meaning.

Warum PostgreSQL und nicht eine spezialisierte Vektordatenbank wie Pinecone oder Weaviate? Weil PostgreSQL: Why PostgreSQL and not a specialized vector database like Pinecone or Weaviate? Because PostgreSQL:

-- pgvector Extension aktivieren
CREATE EXTENSION IF NOT EXISTS vector;

-- Gedächtnis-Tabelle erstellen
CREATE TABLE agent_memory (
    id SERIAL PRIMARY KEY,
    session_id TEXT,
    content TEXT NOT NULL,
    embedding vector(1536),
    metadata JSONB,
    created_at TIMESTAMPTZ DEFAULT NOW()
);

-- Index für schnelle Ähnlichkeitssuche
CREATE INDEX ON agent_memory
USING ivfflat (embedding vector_cosine_ops)
WITH (lists = 100);

2. Einen PostgreSQL MCP ServerA PostgreSQL MCP Server

MCP (Model Context Protocol) ist das Bindeglied zwischen Ihrem Agenten und der Datenbank. Es ist ein offener Standard, der es KI-Agenten ermöglicht, sicher mit externen Datenquellen zu kommunizieren – ohne dass Sie eine eigene API bauen müssen. MCP (Model Context Protocol) is the link between your agent and the database. It's an open standard that enables AI agents to securely communicate with external data sources – without having to build a custom API.

Der PostgreSQL MCP Server macht Ihre Vektordatenbank für den Agenten zugänglich. Der Agent kann: The PostgreSQL MCP Server makes your vector database accessible to the agent. The agent can:

💡 Warum MCP?Why MCP?

MCP standardisiert die Kommunikation zwischen Agenten und Tools. Statt für jeden Agenten eine eigene Integration zu bauen, definieren Sie einmal einen MCP Server – und jede kompatible Agentenplattform kann ihn nutzen. Das ist wie USB für KI-Agenten. MCP standardizes communication between agents and tools. Instead of building a custom integration for each agent, you define an MCP server once – and any compatible agent platform can use it. It's like USB for AI agents.

3. Eine AgentenplattformAn Agent Platform

Sie brauchen eine Plattform, die MCP unterstützt und Ihnen erlaubt, Agenten zu konfigurieren, die auf das Gedächtnis zugreifen. Hier gibt es heute bereits mehrere Optionen: You need a platform that supports MCP and allows you to configure agents that access the memory. Several options already exist today:

🚀
Antigravity
Agentic Coding Plattform mit nativem MCP-SupportAgentic coding platform with native MCP support
🤖
Claude Code
Anthropics CLI-Agent mit MCP-IntegrationAnthropic's CLI agent with MCP integration
🐙
GitHub Copilot
Copilot Agents mit wachsendem MCP-SupportCopilot Agents with growing MCP support
🦊
OpenClaw
Open-Source KI-Assistent mit Plugin-SystemOpen-source AI assistant with plugin system
🔗
LangChain
Framework für KI-Agenten mit Memory-ModulenFramework for AI agents with memory modules
CrewAI
Multi-Agenten-Framework mit Shared MemoryMulti-agent framework with shared memory
🧠
AutoGen
Microsofts Multi-Agenten-PlattformMicrosoft's multi-agent platform
🌊
Windsurf
KI-gestützte Coding-Umgebung mit MCPAI-powered coding environment with MCP

Wie es funktioniert: Der AblaufHow It Works: The Flow

Stellen Sie sich vor, Ihr Agent hat ein Gespräch mit Ihnen geführt und dabei gelernt, dass Sie bevorzugt TypeScript verwenden und Ihre API-Architektur auf REST basiert. Beim nächsten Mal: Imagine your agent had a conversation with you and learned that you prefer TypeScript and your API architecture is REST-based. Next time:

  1. Konversation startetConversation startsDer Agent fragt über MCP das Gedächtnis ab: „Was weiß ich über diesen Nutzer?" The agent queries memory via MCP: "What do I know about this user?"
  2. Semantische SucheSemantic searchpgvector findet die relevantesten Erinnerungen basierend auf der Ähnlichkeit der Embeddings pgvector finds the most relevant memories based on embedding similarity
  3. Kontext-AnreicherungContext enrichmentDie relevanten Erinnerungen werden in den System-Prompt eingebettet Relevant memories are embedded into the system prompt
  4. Neue Erinnerungen speichernStore new memoriesAm Ende der Session werden wichtige neue Informationen zurück ins Gedächtnis geschrieben At the end of the session, important new information is written back to memory

Warum das ein Game-Changer istWhy This Is a Game-Changer

Mit einem LLM-unabhängigen Gedächtnis: With an LLM-independent memory:

⚠️ Ehrliche EinschätzungHonest Assessment

Es gibt kein fertiges Produkt, das all dies out-of-the-box liefert. Die Technologie ist da, aber die Integration erfordert technisches Know-how. Sie müssen die Komponenten selbst zusammenbauen und konfigurieren. Genau deshalb ist es ein Wettbewerbsvorteil – wer es heute aufbaut, hat einen Vorsprung. There is no ready-made product that delivers all of this out of the box. The technology is there, but integration requires technical expertise. You need to assemble and configure the components yourself. That's precisely why it's a competitive advantage – those who build it today have a head start.

Fazit: Heute bauen, morgen profitierenConclusion: Build Today, Benefit Tomorrow

Die Bausteine für ein LLM-unabhängiges Agenten-Gedächtnis existieren. PostgreSQL mit pgvector als Speicher, MCP als Kommunikationsprotokoll und eine wachsende Anzahl an Agentenplattformen, die dieses Protokoll unterstützen. The building blocks for an LLM-independent agent memory exist. PostgreSQL with pgvector as storage, MCP as the communication protocol, and a growing number of agent platforms that support this protocol.

Es ist kein Science-Fiction. Es erfordert Arbeit, technisches Verständnis und strategische Planung. Aber wer es umsetzt, gibt seinen KI-Agenten etwas, das die meisten heute noch nicht haben: ein echtes, dauerhaftes Gedächtnis. It's not science fiction. It requires work, technical understanding, and strategic planning. But those who implement it give their AI agents something most still don't have: a real, persistent memory.

Want to build AI agent memory for your team?Möchten Sie ein Agenten-Gedächtnis für Ihr Team aufbauen?

Let's discuss your requirements in a free 30-minute expert consultation.Lassen Sie uns Ihre Anforderungen in einem kostenlosen 30-minütigen Expertengespräch besprechen.

Book Expert CallExpertengespräch buchen