---
title: "CoMSES AgentSpace / Temporal Native End-to-End Agentic RAG"
description: "Temporal-native agentic RAG system with deep frontend observability into the retrieval process."
canonical: "https://temporal.io/code-exchange/comses-agentspace-temporal-native-end-to-end-agentic-rag.md"
source: "https://temporal.io/code-exchange/comses-agentspace-temporal-native-end-to-end-agentic-rag"
published: "2026-10-08"
authors:
  - "Anton Suharev"
languages:
  - "Python"
reviewed_by_temporal: false
community_contribution: true
---

# CoMSES AgentSpace / Temporal Native End-to-End Agentic RAG

Temporal-native agentic RAG system with deep frontend observability into the retrieval process. A Temporal Workflow orchestrates the agent loop while other Workflows orchestrate hybrid-search, query decomposition, HITL with event-sourced ag-ui streaming.

- [View repo](https://github.com/asuworks/comses-agentspace)

## What it is
**CoMSES AgentSpace** - a fully wired POC of an agentic RAG system over the [CoMSES Computational Model Library](https://www.comses.net/), built for deep observability into the retrieval process: every agent tool is a Temporal Workflow that streams step-level, real-time progress events to the UI.

Researchers ask natural-language questions across model PDFs, source code, and metadata, and the agent answers with paragraph-level citations back to the source material. But a cited answer is only trustworthy if the user can reconstruct *how* it was produced. This is the exactly the problem CoMSES AgentSpace is attempting to solve.

[**5-minute setup & demo**](https://www.youtube.com/watch?v=sfjV-Id7-vg)

## One abstraction, end-to-end

**Temporal Workflow and Activities are the only abstractions in the system.**

Temporal already provides durability, signals, child workflows, replay, and history. So nothing here introduces a competing `Agent` concept:

- **A long-running multi-turn conversation with an `Agent` is a Temporal Workflow - `AgentWorkflow`** - it runs the agent loop: receive message → call LLM → dispatch tools → stream events → wait. 
- **A tool is an activity or a child workflow.** `ActivityToolConfig` for fast, synchronous calls; `WorkflowToolConfig` for long, durable, multi-step ones (`search` - hybrid RAG, `txt2sql`, `list-models`).
- **HITL is a Temporal Signal.** `self.interrupt()` emits `HITL_REQUEST`, the workflow waits on a signal, the user replies, it resumes.
- Outbox publisher, ingestion fan-out, batch processing, PDF page-range conversion - all the same. Built **from** Temporal primitives, not on top of them.

## Screenshots

  | | |
  |---|---|
  | ![list-models](https://raw.githubusercontent.com/asuworks/comses-agentspace/main/assets/list-models-long.jpg) |
  ![steps](https://raw.githubusercontent.com/asuworks/comses-agentspace/main/assets/steps-tab.jpg) |
  | ![popover](https://raw.githubusercontent.com/asuworks/comses-agentspace/main/assets/in-answer-source-popover.jpg) |
  ![sources](https://raw.githubusercontent.com/asuworks/comses-agentspace/main/assets/sources-list-table.jpg) |

## Stack
Temporal Python SDK · Postgres · Qdrant · Redis · MinIO · LiteLLM · FastAPI · React

## Try it

```bash
  git clone https://github.com/asuworks/comses-agentspace
  cd comses-agentspace
# setup infrastructure and configure LLM and embedding providers  
./setup.sh

# start workers and app in another terminal
make w
```

<http://localhost:5173> · ask *"What ant-foraging models are in the library, and how do they differ?"*

**Status:** POC. MIT (caveat: the library used for pdf conversion - `marker-pdf` is GPL-3.0)
