# pendem-2003/xyne-spaces architecture

> Architecture diagram of the GitHub repository pendem-2003/xyne-spaces, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pendem-2003/xyne-spaces
- Repository: https://github.com/pendem-2003/xyne-spaces

## Overview

Xyne Spaces is an organizational context platform surrounded by collaborative and productivity apps. The principal flow is connector sync or app activity into normalized, indexed context; people and agents then retrieve permission-scoped results, while apps and automations can act on that context. The README documents the product-level relationships; source-index evidence adds a few implementation links. Many product subsystems are represented by their existing directories because their implementation files were not sampled.

Main entry points: [`apps/backend/src/services/vespaKnowledgeIngestionService.ts`](https://github.com/pendem-2003/xyne-spaces/blob/main/apps/backend/src/services/vespaKnowledgeIngestionService.ts) (Normalized context store), [`apps/xyne-claw-auth/backend/src`](https://github.com/pendem-2003/xyne-spaces/tree/main/apps/xyne-claw-auth/backend/src) (Claw gateway), [`apps/xyne-claw/src`](https://github.com/pendem-2003/xyne-spaces/tree/main/apps/xyne-claw/src) (Claw runtime), [`apps/backend/src/services/queryService/queryService.ts`](https://github.com/pendem-2003/xyne-spaces/blob/main/apps/backend/src/services/queryService/queryService.ts) (Context query service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_context["Org context"]
  node_connectors["Connectors and imports"]
  node_ingestion["Context ingestion"]
  node_knowledge["Knowledge indexing"]
  node_query["Context query service<br/>[queryService.ts]"]
  node_queryapi["Query API<br/>[queryController.ts]"]
  node_contextstore[("Normalized context store")]
end

subgraph group_apps["Org apps"]
  node_searchui["Agentic search"]
  node_collaboration["Chat, calls, canvas"]
  node_support["Support desk and tickets"]
end

subgraph group_agents["Agents and automation"]
  node_automations["Automations"]
  node_clawgateway["Claw gateway"]
  node_clawruntime["Claw runtime"]
  node_sandbox["Isolated shell sandbox"]
  node_mcp["Query-routing MCP server"]
end

subgraph group_platform["Platform services"]
  node_permissions["Permission model"]
  node_sharedqueries["Live query and mutation layer<br/>[useZero.ts]"]
  node_cache["Client query cache"]
  node_llm["LLM client<br/>[llm-client.ts]"]
end

node_human(("People and agents"))
node_connectedtools["Connected systems"]
node_externaltools["External tools"]

node_connectedtools -->|"syncs from"| node_connectors
node_connectors -->|"feeds"| node_ingestion
node_ingestion -->|"normalizes and indexes"| node_contextstore
node_knowledge -->|"inserts and deletes"| node_contextstore
node_collaboration -->|"adds work context"| node_contextstore
node_support -->|"adds work context"| node_contextstore
node_human -->|"searches"| node_searchui
node_searchui -->|"requests results"| node_queryapi
node_queryapi -.->|"dispatches query"| node_query
node_query -->|"retrieves context"| node_contextstore
node_query -->|"scopes results"| node_permissions
node_human -->|"invokes agent"| node_clawgateway
node_clawgateway -->|"dispatches run"| node_clawruntime
node_clawruntime -->|"requests tools"| node_mcp
node_mcp -->|"posts query request"| node_queryapi
node_clawgateway -->|"dispatches shell work"| node_sandbox
node_clawruntime -.->|"runs agent loop"| node_llm
node_human -->|"configures workflows"| node_automations
node_automations -->|"reads and writes context"| node_contextstore
node_clawruntime -->|"inherits caller access"| node_permissions
node_sharedqueries -->|"hydrates and updates"| node_cache
node_clawgateway -->|"executes tool calls"| node_externaltools

click node_connectors "https://github.com/pendem-2003/xyne-spaces/tree/main/apps/backend/src/services/dynamicDashboard/dataSource/connectors"
click node_ingestion "https://github.com/pendem-2003/xyne-spaces/blob/main/apps/backend/src/services/dynamicDashboard/dataSource/ingestion/ingestionService.ts"
click node_knowledge "https://github.com/pendem-2003/xyne-spaces/blob/main/apps/backend/src/services/vespaKnowledgeIngestionService.ts"
click node_query "https://github.com/pendem-2003/xyne-spaces/blob/main/apps/backend/src/services/queryService/queryService.ts"
click node_queryapi "https://github.com/pendem-2003/xyne-spaces/blob/main/apps/backend/src/controllers/queryController.ts"
click node_searchui "https://github.com/pendem-2003/xyne-spaces/blob/main/apps/dashboard/src/components/Chat/SearchResults/filters/useQuerySuggestions.ts"
click node_collaboration "https://github.com/pendem-2003/xyne-spaces/tree/main/apps/backend/src/controllers"
click node_support "https://github.com/pendem-2003/xyne-spaces/tree/main/apps/backend/src/apps/controllers"
click node_automations "https://github.com/pendem-2003/xyne-spaces/tree/main/apps/backend/src/automations"
click node_clawgateway "https://github.com/pendem-2003/xyne-spaces/tree/main/apps/xyne-claw-auth/backend/src"
click node_clawruntime "https://github.com/pendem-2003/xyne-spaces/tree/main/apps/xyne-claw/src"
click node_sandbox "https://github.com/pendem-2003/xyne-spaces/tree/main/claw-deployments/kata-infra/sandbox-router-ws"
click node_mcp "https://github.com/pendem-2003/xyne-spaces/blob/main/apps/xyne-claw-auth/backend/src/mcp/servers/query-routing-server.ts"
click node_permissions "https://github.com/pendem-2003/xyne-spaces/tree/main/apps/backend/src/bypassAcl"
click node_sharedqueries "https://github.com/pendem-2003/xyne-spaces/blob/main/packages/shared/src/hooks/useZero.ts"
click node_cache "https://github.com/pendem-2003/xyne-spaces/blob/main/packages/shared/src/machines/queryCacheMachine.ts"
click node_llm "https://github.com/pendem-2003/xyne-spaces/blob/main/packages/framework/src/llm/client/llm-client.ts"
click node_contextstore "https://github.com/pendem-2003/xyne-spaces/blob/main/apps/backend/src/services/vespaKnowledgeIngestionService.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_connectors,node_ingestion,node_knowledge,node_query,node_queryapi,node_contextstore toneBlue
class node_searchui,node_collaboration,node_support toneAmber
class node_automations,node_clawgateway,node_clawruntime,node_sandbox,node_mcp toneMint
class node_permissions,node_sharedqueries,node_cache,node_llm toneRose
class node_human,node_connectedtools,node_externaltools toneIndigo
```

## Components

### Org context

- [Connectors and imports](https://github.com/pendem-2003/xyne-spaces/tree/main/apps/backend/src/services/dynamicDashboard/dataSource/connectors): `apps/backend/src/services/dynamicDashboard/dataSource/connectors`
- [Context ingestion](https://github.com/pendem-2003/xyne-spaces/blob/main/apps/backend/src/services/dynamicDashboard/dataSource/ingestion/ingestionService.ts): `apps/backend/src/services/dynamicDashboard/dataSource/ingestion/ingestionService.ts`
- [Knowledge indexing](https://github.com/pendem-2003/xyne-spaces/blob/main/apps/backend/src/services/vespaKnowledgeIngestionService.ts): `apps/backend/src/services/vespaKnowledgeIngestionService.ts`
- [Context query service](https://github.com/pendem-2003/xyne-spaces/blob/main/apps/backend/src/services/queryService/queryService.ts): `apps/backend/src/services/queryService/queryService.ts`
- [Query API](https://github.com/pendem-2003/xyne-spaces/blob/main/apps/backend/src/controllers/queryController.ts): `apps/backend/src/controllers/queryController.ts`
- [Normalized context store](https://github.com/pendem-2003/xyne-spaces/blob/main/apps/backend/src/services/vespaKnowledgeIngestionService.ts): `apps/backend/src/services/vespaKnowledgeIngestionService.ts`

### Org apps

- [Agentic search](https://github.com/pendem-2003/xyne-spaces/blob/main/apps/dashboard/src/components/Chat/SearchResults/filters/useQuerySuggestions.ts): `apps/dashboard/src/components/Chat/SearchResults/filters/useQuerySuggestions.ts`
- [Chat, calls, canvas](https://github.com/pendem-2003/xyne-spaces/tree/main/apps/backend/src/controllers): `apps/backend/src/controllers`
- [Support desk and tickets](https://github.com/pendem-2003/xyne-spaces/tree/main/apps/backend/src/apps/controllers): `apps/backend/src/apps/controllers`

### Agents and automation

- [Automations](https://github.com/pendem-2003/xyne-spaces/tree/main/apps/backend/src/automations): `apps/backend/src/automations`
- [Claw gateway](https://github.com/pendem-2003/xyne-spaces/tree/main/apps/xyne-claw-auth/backend/src): `apps/xyne-claw-auth/backend/src`
- [Claw runtime](https://github.com/pendem-2003/xyne-spaces/tree/main/apps/xyne-claw/src): `apps/xyne-claw/src`
- [Isolated shell sandbox](https://github.com/pendem-2003/xyne-spaces/tree/main/claw-deployments/kata-infra/sandbox-router-ws): `claw-deployments/kata-infra/sandbox-router-ws`
- [Query-routing MCP server](https://github.com/pendem-2003/xyne-spaces/blob/main/apps/xyne-claw-auth/backend/src/mcp/servers/query-routing-server.ts): `apps/xyne-claw-auth/backend/src/mcp/servers/query-routing-server.ts`

### Platform services

- [Permission model](https://github.com/pendem-2003/xyne-spaces/tree/main/apps/backend/src/bypassAcl): `apps/backend/src/bypassAcl`
- [Live query and mutation layer](https://github.com/pendem-2003/xyne-spaces/blob/main/packages/shared/src/hooks/useZero.ts): `packages/shared/src/hooks/useZero.ts`
- [Client query cache](https://github.com/pendem-2003/xyne-spaces/blob/main/packages/shared/src/machines/queryCacheMachine.ts): `packages/shared/src/machines/queryCacheMachine.ts`
- [LLM client](https://github.com/pendem-2003/xyne-spaces/blob/main/packages/framework/src/llm/client/llm-client.ts): `packages/framework/src/llm/client/llm-client.ts`

### Other components

- **People and agents**
- **Connected systems**
- **External tools**

## Connections

- Connected systems → Connectors and imports: syncs from (evidence: `README.md`)
- Connectors and imports → Context ingestion: feeds (evidence: `apps/backend/src/services/dynamicDashboard/dataSource/ingestion/ingestionService.ts`)
- Context ingestion → Normalized context store: normalizes and indexes (evidence: `README.md`)
- Knowledge indexing → Normalized context store: inserts and deletes (evidence: `apps/backend/src/services/vespaKnowledgeIngestionService.ts`)
- Chat, calls, canvas → Normalized context store: adds work context (evidence: `README.md`)
- Support desk and tickets → Normalized context store: adds work context (evidence: `README.md`)
- People and agents → Agentic search: searches (evidence: `README.md`)
- Agentic search → Query API: requests results (evidence: `README.md`)
- Query API → Context query service: dispatches query
- Context query service → Normalized context store: retrieves context (evidence: `README.md`)
- Context query service → Permission model: scopes results (evidence: `README.md`)
- People and agents → Claw gateway: invokes agent (evidence: `README.md`)
- Claw gateway → Claw runtime: dispatches run (evidence: `README.md`)
- Claw runtime → Query-routing MCP server: requests tools (evidence: `README.md`)
- Query-routing MCP server → Query API: posts query request (evidence: `apps/xyne-claw-auth/backend/src/mcp/servers/query-routing-server.ts`)
- Claw gateway → Isolated shell sandbox: dispatches shell work (evidence: `README.md`)
- Claw runtime → LLM client: runs agent loop
- People and agents → Automations: configures workflows (evidence: `README.md`)
- Automations → Normalized context store: reads and writes context (evidence: `README.md`)
- Claw runtime → Permission model: inherits caller access (evidence: `README.md`)
- Live query and mutation layer → Client query cache: hydrates and updates (evidence: `packages/shared/src/machines/queryCacheMachine.ts`)
- Claw gateway → External tools: executes tool calls (evidence: `README.md`)
