OpenSpaces: The Collaborative AI Workspace That Isn't Actually Collaborative
Hook
OpenSpaces claims to be a collaborative workspace with real-time editing across 53 AI models. There's just one problem: the codebase contains zero WebSocket connections, no operational transforms, and authentication that exists in name only.
Context
The explosion of frontier AI models has created a new problem for developers and researchers: model comparison paralysis. GPT-4 excels at reasoning, Claude at long-context tasks, uncensored models at red-teaming scenarios—but constantly switching between ChatGPT, Claude.ai, and various local UIs breaks your workflow and scatters your document history across platforms.
OpenSpaces positions itself as the solution: a self-hosted Notion-like workspace where you can write rich documents, invoke 53 different AI models inline via slash commands, and collaborate with your team in real-time. It's built on FastAPI and Next.js with TipTap for rich text editing, and routes all AI requests through MuAPI, a unified gateway that normalizes model APIs into a single streaming interface. The promise is compelling—one workspace to replace your scattered ChatGPT tabs, Notion pages, and Google Docs. But the implementation reveals something more modest: a well-executed single-user AI writing assistant wrapped in collaborative buzzwords that don't match what's under the hood.
Technical Insight
The most interesting architectural choice in OpenSpaces is its hybrid persistence strategy. The backend implements an in-memory store as the primary data layer, with automatic PostgreSQL fallback through Supabase. This lets developers clone the repo and start immediately without database configuration—the app works entirely in-memory during local development. When you configure Supabase credentials, writes start flowing to both layers:
# backend/storage.py (simplified)
class HybridStorage:
def __init__(self):
self.memory_store = {}
self.supabase = self._init_supabase() if SUPABASE_URL else None
def save_space(self, space_data):
# Always write to memory first
self.memory_store[space_data['id']] = space_data
# Try PostgreSQL if configured
if self.supabase:
try:
self.supabase.table('spaces').upsert(space_data).execute()
except Exception as e:
# Silent failure - memory write succeeded
logger.error(f"PostgreSQL sync failed: {e}")
return space_data
This is elegant for developer ergonomics but creates consistency risks. Memory writes succeed even when PostgreSQL fails, with no reconciliation strategy. Running multiple backend instances means each has its own in-memory state, with no cache invalidation when another instance writes to the database. For single-user local development this works fine, but the architecture can't scale to actual multi-user deployments without rethinking the storage layer entirely.
The real technical achievement is the TipTap slash-command integration. OpenSpaces extends TipTap with custom nodes that capture document context around the cursor, send it to your chosen AI model, and stream the response inline. The implementation in the frontend shows how they handle the streaming:
// frontend/components/Editor.js (conceptual)
const AICompletionNode = Node.create({
name: 'aiCompletion',
addCommands() {
return {
insertAICompletion: (model, prompt) => ({ chain, state }) => {
const contextBefore = getTextBefore(state, 500) // 500 chars
const contextAfter = getTextAfter(state, 500)
return chain()
.insertContent({ type: 'aiCompletion', attrs: { loading: true } })
.run(() => {
streamCompletion({
model,
prompt,
context_before: contextBefore,
context_after: contextAfter
}, (chunk) => {
// Update node content as chunks arrive
updateNodeContent(chunk)
})
})
}
}
}
})
This creates a genuinely useful writing experience—you type /gpt4 or /claude, enter your prompt, and the model sees your surrounding document context to generate coherent inline content. The problem? That context extraction sends 1,000 characters of surrounding text without sanitization. Switch models mid-document and you're potentially leaking sensitive content across different model providers with varying data retention policies.
The MuAPI integration normalizes 53 models into a single streaming endpoint. All models are accessed via /api/v1/{model}/stream, which papers over real capability differences. Vision models, extended context windows, and prompt formatting nuances get homogenized:
# backend/routers/ai.py
@router.post("/api/v1/{model}/stream")
async def stream_completion(model: str, request: CompletionRequest):
# All models get same treatment
formatted = format_messages(
system_prompt=request.chat_history[-10:], # Last 10 messages
prompt=request.prompt
)
async for chunk in muapi_client.stream(model, formatted):
yield f"data: {chunk}\n\n"
The 10-message chat history limit is a blunt context management strategy. Long conversations get truncated without semantic compression or summarization. For exploratory research sessions, you lose continuity after a few back-and-forths. The architecture also formats chat history into system_prompt while keeping the user's prompt clean, assuming all models handle long system prompts equivalently—an assumption that breaks with models that have asymmetric context window handling.
File uploads reveal another architectural choice: everything proxies through the backend instead of direct client uploads. When you attach an image, it goes to FastAPI, which forwards it to MuAPI's CDN:
@router.post("/api/upload")
async def upload_file(file: UploadFile):
# No size validation, no format checks
content = await file.read()
# Proxy to MuAPI CDN
response = await muapi_client.upload(content, file.filename)
return {"url": response.cdn_url}
This prevents API key leakage—clients never talk directly to MuAPI—but adds latency and creates a throughput bottleneck. There's no size validation, format checking, or rate limiting. A single user could exhaust MuAPI quota or generate unbounded bandwidth charges. For a self-hosted tool where you control both the backend and the API keys, the security benefit doesn't justify the performance cost.
Gotcha
The biggest gotcha is that real-time collaboration doesn't exist. Despite marketing itself as a collaborative workspace, there are no WebSockets, no operational transforms, no CRDTs, and no conflict resolution. Concurrent edits will clobber each other. Two users typing in the same document means last-write-wins, with no merge strategy. The frontend does optimistic updates that make it feel responsive when you're alone, but the moment a second person joins, you're playing data-loss roulette.
Authentication is equally problematic. There's an auth.py module, but the routers don't enforce it. Space membership checks happen client-side only, and there's no row-level security configured in Supabase. Anyone with your API URL can access all spaces, read all documents, and modify all content. The codebase has the scaffolding for proper auth—token validation functions exist—but they're never called in the request handlers. For personal use this might be acceptable if you firewall the backend, but the Supabase integration suggests production ambitions that the security posture can't support. This isn't a tool you can safely expose to the internet or share with a team without major authentication refactoring.
Verdict
Use if: You're a solo AI researcher or security analyst who needs a local workspace for cycling through multiple models during prompt engineering, red-teaming, or capability exploration. The slash-command interface genuinely improves the writing experience compared to switching between browser tabs, and self-hosting keeps your prompts and model outputs on infrastructure you control. The MuAPI integration gives you access to uncensored and abliterated models that commercial platforms won't serve, making this valuable for legitimate safety research. Skip if: You actually need team collaboration, care about data security, or plan to use this for anything beyond personal experimentation. The missing conflict resolution means it can't function as a shared workspace, and the unauthenticated API makes it unsuitable for any deployment where multiple people have network access. The in-memory storage fallback is cute for local dev but creates consistency nightmares in production. If you want real collaborative document editing with AI capabilities, you're better off with Notion's API plus LangChain, or Obsidian with the Text Generator plugin for local-first workflows. OpenSpaces is a well-executed prototype of an AI writing assistant, not the collaborative workspace it claims to be.