K KaryoSpace · Architecture

One query, start to finish.

You ask a question. The classifier checks memory, the retriever checks facts, and every answer carries a score for how much to trust it.

6 stages · 1 binary · 1 database, from your first query to a signed audit trail
CLIENT
REQUEST RESPONSE
GO BINARY
QUERY RESULT
MONGODB
1
Classify
2
Cache
3
Retrieve
4
Assemble
5
Route
6
Trace
21 parts, every number traced to the codebase
POST /submit → rag.ClassifyQuery()
rag_query_cache — similarity ≥ 0.92 → instant reuse
hybrid search → keywords + vectors, guarded per item
context ≤ 12,000 chars, every fact source-tagged
gpt-oss-120b (Groq) → gpt-oss-20b (backup after 12 s)
aio_traces { quality, latency, cost, sources }

The fragmentation tax

Before the reference material below, the reason it's shaped like this: most teams run their AI assistant bolted onto a dozen SaaS tools it can only half-see. The cost of that shows up long before anyone asks the assistant a question.

8
Average apps a knowledge worker juggles daily
2.5 hrs
Lost weekly to switching between them
23 min
To rebuild focus after each interruption
✕ Microservices across a dozen SaaS vendors
✓ Single Go binary
✕ Data fragmented across siloed databases
✓ One unified MongoDB instance
✕ AI is blind to what it isn't fed
✓ Whole-company context by default
✕ Vendor-hosted, vendor-owned
✓ Self-hosted, docker run away

Everything from here down is the reference for how that single binary actually works, starting with how someone gets into it in the first place.

Getting in, and signing in

There's no desktop client and no browser extension. The app is a website that also happens to be installable, so the same HTTPS origin serves the login page, the dashboard, and the install prompt. Once someone's there, two ways in: single sign-on for organizations that already have an identity provider, and a local account with multi-factor for everyone else. Both end at the same signed, server-side session.

Browser
Plain HTTPS, no login required
Install as PWA
/manifest.json + /sw.js
Sign In
SSO or local account
  1. Open it in a browser
    Works over plain HTTPS, no login required to see the marketing pages. Everything behind /home requires an authenticated session.
  2. Install it as a PWA
    The server dynamically serves /manifest.json and /sw.js, and the browser's own "Install app" prompt handles the rest. No app-store review, no separate binary to distribute or patch.
  3. Sign in
    Either single sign-on or a local account below, and either way the result is the same server-side session cookie.
SSO or Local + TOTP
Okta/Google/OIDC or bcrypt password + optional 2FA
One Session Model
Signed, encrypted, HTTP-only cookie
SSO (OIDC)
Works with Okta, Google, or any standard OpenID Connect provider. The redirect carries a server-side state token, not just a cookie, so it isn't fooled by mismatched or replayed callback URLs.
Local login + TOTP
Passwords are bcrypt-hashed. Accounts can require a time-based one-time code on top. The login form asks for it as a second step, and it isn't optional once an admin turns it on for that user.
Rate-limited by design
Login and OIDC callback endpoints are throttled per IP, so repeated failures earn a temporary block instead of unlimited guesses.
One session model
Whichever way someone signs in, the outcome is the same encrypted, signed, HTTP-only session cookie, and the rest of the app never needs to know which path was used.
sessions.NewCookieStore — key from SESSION_STORE_KEY env var cookie: HttpOnly true · SameSite Lax · Secure true in production

On sign-in, the session ID is deliberately regenerated rather than reused. That's a standard defence against session-fixation, where an attacker tries to pre-set a victim's session before they log in.

Who can see and do what

Authorization is layered rather than a single flag: a role, an organization boundary, access guards on every piece of content the assistant reads, and, for the handful of routes that matter most, a second independent check.

Role Check
user / manager / admin / super_user
Org Boundary
Resolved from email domains
IP Allowlist
Second check, admin routes only
RoleScopeWhere it comes from
userOwn org's data; own personal notesDefault for every account
managerSame as user, plus team-level viewsuser_roles collection
adminFull org administrationuser_roles collection, falls back to ADMIN_USERS env var
super_userCan query across organizations, not just their ownuser_roles collection (rare, manually granted)

Every account also belongs to exactly one organization, resolved from its email domain through an admin-managed list of each organization's domains (one organization can own several), and retrieval for regular users never crosses that boundary. Personal notes go a step further and are scoped to the individual, not just the org, since nobody else should ever be able to search them.

Inside the organization, the assistant adds a third layer, AIME Guards. Every email, message, ticket, document and knowledge atom carries a sensitivity tier (org_public, internal, project_only, finance_confidential, hr_confidential, restricted). The asker's clearance becomes a filter inside every database query, and each result is checked again before the model reads it. Content with no label, or a tier the check does not know, is refused rather than shared. A leak checker that tries every test user against every result has found 0 leaks across 61,209 results. More on the AIME page.

Admin-only routes check the session role first; the most sensitive ones add a second, independent IP-allowlist check, so a single compromised admin session isn't automatically enough on its own.

The home dashboard and what it's actually made of

The home screen isn't one big payload. It's several small, independently-loading endpoints, so a slow one (say, generating insights) never blocks the rest of the page from showing up.

EndpointWhat it renders
/home/summaryThe top-line daily overview
/home/activityRecent activity across connected modules
/home/insightsPer-channel AI summaries of what's happened in chat since it was last read
/home/insight-summaryA condensed version for the summary card
/home/email-summaryUnread and priority email at a glance
/home/feedThe combined activity feed
/home/assistantThe AI chat box itself

Every message typed into the assistant is classified into one of a small set of command types before anything else happens, which is what lets the same input box handle a question, a statement, and an action without the person having to pick a mode:

Message Typed
Classified before anything else happens
Outside Company Data
Company Question
Email Query
Action / Write
Statement
  1. Outside company data
    General-knowledge requests ("write me Python code") are politely declined without calling the answering model. Greetings and thanks still get a friendly reply.
  2. Company question
    Needs company context, so it triggers the retrieval pipeline described next.
  3. Email query
    Specifically about inbox contents, so it's scoped to the email collections.
  4. Action / write intent
    "Create a ticket for…" style commands that create real records (incidents, Jira issues) rather than just answering. Requests to reveal or change credentials are refused by rule before any model runs.
  5. Statement
    Not a question at all ("thanks", "got it"), so it's acknowledged without spending a retrieval or an LLM call.

What's actually behind AI Insights

"Insights" on the home screen isn't a vague analytics blurb. It's a concrete feature: for every chat channel with new activity, the model reads the unread messages and writes a 3–5 sentence summary of the key topics, decisions, and action items, so catching up on a busy channel doesn't mean scrolling through it.

Each summary is cached by channel and the timestamp of its last message. If nothing new has been said, the same summary is reused instead of re-summarizing on every page load. The cache is capped at 1,000 entries and clears itself once full, rather than growing without bound.

One input box, many modes

Typing / in the assistant's input box opens a filtered command menu. The same box that answers a question can also switch into composing an email, saving a note to the knowledge base, or opening a specific integration, without navigating away.

/ typed in input
Opens filtered command menu
/email
Compose
/knowledge
Save a note
/ticket
New incident
/gmail /outlook /calendar
Connected views
@mention
Tag a teammate
CommandSwitches the input to
/emailCompose mode, cursor jumps straight to the "To" field
/chatDirect-message compose to a teammate
/knowledgeSave a note to the knowledge base
/noteA personal note, scoped only to the person writing it
/ticketA new incident/ticket
/incidentSame as /ticket, opens the incident modal directly, handled both client-side and as a server-side fallback
/gmail, /outlook, /calendarThe connected Google, Outlook, or calendar view
/slack, /confluence, /jira, /servicenowThe relevant connected integration
@mentionNot a slash command, but the same trigger pattern, tags a teammate inline

The command list also seeds the rotating suggestion chips on the home screen, so first-time users discover what the box can do without reading documentation first.

What happens between your question and your answer

Every query anyone sends to the assistant is watched by its own observability engine, internally called AIO. It doesn't just answer, it traces the answer, so a bad response is something we get alerted to, not something a customer has to report. One query, six stages, walked through end to end below: retrieval and the language model never touch the query directly: everything passes through classification first, with the answer cache checked alongside the search.

1
Classify
Is this actually a workspace question?
POST /submit → rag.ClassifyQuery()

A fast model (with a regex fallback if it's unavailable) reads the message and decides: is this something that needs real company data, a general question, or just a "thanks"? Only the first kind triggers retrieval, so a passing remark doesn't burn a database query, and a general-knowledge request is declined there and then without calling the answering model.

2
Check Cache
Has this question basically been asked before?
rag_query_cache — similarity ≥ 0.92 → instant reuse

While retrieval starts, the question is also compared against recently-cached queries. Three outcomes, one router: it picks the cheapest honest path rather than always running the full pipeline. The cache is per person: a match is only ever made against the asker's own earlier answers, and it must name the same tickets and people, so an answer about INC-1 is never reused for INC-2. Answers older than 7 days are still served but refreshed in the background.

similarity ≥ 0.92
Instant cache reuse

Same question, same answer, served from rag_query_cache with no LLM call at all.

0.88 – 0.92
Informed fresh retrieval

Close enough to reuse context, not close enough to skip a real answer.

below 0.88
Full RAG pipeline

Genuinely new territory: classify, retrieve, assemble, and route from scratch.

3
Retrieve
Fan out to every source, one database, in parallel
keywords + vectors, RRF k=5 → email_messages, rag_email_chunks, msg_messages, knowledge_chunks, inc_incidents, user_notes, rag_integration_chunks, rag_refined_knowledge (parallel, each with a deadline)

The retriever searches email (whole messages and the passages inside long ones), internal chat, the knowledge base, incidents, personal notes, content synced in from connected tools, and the short knowledge atoms distilled from tickets and documents, all at the same time, each with its own deadline so one slow source cannot stall the answer. Most sources are searched twice, by exact words (MongoDB text indexes) and by meaning (768-number vectors stored on the same documents), and the two rankings are merged with Reciprocal Rank Fusion. Ties are broken by document ID, so the same question always gathers the same evidence. Every search carries the asker's access filter from AIME Guards; a cross-org super_user can widen the query beyond one organization, everyone else is hard-scoped to their own.

SourceCollectionScope
Emailemail_messages, rag_email_chunksMailboxes the asker can open, then by sensitivity
Chatmsg_messagesChannels the asker is a member of
Knowledge baseknowledge_chunksOrg, by sensitivity tier
Incidentsinc_incidentsBy sensitivity tier and project
Personal notesuser_notesUser-only, never shared across accounts
Synced integrationsrag_integration_chunksOrg content by tier, plus the asker's own connected mailboxes
Knowledge atomsrag_refined_knowledgeSame rules as the ticket or document each atom came from
Embeddings aren't a separate lookup. They're fields on the same MongoDB documents everything else already lives in. Retrieval runs cosine similarity in-process, fuses it with the keyword ranking, re-checks every item against the asker's access, then hands the result to the language model.
4
Assemble
Stitch it into one attributed context
context ≤ 12,000 chars, every fact source-tagged

Results are trimmed to fit and stitched into a single context block, with every fact tagged to where it came from: an email thread, a ticket, a chat message. The model can tell the difference, and so can the person reading the answer. Each source gets a weighted share of the 12,000 characters (email 40, chat 30, knowledge 25, incidents 25; personal notes capped at 1,500), and knowledge atoms replace the raw tickets and document passages they summarise, so the context stays the same size as knowledge grows.

5
Route
Send it to a model, with a fallback ready
gpt-oss-120b (Groq) → gpt-oss-20b (12 s per attempt, cool-down on failure)

The context and question go to openai/gpt-oss-120b on Groq. If it is rate-limited, failing or slower than 12 seconds, a backup model (gpt-oss-20b) answers instead, and the failing one sits out a cool-down: 30 seconds for a rate limit or server error, 5 minutes for a wrong key or retired model. The model is told to answer only from the context and to say where facts came from. If several items match, it asks which one is meant; if nothing matches, it says so and suggests the detail that would help. A locally-run Ollama model can take over synthesis instead, opt-in for privacy. Full breakdown of why it's routed this way, and what each option costs, in Cost & Latency below.

6
Trace
Every answer gets a receipt
aio_traces { quality, latency, cost, sources }

Sources used, how long it took, roughly what it cost, and a quality score get written down automatically, along with an output check that runs before the reply ever renders. If retrieval came back empty but the model answered anyway, a source timed out, or a query took unusually long, it's flagged right there, not left for someone to notice after a customer complains.

One MongoDB instance, every module

There's exactly one database. Every module writes to its own set of collections, prefixed by name, so it's obvious at a glance which module owns which data, without needing a separate database, schema, or connection per module.

One MongoDB Instance
email_*
msg_*
knowledge_*
inc_*
pm_*
rag_*
integration_*
aio_*
audit_*
user_*
org_*
cal_*
PrefixOwned by
email_*Email module: mailboxes, messages, domains
msg_*Internal messaging / chat
knowledge_*Knowledge base documents and chunks
inc_*Incidents / support tickets
pm_*Projects and project tasks
rag_*RAG pipeline: email passages, integration chunks, knowledge atoms, distillation state, query cache
integration_*Connected third-party tool config and sync state
aio_*AIO traces and quality scoring
audit_*Tamper-evident, hash-chained audit log
user_*Accounts, roles, personal notes
org_*Organization records and settings
cal_* / calendar_eventsCalendar module

Search runs on MongoDB's own text indexes plus embeddings stored as plain number arrays on the same documents, rather than in a separate vector store. One instance to back up, one instance to restore, no cross-database consistency problem to reason about.

A full mail server, not an inbox viewer

The email module isn't a thin client bolted onto Gmail. It's an actual SMTP and IMAP implementation, so a KaryoSpace address sends and receives mail directly.

Inbound + SPF
Spam Scoring
DKIM Signing
Outbound Queue
IMAP Access
  1. Inbound & SPF
    Incoming mail is checked against the sender domain's SPF record before it's trusted.
  2. Spam scoring
    Every message gets a score from keyword patterns, SPF failure, ALL-CAPS ratio, and bulk-mail headers. A score of 5 or higher routes straight to Spam, not the inbox.
  3. DKIM signing
    Outbound mail is signed with a per-domain key, stored encrypted at rest. It's the same mechanism that keeps Gmail from flagging KaryoSpace mail as forged.
  4. Outbound queue & retries
    A failed send doesn't just vanish. It's retried at 5 minutes, 30 minutes, 2 hours, 6 hours, then 24 hours (6 attempts total) before the sender gets a bounce notice.
  5. IMAP access
    Standard IMAP folders (Inbox, Sent, Drafts, Trash, Spam) mean any real mail client can connect to it, so the web UI isn't the only way in.

Real-time chat, three channel shapes

Internal messaging runs over its own WebSocket connection (/ws/messaging), not polling, so presence, typing, and new messages show up without the client asking for them.

/ws/messaging
Real-time WebSocket
public
Org-wide channels
direct
2-person DM
group
3+ named DM
Channel typeWhat it is
publicOrg-wide channels, the #general / #engineering style shared space
directA 2-person DM
groupA named group DM with 3 or more people

Presence (online / away / offline) is stored with a 90-second TTL. If a client disconnects without saying so, it ages out on its own rather than showing someone as permanently online. Typing indicators and presence changes are separate WebSocket event types, sent the moment they happen, not bundled into the next message poll.

Every message channel is also a RAG source: the assistant can answer questions about what was discussed in a channel the same way it answers questions about email or tickets, scoped to channels the asking user is actually a member of.

Knowledge base: upload, ask, and a two-person delete

This is where org documentation lives, and the one place in the product where deleting something isn't a single click.

Upload
Search & Ask
Share
Delete: Request → Approve
  1. Upload
    Text, Markdown, or PDF (text layer only), chunked into 500-word windows the moment it's ingested, per the chunking rules above.
  2. Search & Ask
    /knowledge/search does a direct lookup; /knowledge/ask is rate-limited separately from the main assistant and runs a question through the same RAG-style retrieval, scoped to knowledge docs.
  3. Share
    Individual docs can get a public share link, for the cases where something needs to go outside the org without exporting it manually.
  4. Delete: request, then approve
    Deleting a document doesn't remove it outright: it's marked pending, and a separate admin-only approval step has to confirm it before it's actually gone. One person's mistake, or a bad-faith delete, can't quietly erase org knowledge on its own.

Project management: epics, sprints, and an AI that can create tasks

Not a Jira clone. It's a lighter internal PM module that mirrors into the same retrieval and assistant pipeline as everything else.

Project
Epic
Task
Sprint
ConceptWhat it covers
ProjectsThe top-level container everything else belongs to
EpicsGroupings of related tasks inside a project
TasksAssignable units of work with status, comments, due dates
SprintsTime-boxed groupings of tasks
CommentsThreaded discussion on a task, same audit trail as everything else

Two AI-specific endpoints sit on top: one lets the assistant create a task directly from a natural-language request ("create a task for the login bug"), the other generates a sprint summary on demand rather than someone writing a status update by hand. /projects/overdue-tasks and /projects/my-tasks back the "what's overdue?" and "what do I have to do?" questions the assistant gets asked most.

Everything else running in the same binary

Smaller modules, each scoped to its own org and still searchable by the same RAG fan-out.

Same Binary, Same Org Scope
Incidents
Calendar
Notifications
Integrations
Billing
Incidents
Ticket-style incident tracking with its own lifecycle, searchable alongside every other source.
Calendar
Native scheduling, plus two-way sync with connected Google and Outlook calendars.
Notifications
In-app and web-push notifications for the events people actually need to see.
Integrations
Gmail, Outlook, Confluence, Jira, ServiceNow, Slack (incl. Slack MCP), and GitHub, polled and merged into the same retrieval path.
Billing
Plan and usage tracking for the org, the account-level layer everything else sits on top of.

Admin, Feedback & Analytics

The parts that keep the product honest to its own operators, not just its users.

Operator-Facing Tools
Admin Panel
IP-allowlisted
Feedback
Analytics
A
Admin Panel
Org configuration, roles, provider swap

Admin routes check the session role first; the most sensitive ones add a second, independent IP-allowlist check, so a single compromised admin session isn't automatically enough on its own.

AreaCovers
Users & rolesList users, change role, change org, enable/disable an account
SettingsOrg-wide configuration, LLM provider, integration credentials
Usage & billingPer-org usage, plan/billing admin
AuditBrowse the audit log, plus a one-click hash-chain integrity check
Email queueInspect the outbound queue, force-retry a stuck send, mailbox stats
AI queries & logsReview what the assistant has been asked, application logs

The audit-verify check exists because the log is hash-chained: each entry embeds a hash of the one before it, so a single click confirms nothing in the chain has been quietly edited, rather than trusting that it wasn't.

F
Feedback
In-app reports, size-capped

Feedback is submitted in-app, categorized, and stored in its own collection. The AI can help polish a rough draft into something clearer before it's sent, and the person's original point stays theirs, just easier to read.

S
Analytics
Page visits, KPIs, city-level geography

Page-visit events feed a small set of product KPIs, including city-level geolocation (via GeoIP) for understanding where usage comes from.

One binary, five layers

No microservices to orchestrate, no queue to lose a message in. Each request takes the same short path, click a band to see what's actually running inside it.

Client
Browser or installed PWA
nginx
TLS termination, reverse proxy
The Go Binary
One process, ~28 packages
MongoDB
One instance, grouped by domain
Integrations
8 connectors, same retrieval path
1
Client
Browser or installed PWA

The app is installable (PWA) and talks to the server over HTTPS only. No plugin, no desktop client to keep updated.

2
nginx
TLS termination, reverse proxy

Terminates TLS and forwards everything to the app over plain HTTP inside a private network. The Go binary never talks directly to the internet.

3
The Go binary
One process, standard-library router

Every module (email, chat, the knowledge base, tickets, projects, calendar, the RAG pipeline) is a package inside one Go binary, routed with the standard library's own router. Nothing here is a separate service with its own deploy, its own network hop, or its own way of failing.

emailmessagingknowledge pmincidentcalendar notificationsintegrationsrag llmaioaudit ssrfguardbilling aime/guardsaime/retrieveorgres
4
MongoDB
One instance, grouped by domain

A single MongoDB instance holds everything. Search runs on native text indexes and on embeddings stored as plain arrays on the documents themselves, so there's no separate vector store to provision, back up, or lose sync with.

email_*msg_*knowledge_* pm_*inc_*rag_* integration_*calendar_events audit_logaio_traces
5
Integrations
8 connectors, same retrieval path

External tools are polled on a schedule, chunked, embedded where possible, and merged into the exact same retrieval fan-out described above. The assistant doesn't treat a Jira ticket differently from an internal one.

GGmail
OOutlook
CConfluence
JJira
SServiceNow
SSlack
SSlack MCP
GHGitHub

Data Chunking

Before anything gets searched, it has to be split into pieces small enough for the model to actually read. Every source uses overlapping windows, sized for what it holds: knowledge base uploads, synced integration content, and long email threads.

Document Ingested
Overlapping Windows
256 to 512 words
Embed
nomic-embed-text, local
Stored on Document
email: 256-word windows (206-word stride) documents: 500-word windows (450-word stride) apps: 512-word windows (462-word stride) hard cap: 50,000 characters per source document

Overlapping windows mean a fact sitting right at a chunk boundary still shows up whole in at least one chunk, so nothing important gets silently cut in half. Supported source formats are plain text, Markdown, and the text layer of PDFs; anything else is rejected at ingest rather than silently mis-parsed.

Each chunk is embedded once at ingest time with Ollama's nomic-embed-text (768 dimensions), running on the same server, so text is never sent out to be embedded. Gemini's gemini-embedding-001 (3072 dimensions) can be configured instead, and the two are never mixed in one field. The vector is stored directly on the document. If the embedder is unavailable, search falls back to MongoDB's native text index instead of failing. In the background, a small local model (gemma3:4b) also distils tickets and documents into one-line knowledge atoms that name their source; see the AIME page.

AIO: the observability engine watching every answer

Every AI response gets a quality score, starting at 100 and losing points for specific, named failure patterns. It's not a vague "confidence" number, but an itemized deduction anyone can audit.

Every AI Answer
7 Flags Checked
Named failure patterns
Quality Score
100 − penalties
Base score
100
empty_retrieval_answered: RAG query, zero chunks found, model answered anyway
−35
no_sources: RAG query returned zero source categories
−20
low_similarity: Best match similarity score below 0.35
−15
slow_llm: Model response took longer than 10s
−10
slow_total: Whole pipeline took longer than 20s
−10
partial_branches: One or more sources timed out, errored or crashed
−10
high_cost: Estimated cost above $0.05
−5
Shown to the user, every time
score / 100

Each trace records exactly which sources were used, latency at every stage, an estimated cost, and the resulting quality score, written to aio_traces automatically, on every query, not sampled. The worst pattern the score exists to catch is a model confidently answering from nothing. That's the −35, the single largest penalty on the table, because it's the failure a user is least likely to notice on their own.

Guardrails, not an afterthought

Nothing here is exotic. It's the same handful of protections any system handling company data should have, applied consistently rather than bolted on later.

Every Request
SSRF Protection
Audit Log
Hash-chained
Rate Limiting
Session Auth
Access Guards
Every result
SSRF protection
Any URL a user or integration hands the system is checked before it's fetched, so there's no reaching internal networks or cloud metadata endpoints.
Tamper-evident audit log
Every create, update, and delete is written to a hash-chained log, so a record can't be quietly edited after the fact.
Rate limiting
AI queries, email sends, and ticket creation are throttled per user, so one runaway script can't take the whole org down.
Session auth
Every request is checked against an authenticated session (SSO or local login), with admin routes gated separately.
Access guards on every result
AIME Guards turn the asker's clearance into a filter inside every search and re-check each result before the model reads it. Unlabelled content is refused, never shared.
Rule checks before and after the model
Input is sanitised and screened by fixed rules before any model runs (code generation and credential requests are refused at no AI cost), and replies are checked for leaked secrets before they render.
Self-hosted means there's no vendor to blame and no vendor to hide behind. Uptime, backups, and data retention are ours to own, end to end.

Built on boring, well-understood pieces

Nothing here needs a specialist to operate. That's deliberate: the tools are the tools, chosen because they're well understood, not because they're impressive on a slide.

Ollama
Embeddings + local model
Groq
Default
Gemini
Optional embeddings
Go MongoDB Docker nginx WebSocket GridFS

AI routing is intentionally swappable, a config choice rather than a rewrite; full breakdown of why in Cost & Latency below.

LayerChoice
LanguageGo 1.24, one binary, ~28 internal packages, no web framework (standard library router)
FrontendServer-rendered HTML (Go's html/template), vanilla JavaScript, Tailwind pre-built, no build step, no bundler
Sessionsgorilla/sessions (signed, encrypted cookies)
Database driverOfficial MongoDB Go driver
Realtimegorilla/websocket
Email protocolsemersion's go-imap, go-message, go-msgauth (DKIM)
Authgolang.org/x/oauth2 (OIDC), pquerna/otp (TOTP)
Security utilitiesbluemonday (HTML sanitizing), geoip2 (coarse geolocation)
Push & metricswebpush-go, Prometheus client

No React, no Vue, no Node build pipeline in production. Pages are templated server-side and shipped as plain HTML/CSS/JS. That's a deliberate trade: less flexibility for a highly dynamic UI, in exchange for zero client-side build step and one runtime to reason about.

Building, installing, and deploying it

For the person using it day to day, "installing" the app means the PWA install prompt covered earlier. For the person running it, here's the actual build and deploy path.

go build -o workspace .
Multi-stage Dockerfile
golang:1.24-alpine builder
alpine:latest Runtime
Non-root user
nginx + MongoDB
Same topology anywhere
build: go build -o workspace . image: multi-stage Dockerfile — golang:1.24-alpine builder → alpine:latest runtime runs as: non-root user, ports 8080 (app) · 2525/587 (SMTP) · 1993 (IMAP)

The runtime image is deliberately minimal, Alpine plus CA certificates and a handful of small utilities (tzdata, curl, git), and the app runs as a dedicated non-root user inside the container rather than root, standard least-privilege practice for anything internet-facing.

Topology is the same regardless of where it's hosted: nginx terminates TLS and reverse-proxies to the app container, MongoDB runs alongside it, and there's no dependency on any single cloud provider. The whole stack is three things (nginx, the Go binary, MongoDB) that run anywhere a container can.

A handful of environment variables are all that's required to bring up a new instance: a MongoDB connection string, a session signing key, and a key for encrypting DKIM private keys at rest. Everything else (which LLM provider, which integrations are enabled, SMTP relay settings) has a sane default and can be turned on later without a rebuild.

The insights panel

Two endpoints feed it, one summarized, one raw, and each click behaves differently on purpose.

Briefing: GET /home/assistant

  • Cached 5 minutes per user; ?refresh=1 forces a rebuild
  • Summarizes emails, tasks, incidents, and calendar into short sections
  • The LLM only runs when channel messages actually need summarizing

Activity feed: GET /home/feed

  • Up to 5 emails, 10 tasks, 5 incidents, 5 calendar events
  • Sorted newest-first, capped at 50 items total
  • Every item carries its own destination URL
Insight card click
/Home?insight={id}
Opens the matching detail panel inline
Feed item click
Source module
/email, /projects, /incidents: the real page

Right answer, lowest cost

Every lever above compounds. Repeat questions skip the model entirely, out-of-scope requests stop before it, and everything else runs under a hard budget.

Notes: hard cap
1,500 chars
Email: weight 40 of the remainder
~33%
Chat: weight 30
~25%
Knowledge base: weight 25
~21%
Incidents: weight 25 (an empty source's share goes to the others)
~21%
Total context budget, per query
12,000 chars

Cloud: Groq (default, gpt-oss-120b)

  • Median 1.4 s end to end on the live site (measured)
  • Traces estimate $0.15 / $0.60 per million input/output tokens
  • No local GPU needed; a backup model takes over after 12 s

Local: Ollama (opt-in)

  • 10–100s response time, hardware-dependent
  • $0 marginal cost per query
  • On via USE_LOCAL_FOR_SYNTHESIS, only when retrieval found real context
0.92 cache-hit threshold skips the LLM entirely 20 AI queries / min / user Cache + trace writes are async, never block the reply

Eight ways in, one way to run it

Every connector feeds the same retriever. Every deploy is the same three pieces.

Gmail
Outlook
Confluence
Jira
SN
ServiceNow
Slack (direct)
Slack (MCP)
GitHub (MCP)
$ go build -o workspace . $ docker build -t karyospace . $ docker run -p 8080:8080 karyospace
Go 1.24 MongoDB Vanilla JS + Tailwind Docker Alpine gorilla/websocket

Want to see it running?

The best way to understand the architecture is to watch it answer a real question.

Contact Us
We read every submission

Message Sent!

Thanks for reaching out. We'll get back to you shortly.

Send Feedback
We read every submission
Build Stats
Loading stats…