# usemoss/moss architecture

> Architecture diagram of the GitHub repository usemoss/moss, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/usemoss/moss
- Repository: https://github.com/usemoss/moss

## Overview

Moss is an embeddable semantic-search runtime for conversational AI: applications create or ingest indexes, load them into an SDK, and query them locally for fast retrieval. The repository includes several language SDKs, database connectors, and framework/voice-agent integrations. The map emphasizes the documented index-to-query workflow and the best-evidenced integration paths; sampled source is incomplete, so uncertain internal runtime and connector wiring is omitted.

Main entry points: [`sdks/python/sdk/src/moss/client/moss_client.py`](https://github.com/usemoss/moss/blob/main/sdks/python/sdk/src/moss/client/moss_client.py) (Python client), [`sdks/javascript/sdk/src/client/internalMossClient.ts`](https://github.com/usemoss/moss/blob/main/sdks/javascript/sdk/src/client/internalMossClient.ts) (JavaScript client), [`sdks/swift/Sources/Moss/MossClient.swift`](https://github.com/usemoss/moss/blob/main/sdks/swift/Sources/Moss/MossClient.swift) (Swift client), [`packages/pipecat-moss/src/pipecat_moss/moss_retrieval_service.py`](https://github.com/usemoss/moss/blob/main/packages/pipecat-moss/src/pipecat_moss/moss_retrieval_service.py) (Pipecat retrieval service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sdk["SDKs and Runtime"]
  node_python_sdk["Python client<br/>[moss_client.py]"]
  node_python_helpers["Input and job helpers"]
  node_python_session["Session index<br/>[session_index.py]"]
  node_python_inference["Inference API<br/>[inference.py]"]
  node_js_client["JavaScript client"]
  node_js_auth["Authentication"]
  node_js_models["SDK models<br/>[models.ts]"]
  node_swift_client["Swift client<br/>[MossClient.swift]"]
  node_swift_session["Swift sessions<br/>[MossSession.swift]"]
  node_go_query["Go query client<br/>[query.go]"]
end

subgraph group_ingest["Indexing and Ingestion"]
  node_connectors["Database connectors"]
  node_md_indexer["Markdown indexer<br/>[builder.ts]"]
end

subgraph group_integrations["Framework Integrations"]
  node_pipecat_service["Pipecat retrieval service"]
  node_pipecat_processor["Pipecat index processor"]
  node_dspy["DSPy retriever<br/>[retrieve.py]"]
  node_strands["Strands search tool"]
  node_vercel_tools["Vercel AI tools<br/>[search.ts]"]
  node_llama_backend["LlamaIndex backend<br/>[main.py]"]
end

subgraph group_voice["Voice Applications"]
  node_agora_server["Agora MCP server<br/>[server.py]"]
  node_agora_search["Agora search adapter<br/>[search.py]"]
  node_vapi_server["Vapi tool server<br/>[server.py]"]
  node_vapi_search["Vapi search adapter<br/>[search.py]"]
end

subgraph group_docs["Search Experiences"]
  node_next_search["Next.js search UI<br/>[page.tsx]"]
  node_vitepress_search["VitePress search plugin<br/>[Search.vue]"]
end

node_developer(("Application developer"))
node_cloud[("Moss Cloud")]

node_developer -->|"uses"| node_python_sdk
node_developer -->|"uses"| node_js_client
node_developer -->|"uses"| node_swift_client
node_python_sdk -->|"uses"| node_python_helpers
node_python_sdk -->|"creates sessions"| node_python_session
node_python_sdk -->|"manages indexes"| node_cloud
node_python_sdk -->|"loads indexes"| node_cloud
node_js_client -->|"configures"| node_js_auth
node_js_client -->|"uses types"| node_js_models
node_js_client -->|"manages indexes"| node_cloud
node_swift_client -->|"creates sessions"| node_swift_session
node_swift_client -->|"loads indexes"| node_cloud
node_go_query -->|"queries remotely"| node_cloud
node_connectors -->|"ingests data"| node_python_sdk
node_md_indexer -.->|"uploads indexes"| node_cloud
node_pipecat_service -->|"creates processor"| node_pipecat_processor
node_pipecat_service -->|"loads index"| node_python_sdk
node_dspy -.->|"retrieves with"| node_python_sdk
node_strands -.->|"searches with"| node_python_sdk
node_vercel_tools -.->|"searches with"| node_js_client
node_agora_server -->|"configures search"| node_agora_search
node_agora_search -.->|"retrieves with"| node_python_sdk
node_vapi_server -->|"calls search"| node_vapi_search
node_vapi_search -.->|"retrieves with"| node_python_sdk
node_llama_backend -->|"indexes and queries"| node_python_sdk
node_next_search -.->|"searches through SDK"| node_cloud
node_vitepress_search -.->|"searches through SDK"| node_cloud

click node_python_sdk "https://github.com/usemoss/moss/blob/main/sdks/python/sdk/src/moss/client/moss_client.py"
click node_python_helpers "https://github.com/usemoss/moss/tree/main/sdks/python/sdk/src/moss/client"
click node_python_session "https://github.com/usemoss/moss/blob/main/sdks/python/sdk/src/moss/client/session_index.py"
click node_python_inference "https://github.com/usemoss/moss/blob/main/sdks/python/sdk/src/moss/inference.py"
click node_js_client "https://github.com/usemoss/moss/blob/main/sdks/javascript/sdk/src/client/internalMossClient.ts"
click node_js_auth "https://github.com/usemoss/moss/tree/main/sdks/javascript/sdk/src/auth"
click node_js_models "https://github.com/usemoss/moss/blob/main/sdks/javascript/sdk/src/models.ts"
click node_swift_client "https://github.com/usemoss/moss/blob/main/sdks/swift/Sources/Moss/MossClient.swift"
click node_swift_session "https://github.com/usemoss/moss/blob/main/sdks/swift/Sources/Moss/MossSession.swift"
click node_go_query "https://github.com/usemoss/moss/blob/main/sdks/go/sdk/query.go"
click node_connectors "https://github.com/usemoss/moss/tree/main/packages/moss-data-connector"
click node_md_indexer "https://github.com/usemoss/moss/blob/main/packages/moss-md-indexer/src/builder.ts"
click node_pipecat_service "https://github.com/usemoss/moss/blob/main/packages/pipecat-moss/src/pipecat_moss/moss_retrieval_service.py"
click node_pipecat_processor "https://github.com/usemoss/moss/blob/main/packages/pipecat-moss/src/pipecat_moss/moss_index_processor.py"
click node_dspy "https://github.com/usemoss/moss/blob/main/packages/dspy-moss/src/dspy_moss/retrieve.py"
click node_strands "https://github.com/usemoss/moss/blob/main/packages/strands-agents-moss/src/strands_agents_moss/moss_search_tool.py"
click node_vercel_tools "https://github.com/usemoss/moss/blob/main/packages/vercel-sdk/src/tools/search.ts"
click node_agora_server "https://github.com/usemoss/moss/blob/main/apps/agora-moss/server.py"
click node_agora_search "https://github.com/usemoss/moss/blob/main/packages/agora-moss/src/agora_moss/search.py"
click node_vapi_server "https://github.com/usemoss/moss/blob/main/apps/vapi-moss/server.py"
click node_vapi_search "https://github.com/usemoss/moss/blob/main/packages/vapi-moss/src/vapi_moss/search.py"
click node_llama_backend "https://github.com/usemoss/moss/blob/main/apps/moss-llamaindex/backend/main.py"
click node_next_search "https://github.com/usemoss/moss/blob/main/apps/next-js/app/page.tsx"
click node_vitepress_search "https://github.com/usemoss/moss/blob/main/packages/vitepress-plugin-moss/Search.vue"

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_python_sdk,node_python_helpers,node_python_session,node_python_inference,node_js_client,node_js_auth,node_js_models,node_swift_client,node_swift_session,node_go_query toneBlue
class node_connectors,node_md_indexer,node_cloud toneAmber
class node_pipecat_service,node_pipecat_processor,node_dspy,node_strands,node_vercel_tools,node_llama_backend toneMint
class node_agora_server,node_agora_search,node_vapi_server,node_vapi_search toneRose
class node_next_search,node_vitepress_search,node_developer toneIndigo
```

## Components

### SDKs and Runtime

- [Python client](https://github.com/usemoss/moss/blob/main/sdks/python/sdk/src/moss/client/moss_client.py): `sdks/python/sdk/src/moss/client/moss_client.py`
- [Input and job helpers](https://github.com/usemoss/moss/tree/main/sdks/python/sdk/src/moss/client): `sdks/python/sdk/src/moss/client`
- [Session index](https://github.com/usemoss/moss/blob/main/sdks/python/sdk/src/moss/client/session_index.py): `sdks/python/sdk/src/moss/client/session_index.py`
- [Inference API](https://github.com/usemoss/moss/blob/main/sdks/python/sdk/src/moss/inference.py): `sdks/python/sdk/src/moss/inference.py`
- [JavaScript client](https://github.com/usemoss/moss/blob/main/sdks/javascript/sdk/src/client/internalMossClient.ts): `sdks/javascript/sdk/src/client/internalMossClient.ts`
- [Authentication](https://github.com/usemoss/moss/tree/main/sdks/javascript/sdk/src/auth): `sdks/javascript/sdk/src/auth`
- [SDK models](https://github.com/usemoss/moss/blob/main/sdks/javascript/sdk/src/models.ts): `sdks/javascript/sdk/src/models.ts`
- [Swift client](https://github.com/usemoss/moss/blob/main/sdks/swift/Sources/Moss/MossClient.swift): `sdks/swift/Sources/Moss/MossClient.swift`
- [Swift sessions](https://github.com/usemoss/moss/blob/main/sdks/swift/Sources/Moss/MossSession.swift): `sdks/swift/Sources/Moss/MossSession.swift`
- [Go query client](https://github.com/usemoss/moss/blob/main/sdks/go/sdk/query.go): `sdks/go/sdk/query.go`

### Indexing and Ingestion

- [Database connectors](https://github.com/usemoss/moss/tree/main/packages/moss-data-connector): `packages/moss-data-connector`
- [Markdown indexer](https://github.com/usemoss/moss/blob/main/packages/moss-md-indexer/src/builder.ts): `packages/moss-md-indexer/src/builder.ts`

### Framework Integrations

- [Pipecat retrieval service](https://github.com/usemoss/moss/blob/main/packages/pipecat-moss/src/pipecat_moss/moss_retrieval_service.py): `packages/pipecat-moss/src/pipecat_moss/moss_retrieval_service.py`
- [Pipecat index processor](https://github.com/usemoss/moss/blob/main/packages/pipecat-moss/src/pipecat_moss/moss_index_processor.py): `packages/pipecat-moss/src/pipecat_moss/moss_index_processor.py`
- [DSPy retriever](https://github.com/usemoss/moss/blob/main/packages/dspy-moss/src/dspy_moss/retrieve.py): `packages/dspy-moss/src/dspy_moss/retrieve.py`
- [Strands search tool](https://github.com/usemoss/moss/blob/main/packages/strands-agents-moss/src/strands_agents_moss/moss_search_tool.py): `packages/strands-agents-moss/src/strands_agents_moss/moss_search_tool.py`
- [Vercel AI tools](https://github.com/usemoss/moss/blob/main/packages/vercel-sdk/src/tools/search.ts): `packages/vercel-sdk/src/tools/search.ts`
- [LlamaIndex backend](https://github.com/usemoss/moss/blob/main/apps/moss-llamaindex/backend/main.py): `apps/moss-llamaindex/backend/main.py`

### Voice Applications

- [Agora MCP server](https://github.com/usemoss/moss/blob/main/apps/agora-moss/server.py): `apps/agora-moss/server.py`
- [Agora search adapter](https://github.com/usemoss/moss/blob/main/packages/agora-moss/src/agora_moss/search.py): `packages/agora-moss/src/agora_moss/search.py`
- [Vapi tool server](https://github.com/usemoss/moss/blob/main/apps/vapi-moss/server.py): `apps/vapi-moss/server.py`
- [Vapi search adapter](https://github.com/usemoss/moss/blob/main/packages/vapi-moss/src/vapi_moss/search.py): `packages/vapi-moss/src/vapi_moss/search.py`

### Search Experiences

- [Next.js search UI](https://github.com/usemoss/moss/blob/main/apps/next-js/app/page.tsx): `apps/next-js/app/page.tsx`
- [VitePress search plugin](https://github.com/usemoss/moss/blob/main/packages/vitepress-plugin-moss/Search.vue): `packages/vitepress-plugin-moss/Search.vue`

### Other components

- **Application developer**
- **Moss Cloud**

## Connections

- Application developer → Python client: uses (evidence: `README.md`)
- Application developer → JavaScript client: uses (evidence: `README.md`)
- Application developer → Swift client: uses (evidence: `README.md`)
- Python client → Input and job helpers: uses (evidence: `sdks/python/sdk/src/moss/client/moss_client.py`)
- Python client → Session index: creates sessions (evidence: `sdks/python/sdk/src/moss/client/moss_client.py`)
- Python client → Moss Cloud: manages indexes (evidence: `README.md`)
- Python client → Moss Cloud: loads indexes (evidence: `README.md`)
- JavaScript client → Authentication: configures (evidence: `sdks/javascript/sdk/src/client/internalMossClient.ts`)
- JavaScript client → SDK models: uses types (evidence: `sdks/javascript/sdk/src/client/internalMossClient.ts`)
- JavaScript client → Moss Cloud: manages indexes (evidence: `README.md`)
- Swift client → Swift sessions: creates sessions (evidence: `sdks/swift/Sources/Moss/MossClient.swift`)
- Swift client → Moss Cloud: loads indexes (evidence: `README.md`)
- Go query client → Moss Cloud: queries remotely (evidence: `sdks/go/sdk/query.go`)
- Database connectors → Python client: ingests data (evidence: `README.md`)
- Markdown indexer → Moss Cloud: uploads indexes
- Pipecat retrieval service → Pipecat index processor: creates processor (evidence: `packages/pipecat-moss/src/pipecat_moss/moss_retrieval_service.py`)
- Pipecat retrieval service → Python client: loads index (evidence: `packages/pipecat-moss/src/pipecat_moss/moss_retrieval_service.py`)
- DSPy retriever → Python client: retrieves with
- Strands search tool → Python client: searches with
- Vercel AI tools → JavaScript client: searches with
- Agora MCP server → Agora search adapter: configures search (evidence: `apps/agora-moss/server.py`)
- Agora search adapter → Python client: retrieves with
- Vapi tool server → Vapi search adapter: calls search (evidence: `apps/vapi-moss/server.py`)
- Vapi search adapter → Python client: retrieves with
- LlamaIndex backend → Python client: indexes and queries (evidence: `apps/moss-llamaindex/backend/main.py`)
- Next.js search UI → Moss Cloud: searches through SDK
- VitePress search plugin → Moss Cloud: searches through SDK
