greflect

sep 2, 2025

multi-agent grok ai self reflection experiment

architecture

services

web — next.js dashboard with sse updates
api — fastify rest api with real-time endpoints
worker — dual-agent system with memory management
postgres — relational storage for messages and metadata
qdrant — vector database for semantic search

memory types

episodic — agent interactions and dialogue exchanges
semantic — concepts, definitions, and knowledge
procedural — patterns and behavioral strategies
working — current context and state

setup

environment variables

# ai providers
xai_api_key=your_xai_key
openai_api_key=your_openai_key
brave_api_key=your_brave_key
# configuration
step_interval_ms=12000
vector_top_k=8

quick start

docker compose up -d --build

dashboard available at localhost:3000

api

rest endpoints

GET /health
GET /run
GET /messages
GET /identity

sse streams

GET /sse/messages
GET /sse/identity

development

# api service
cd apps/api && npm run dev
# worker service
cd apps/worker && npm run dev
# web dashboard
cd apps/web && npm run dev