An open API service indexing awesome lists of open source software.

https://github.com/statespace-tech/statespace

Interactive web apps for AI agents
https://github.com/statespace-tech/statespace

agent analytics artificial-intelligence context-engineering data-engineering data-science database information-retrieval machine-learning markdown mcp rust sql webapp

Last synced: 28 days ago
JSON representation

Interactive web apps for AI agents

Awesome Lists containing this project

README

          



Statespace

# Statespace

**Turn your data into shareable LLM apps in minutes. All in pure Markdown. Zero boilerplate.**

[![Test Suite](https://github.com/statespace-tech/statespace/actions/workflows/test.yml/badge.svg)](https://github.com/statespace-tech/statespace/actions/workflows/test.yml)
[![License](https://img.shields.io/badge/license-MIT-007ec6?style=flat-square)](https://github.com/statespace-tech/statespace/blob/main/LICENSE)
[![Discord](https://img.shields.io/discord/1323415085011701870?label=Discord&logo=discord&logoColor=white&color=5865F2&style=flat-square)](https://discord.gg/rRyM7zkZTf)
[![X](https://img.shields.io/badge/Statespace-black?style=flat-square&logo=x&logoColor=white)](https://x.com/statespace_tech)

---

**Documentation: [docs.statespace.com](https://docs.statespace.com/)**

**Source code: [https://github.com/statespace-tech/statespace](https://github.com/statespace-tech/statespace)**

---

_Statespace is a declarative framework for building modular LLM applications in Markdown._

## Installation

Install the CLI:

```bash
curl -fsSL https://statespace.com/install.sh | bash
```

## Example

### Create it

Start with one file: `README.md`

```yaml
---
tools:
- [date]
---

# Instructions
- Run `date` to check today's date
```

### Serve it

Run your app locally (no account required):

```bash
statespace serve .
```

> **Note**: Runs on `http://127.0.0.1:8000`

### Ask it

Include the app URL in your prompts:

Claude Code

```bash
claude "Get today's date from http://127.0.0.1:8000"
```

GitHub Copilot

```bash
copilot "Get today's date from http://127.0.0.1:8000"
```

Codex

```bash
codex "Get today's date from http://127.0.0.1:8000"
```

For custom agents, add an HTTP request tool:

TypeScript

```typescript
import { execFileSync } from 'child_process';

/**
* Execute curl commands to interact with Statespace apps.
*/
function curlTool(url: string, args: string[]): string {
const result = execFileSync('curl', [...args, url], {
encoding: 'utf-8'
});
return result.toString();
}
```

Rust

```rust
use std::process::Command;

/// Execute curl commands to interact with HTTP endpoints.
fn curl_tool(url: &str, args: Vec<&str>) -> String {
let output = Command::new("curl")
.args(&args)
.arg(url)
.output()
.unwrap();
String::from_utf8_lossy(&output.stdout).to_string()
}
```

## Complex example

### Upgrade it

Your app can grow into a full project:

```bash
project/
├── README.md
├── data/
│ ├── log1.txt
│ ├── log2.txt
│ └── log3.txt
└── src/
├── agentic_rag.md
├── text2sql.md
└── vector_search.md

3 directories, 9 files
```

Update `README.md` with CLI tools to progressively discover and read other files:

```yaml
---
tools:
- [date]
- [ls]
- [cat]
---

# Instructions
- Run `date` to check today's date
- Use `ls` and `cat` to discover and read other files
```

### Compose it

Add pages and CLI tools for different workflows:

Vector Search

```yaml
---
tools:
- [curl, -X, POST, https://host.pinecone.io/records/namespaces/user/search]
---

# Vector search instructions:
- Query documents with your vector database API
```

> **Note**: replace the API with your own (e.g., Pinecone, Weaviate, Qdrant)

Text-to-SQL

```yaml
---
tools:
- [psql, -U, $USER, -d, $DB, -c, { regex: "^SELECT\b.*" }]
---

# Text-to-SQL instructions:
- Use `psql` for read-only PostgreSQL queries
```

> **Note**: use your own database CLI (e.g., `mysql`, `sqlite3`, `mongosh`).

Agentic RAG

```yaml
---
tools:
- [grep, -r, -i, { }, ../data/]
---

# Document search instructions:
- Use `grep` to search documents in `../data/`
```

> **Note**: apps can include any file type (e.g. `.csv`, `.sqlite`, `.json`)

### Deploy it

Create a free [Statespace account](https://statespace.com/) to deploy authenticated private apps:

```bash
statespace app create . --visibility private
```

Alternatively, share public apps with the community:

```bash
statespace app create . --visibility public
```

> **Note** Statespace gives you app URLs you can paste in prompts and instructions.

## Community & Contributing

- **Discord**: Join our [community server](https://discord.gg/rRyM7zkZTf) for real-time help and discussions
- **X**: Follow us [@statespace_tech](https://x.com/statespace_tech) for updates and news
- **Issues**: Report bugs or request features on [GitHub Issues](https://github.com/statespace-tech/statespace/issues)

## License

This project is licensed under the terms of the MIT license.