Skip to content

Commit 3e49658

Browse files
The Agent Substrate Seed TeamAlexBulankouBenTheElderboweidberkov
committed
Initial commit of Agent Substrate
This is the initial release of the Agent Substrate. Agent substrate is a system built on top of Kubernetes which manages agent-like workloads to achieve higher scale and efficiency than Kubernetes alone can offer, with lower latency. It builds on top of Kubernetes features like Pods and Pod autoscaling, but takes the Kubernetes control-plane out of the critical path to achieve lower latency. It can run on any Kubernetes cluster and does not inhibit “regular” use of Kubernetes in any way. Kubernetes provides the infrastructure provisioning and management for all types of workloads, while Agent Substrate provides agent-specific scheduling and control. At its core, Agent Substrate maps a larger set of “actors” (applications such as agents) onto a smaller set of ready “workers” (Kubernetes Pods), relying on the fact that agent-like applications tend to be idle most of the time to achieve heavy multiplexing. It provides functionality to manage an actor’s lifecycle (e.g. create/destroy, suspend/resume), to assign actors to workers in real time, and to route incoming traffic to them. Agent Substrate is intended to be a low-opinion system. The workloads it manages don't have to be literal AI agents, but those are the best example of the kind of applications it is designed for. It is not an SDK for building agents, but rather a system for running them at scale. Agent Substrate is currently in VERY early development. It is not ready for production use, and the APIs are almost guaranteed to change. We are not making any guarantees about backward compatibility at this stage, and everything in this project may be changed. Co-authored-by: Alex Bulankou <alexbu@google.com> Co-authored-by: Benjamin Elder <bentheelder@google.com> Co-authored-by: Bowei Du <bowei@google.com> Co-authored-by: Dmitry Berkovich <dberkov@google.com> Co-authored-by: Fabricio Voznika <fvoznika@google.com> Co-authored-by: Francisco Cabrera <fclieutier@google.com> Co-authored-by: Haven Xia <haoyuxia@google.com> Co-authored-by: Julian Gutierrez Oschmann <juliangut@google.com> Co-authored-by: Kevin Steuer <ksteuer@google.com> Co-authored-by: Max Smythe <smythe@google.com> Co-authored-by: Maya Wang <mymaya@google.com> Co-authored-by: Michael Taufen <mtaufen@google.com> Co-authored-by: Shruti Nair <shrutinair@google.com> Co-authored-by: Taahir Ahmed <taahm@google.com> Co-authored-by: Tim Hockin <thockin@google.com> Co-authored-by: Zoe Zhao <zoezhao@google.com>
0 parents  commit 3e49658

491 files changed

Lines changed: 65111 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/agents-md/SKILL.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
name: agents-md
3+
description: Generates or updates an AGENTS.md file
4+
---
5+
6+
Generate or update AGENTS.md files in key folders of the project.
7+
Ensure the target AGENTS.md file accurately reflects the current status of the code.
8+
9+
## Key Requirements
10+
11+
There must always be an AGENTS.md file in the project root.
12+
The AGENTS.md file at the root of the project may include the following sections:
13+
14+
- Project overview
15+
- Build and test commands
16+
- Code style guidelines
17+
- Testing instructions
18+
- Security considerations
19+
20+
AGENTS.md files in subfolders may be even more concise and specific to those subfolders.
21+
22+
## Maximize AGENTS.md Performance
23+
24+
To maximize agent performance and token efficiency, adhere to the following:
25+
26+
### Progressive Disclosure
27+
28+
Each AGENTS.md should be short. Approx. 100-150 lines total.
29+
Link to a handful of relevant, focused reference documents in the same repo, as needed.
30+
31+
### Modularity
32+
33+
While only one AGENTS.md is allowed per folder, you can create an AGENTS.md file in any folder.
34+
Rather than putting everything in the root AGENTS.md, move highly specific advice to AGENTS.md in the most relevant folders of the project.
35+
36+
### References
37+
38+
When documentation that would have helped you is missing, add references in the docs/ folder found at the project root. When these get out of date, update them.
39+
40+
### Workflows
41+
42+
When references describe workflows, the tasks should be described as numbered steps. For example:
43+
44+
1. Get the beep from the boop.
45+
2. Then bop it.
46+
47+
### Decisions
48+
49+
When there are multiple ways of doing something in the codebase, use a decision table like the following:
50+
51+
| Question | Boop | Bop |
52+
| :---- | :---- | :---- |
53+
| Is foo a bar baz? || |
54+
| Is foo a quux? | ||
55+
56+
### Real Code Examples
57+
58+
If you think they are particularly good examples, include snippets from actual code in the repo, up to approx. 10 lines in length.
59+
These should only be the most relevant examples and representative of patterns that would be good to repeat in future code.
60+
Their purpose is to improve code reuse by agents, rather than each agent reinventing the wheel.
61+
62+
### Domain Specific Rules
63+
64+
If you think it would help, you can include a few simple domain specific rules.
65+
Not too many, or agents will get stuck trying to handle too many rules.
66+
A general example of a domain specific rule is "Use a finance-specific numeric type for any financial calculations."
67+
68+
### Don't vs. Do
69+
70+
When adding warnings against doing something, also make a concrete suggestion for the correct approach.
71+
"Don't do X, do Y instead."
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
## Expected Behavior
8+
9+
10+
## Actual Behavior
11+
12+
13+
## Steps to Reproduce the Problem
14+
15+
1.
16+
1.
17+
1.
18+
19+
## Specifications
20+
21+
- Version:
22+
- Platform:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Fixes #<issue_number_goes_here>
2+
3+
> It's a good idea to open an issue first for discussion.
4+
5+
- [ ] Tests pass
6+
- [ ] Appropriate changes to documentation are included in the PR

.github/workflows/pr-workflow.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: pr-workflow
16+
on:
17+
pull_request:
18+
jobs:
19+
run-tests:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
- name: Setup Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version: 1.26
28+
- run: go vet -v ./...
29+
- run: go test -v ./...
30+
- name: verify
31+
run: hack/verify-all.sh
32+
e2e-test:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v3
37+
- name: Setup Go
38+
uses: actions/setup-go@v5
39+
with:
40+
go-version: 1.26
41+
- name: Install kind
42+
run: go install sigs.k8s.io/kind@v0.31.0
43+
- name: Create cluster
44+
run: hack/create-kind-cluster.sh
45+
- name: Install Agent Substrate
46+
run: hack/install-ate-kind.sh --deploy-ate-system
47+
- name: Wait For Ready
48+
run: kubectl wait pod --all --for=condition=Ready --namespace=ate-system --timeout=300s
49+
- name: Deploy Counter Demo
50+
run: hack/install-ate-kind.sh --deploy-demo-counter
51+
- name: Run E2E tests
52+
run: KO_DOCKER_REPO=localhost:5001 BUCKET_NAME=ate-snapshots KUBECTL_CONTEXT=kind-kind hack/run-e2e.sh -v -args -no-color

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Binaries
2+
/ateapi
3+
/substratectl
4+
/kubectl-ate
5+
/atelet
6+
/bin/
7+
8+
# Python
9+
venv/
10+
.venv/
11+
__pycache__/
12+
*.pyc
13+
14+
# Local environment variables
15+
.ate-dev-env.sh

.ko.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
defaultBaseImage: gcr.io/distroless/static-debian11
16+
17+
baseImageOverrides:
18+
github.com/agent-substrate/substrate/demos/sandbox: alpine
19+
github.com/agent-substrate/substrate/demos/agent-secret: alpine

AGENTS.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Agent Substrate
2+
3+
## Project Overview
4+
5+
Agent Substrate is a system built on top of Kubernetes which manages agent-like workloads to achieve higher scale and efficiency than Kubernetes alone can offer, with lower latency.
6+
It takes the Kubernetes control-plane out of the critical path to achieve lower latency by mapping a larger set of “actors” (applications such as agents) onto a smaller set of ready “workers” (Kubernetes Pods).
7+
Agent Substrate relies on the fact that agent-like applications tend to be idle most of the time to achieve heavy multiplexing.
8+
9+
For development, it's recommended to read the `README.md` and `CONTRIBUTING.md` in the root folder.
10+
See `hack/install-ate.sh` and `cmd/setup` for provisioning and deploying clusters and GCP resources.
11+
12+
## Build and Test Commands
13+
14+
Agent Substrate uses a `Makefile` for its build and test tasks.
15+
16+
### Building
17+
- **Binaries**: `make build` (builds images and `kubectl-ate`) or `make build-atectl`
18+
- **Images**: `make build-images` (uses ko to build container images)
19+
- **Demos**: `make build-demos`
20+
21+
### Testing and Verification
22+
- **Run Unit Tests**: `make test`
23+
- **Run E2E Tests**: `make e2e` (Requires GCP cluster setup and built images)
24+
- **Run Linters and Verifiers**: `make verify` (Includes `go vet` and checks for formatting, boilerplate headers, licenses, and go modules)
25+
26+
## Code Style Guidelines
27+
28+
- **Go Formatting**: Code must be formatted with `gofmt`. Run `make fmt` to automatically format all files before submitting changes.
29+
- **Copyright Headers**: All files must contain appropriate copyright and license headers. See templates in `hack/boilerplate/`.
30+
- **Modularity**: Submit small, focused Pull Requests that touch a limited part of the codebase for easier reviews and rebasing.
31+
- **Go Modules**: Ensure `go.mod` is clean. Run `go mod tidy` if adding or removing dependencies.
32+
33+
## Testing Instructions
34+
35+
1. Write tests for all new code. We will not merge code that lacks tests.
36+
2. Ensure changes do not break existing tests.
37+
3. Run `make verify` locally before requesting a code review to catch common issues like missed copyright headers or formatting drift.
38+
4. For end-to-end tests involving the actual infrastructure, ensure you have a running cluster (setup via `hack/ate-dev-env.sh.example` and `go run ./cmd/setup --all`).
39+
40+
## Security Considerations
41+
42+
The security story for Substrate is very early and many features are missing.
43+
However! Take care to respect security best practices when writing code in order to improve Substrate's security over time.
44+
The following is what Substrate currently offers.
45+
Keep this up to date when updating AGENTS.md.
46+
47+
- **Workload Isolation**: The project uses `gVisor` (`runsc`) for sandboxing and security isolation of workloads on pods. A temporary gVisor patch might be required (check the README instructions).
48+
49+
For future plans for security, reference `docs/roadmap.md`.

COLLABORATING.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Collaborating on Agent Substrate
2+
3+
This project is intended to be "very" open. Especially in the early stages, we
4+
do not have a lot of infrastructure in place to manage the repository, so we are
5+
relying on each other to be good collaborators. To that end, here are some
6+
guidelines for collaborating on this project.
7+
8+
## Code of conduct
9+
10+
Please read and internalize our [code of conduct](code-of-conduct.md). We want
11+
this to be a welcoming and inclusive community, and we expect everyone to
12+
adhere to the code of conduct at all times. If you see someone violating the
13+
code of conduct, please report it to the maintainers immediately. We take all
14+
reports seriously and will take appropriate action to address any issues.
15+
16+
Open, direct, honest communication is encouraged, but always be respectful and
17+
professional.
18+
19+
## World-wide community
20+
21+
This project is not limited to one timezone, and we hope to have collaborators
22+
from all over the world. Please be mindful of this at all times.
23+
24+
This project uses English as the primary language for communication. If
25+
English is not your first language, please do not hesitate to ask for
26+
clarification if you do not understand something.
27+
28+
## Written communication
29+
30+
Prefer written communication (PRs, issues, mailing-list) over verbal
31+
communication (e.g. video calls). This allows for people who might not have
32+
been in the conversation to understand why a decision was made the way it was.
33+
34+
When writing, please strive for clarity and conciseness. Not everyone in the
35+
community will have the same proficiency in English, so please be mindful of
36+
that when writing.
37+
38+
## Always use Pull Requests
39+
40+
Do not push directly to the main branch. Always use pull requests to propose
41+
changes to the codebase. This allows for code review and discussion before
42+
changes are merged, which helps maintain the quality of the codebase and
43+
fosters collaboration.
44+
45+
### Merging PRs
46+
47+
PRs should be merged by the reviewer of a PR, not the author.
48+
49+
### Using AI
50+
51+
Using AI tools to assist with coding is allowed, but please be transparent
52+
about it. Regardless of how a PR was created, the _human_ who is offering the
53+
PR is responsible for the content of the PR, and they should be able to explain
54+
the code and answer questions about it. Please be respectful of your
55+
reviewers' time and do not offer PRs that you cannot explain or defend. If you
56+
use an AI tool to generate a significant fraction of a PR, please note that in
57+
the PR comment.
58+
59+
## Code reviews
60+
61+
We want to move quickly, but we need to balance that with quality and
62+
maintainability. Code reviews are an important part of that process. All PRs
63+
should be reviewed BEFORE they are merged.
64+
65+
### Code reviews across companies
66+
67+
As this community grows, we expect to see collaborators from different
68+
companies. Whenever possible, we want to encourage code reviews across
69+
companies. This helps foster collaboration and knowledge sharing across the
70+
community, and it helps prevent silos from forming within the community.
71+
72+
## Working hours
73+
74+
We want to move quickly, but we also want to be respectful of each other's
75+
time. For the sake of consistency, this project's "working hours" are Monday
76+
to Friday, 8am to 8pm, US Pacific Time (GMT-7). Please avoid merging PRs late
77+
at night or on weekends, unless it is an urgent fix. This allows for people to
78+
have a better work-life balance and prevents burnout. If you do need to merge
79+
something outside of normal working hours, please try to give a heads up to the
80+
rest of the community so that they are aware.
81+
82+
## Ownership
83+
84+
As this project grows, we hope to see more and more collaborators. We want to
85+
encourage a culture of ownership, where people demonstrate ownership of various
86+
parts of the codebase - a file, a package, a subsystem. We should all try to
87+
respect each other's ownership, but we must not become territorial. Everyone
88+
should be ready to track an issue or feature across the code as needed.

CONTRIBUTING.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# How to Contribute
2+
3+
We would love to accept your patches and contributions to this project. Before
4+
you spend a lot of time on a contribution, please review the following
5+
guidelines.
6+
7+
## Before you begin
8+
9+
### Sign our Contributor License Agreement
10+
11+
Contributions to this project must be accompanied by a
12+
[Contributor License Agreement](https://cla.developers.google.com/about) (CLA).
13+
You (or your employer) retain the copyright to your contribution; this simply
14+
gives us permission to use and redistribute your contributions as part of the
15+
project.
16+
17+
If you or your current employer have already signed the Google CLA (even if it
18+
was for a different project), you probably don't need to do it again.
19+
20+
Visit <https://cla.developers.google.com/> to see your current agreements or to
21+
sign a new one.
22+
23+
### Review our Community Guidelines
24+
25+
This project follows [Google's Open Source Community
26+
Guidelines](https://opensource.google/conduct/).
27+
28+
## Contribution process
29+
30+
This is a very new project, so we are still working out exactly how it is going
31+
to be developed. For now, we are focused on iterating quickly to find the right
32+
design and architecture. This has implications for contributors:
33+
34+
1) Things are moving quickly, so PRs may need to be rebased or updated
35+
frequently. Small PRs that are focused on a single issue or feature are easier
36+
to review and update than large PRs that touch many different parts of the
37+
codebase.
38+
39+
2) While we welcome new contributors, we are really focused on the minimal
40+
capabilities needed to make this project useful. Before you start a new
41+
contribution, please discuss it with us first (if there is an issue open,
42+
comment there and if not, open one). We want to make sure that your work is
43+
aligned with our near-term goals for the project and that we are not
44+
duplicating work that is already in flight.
45+
46+
3) PRs which are not aligned with our near-term goals may be closed without
47+
extensive review. We are not trying to be discouraging, but we need to make
48+
sure that we are focused on the most important work.
49+
50+
### Code Reviews
51+
52+
All submissions, including submissions by project members, require review. We
53+
use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests)
54+
for this purpose.
55+
56+
All code changes should be accompanied by tests. We will not merge code that
57+
does not have tests, and we will not merge code that causes tests to fail.
58+
59+
### Copyright Headers
60+
61+
Every file containing source code must include copyright and license
62+
information. This includes any JS/CSS files that you might be serving out to
63+
browsers. (This is to help well-intentioned people avoid accidental copying
64+
that doesn't comply with the license.)
65+
66+
Our standard headers for various filetypes can be found in
67+
[./hack/boilerplate](./hack/boilerplate/).

0 commit comments

Comments
 (0)