Skip to content

Commit 6324290

Browse files
authored
Merge branch 'main' into new-consensus
2 parents a8ad9bb + ec163e8 commit 6324290

File tree

102 files changed

+10259
-1701
lines changed

Some content is hidden

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

102 files changed

+10259
-1701
lines changed

.dockerignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Envs
2+
.venv
3+
.venv*/
4+
.env
5+
.env.*
6+
.ruff_cache
7+
.pytest_cache
8+
.vscode
9+
.DS_Store
10+
11+
# Python-generated files
12+
__pycache__/
13+
*.py[oc]
14+
build/
15+
dist/
16+
wheels/
17+
*.egg-info
18+
19+
# Other folders
20+
docs/
21+
examples/
22+
tests/

.env.example

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ AGENT__GEMINI_API_KEY="your_api_key"
5757
# --- Network Connection ---
5858

5959
# Flare RPC endpoint URL.
60-
# ECOSYSTEM__WEB3_PROVIDER_URL=https://stylish-light-theorem.flare-mainnet.quiknode.pro/ext/bc/C/rpc
60+
ECOSYSTEM__WEB3_PROVIDER_URL=https://stylish-light-theorem.flare-mainnet.quiknode.pro/ext/bc/C/rpc
6161
# Example for Coston2 testnet:
6262
# ECOSYSTEM__WEB3_PROVIDER_URL=https://coston2-api.flare.network/ext/C/rpc
6363

@@ -116,7 +116,7 @@ AGENT__GEMINI_API_KEY="your_api_key"
116116
# VECTOR_DB__QDRANT_URL=
117117

118118
# Dimension of vectors to use.
119-
# VECTOR_DB__QDRANT_VECTOR_SIZE=768
119+
VECTOR_DB__QDRANT_VECTOR_SIZE=768
120120

121121
# Batch size for upserting points to Qdrant.
122122
# VECTOR_DB__QDRANT_BATCH_SIZE=100
@@ -135,7 +135,7 @@ AGENT__GEMINI_API_KEY="your_api_key"
135135
# --- Graph Database ---
136136

137137
# Connection URI for the Neo4j database.
138-
# GRAPH_DB__NEO4J_URI=neo4j://localhost:7687
138+
GRAPH_DB__NEO4J_URI=neo4j://localhost:7687
139139

140140
# The name of the specific Neo4j database.
141141
# GRAPH_DB__NEO4J_DATABASE=neo4j
@@ -147,7 +147,7 @@ AGENT__GEMINI_API_KEY="your_api_key"
147147
# --- X ---
148148

149149
# API key for X.
150-
# SOCIAL__X_API_KEY=
150+
SOCIAL__X_API_KEY="your_x_api_key"
151151

152152
# API key secret for X.
153153
# SOCIAL__X_API_KEY_SECRET=
@@ -162,13 +162,34 @@ AGENT__GEMINI_API_KEY="your_api_key"
162162

163163
# API key for Telegram.
164164
# SOCIAL__TELEGRAM_API_TOKEN=
165+
# SOCIAL__TELEGRAM_BOT_TOKEN=
166+
# SOCIAL__TELEGRAM_CHAT_ID=
167+
168+
# --- discord ---
169+
170+
#SOCIAL__DISCORD_BOT_TOKEN=
171+
#SOCIAL__DISCORD_GUILD_ID=
172+
#SOCIAL__DISCORD_CHANNEL_ID=
173+
174+
# --- slack ---
175+
#SOCIAL__SLACK_BOT_TOKEN=
176+
#SOCIAL__SLACK_CHANNEL_ID=
177+
178+
# --- farcaster ---
179+
# SOCIAL__FARCASTER_API_KEY=
180+
# SOCIAL__FARCASTER_API_URL=
181+
# SOCIAL__FARCASTER_SIGNER_UUID=
182+
183+
# --- GITHUB ---
184+
# SOCIAL__GITHUB_TOKEN =
185+
# SOCIAL__GITHUB_REPO =
165186

166187
# ==============================================================================
167188
# TRUSTED EXECUTION ENVIRONMENT (TEE)
168189
# ==============================================================================
169190

170191
# Use a pregenerated attestation token for testing.
171-
# TEE__SIMULATE_ATTESTATION_TOKEN=true
192+
TEE__SIMULATE_ATTESTATION_TOKEN=true
172193

173194
# ==============================================================================
174195
# DATA INGESTION
@@ -177,7 +198,7 @@ AGENT__GEMINI_API_KEY="your_api_key"
177198
# --- Ingestion Embedding ---
178199

179200
# Target size for text chunks before embedding (in characters).
180-
# INGESTION__CHUNK_SIZE=5000
201+
INGESTION__CHUNK_SIZE=5000
181202

182203
# Overlap between consecutive text chunks (in characters).
183204
# INGESTION__CHUNK_OVERLAP=500

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @dineshpinto

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for uv
4+
- package-ecosystem: "uv"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
groups:
9+
uv-all:
10+
patterns:
11+
- "*"
12+
# Enable version updates for GitHub Actions
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
schedule:
16+
interval: "weekly"
17+
groups:
18+
actions-all:
19+
patterns:
20+
- "*"

.github/workflows/lint.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: ["main"]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
lint:
1114
runs-on: "ubuntu-latest"
@@ -15,7 +18,7 @@ jobs:
1518

1619
# Set up Python environment
1720
- name: Set up uv
18-
uses: astral-sh/setup-uv@v5
21+
uses: astral-sh/setup-uv@v6
1922
with:
2023
version: "latest"
2124

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: ["main"]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
test:
1114
runs-on: "ubuntu-latest"
@@ -27,14 +30,15 @@ jobs:
2730
SOCIAL__X_ACCESS_TOKEN_SECRET: "your_secret_twitter_key"
2831
SOCIAL__TELEGRAM_API_TOKEN: "your_secret_telegram_token"
2932
TEE__SIMULATE_ATTESTATION_TOKEN: true
33+
INGESTION__CHUNK_SIZE: 5000
3034

3135
steps:
3236
- name: Checkout repository
3337
uses: actions/checkout@v4
3438

3539
# Set up Python environment
3640
- name: Set up uv
37-
uses: astral-sh/setup-uv@v5
41+
uses: astral-sh/setup-uv@v6
3842
with:
3943
version: "latest"
4044

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ wheels/
88

99
# Virtual environments
1010
.venv
11+
.venv*/
1112
.env
1213
.ruff_cache
1314
.pytest_cache
1415
.vscode
15-
.DS_Store
16+
.DS_Store
17+
18+
19+
# sqlite
20+
*.db

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Add <builder-digest> in prod
2+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
3+
ENV UV_COMPILE_BYTECODE=1 \
4+
UV_LINK_MODE=copy \
5+
UV_PYTHON_DOWNLOADS=0
6+
WORKDIR /app
7+
RUN --mount=type=cache,target=/root/.cache/uv \
8+
--mount=type=bind,source=uv.lock,target=uv.lock \
9+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
10+
uv sync --locked --no-install-project --all-extras --no-dev --no-editable
11+
COPY . /app
12+
RUN --mount=type=cache,target=/root/.cache/uv \
13+
uv sync --locked --all-extras --no-dev --no-editable
14+
RUN rm -rf /root/.cache/uv /root/.cache/pip
15+
16+
# Add <runtime-digest> in prod
17+
FROM python:3.12-slim-bookworm AS runtime
18+
19+
ENV PIP_NO_CACHE_DIR=1 \
20+
UV_PYTHON_DOWNLOADS=0
21+
RUN groupadd -r app && \
22+
useradd -r -g app -d /nonexistent -s /usr/sbin/nologin app
23+
USER app
24+
WORKDIR /app
25+
COPY --from=builder --chown=app:app /app /app
26+
ENV PATH="/app/.venv/bin:$PATH"
27+
CMD ["/app/.venv/bin/flare-ai-kit"]

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ SDK for building **verifiable AI Agents** on Flare using Confidential Space.
1111
1212
## ✨ Features
1313

14-
- **Verifiable Execution:** Run agent logic in a hardware-isolated Trusted Execution Environment (Confidential Space TDX TEEs).
15-
- **Consensus Engine:** Framework for multi-agent collaboration based on the [Consensus Learning](https://arxiv.org/abs/2402.16157) whitepaper.
16-
- **Agent Framework:** Build type-safe agents (PydanticAI) that interact with 200+ LLMs (Gemini, GPT etc.).
17-
- **Flare Integration:** Connect to core protocols ([FTSO](https://dev.flare.network/ftso/overview), [FDC](https://dev.flare.network/fdc/overview), [FAssets](https://dev.flare.network/fassets/overview)) and dApps ([Sceptre](http://sceptre.fi), [SparkDEX](https://sparkdex.ai), [Kinetic](https://kinetic.market) etc.).
18-
- **Social Intelligence:** Connectors & analytics for X, Telegram, and Farcaster.
14+
- **Verifiable Execution**: Run logic in hardwareisolated TEEs - [GCP Confidential Space TDX](https://cloud.google.com/confidential-computing/confidential-space/docs/confidential-space-overview).
15+
- **Consensus Engine**: Multi‑agent [Consensus Learning](https://arxiv.org/abs/2402.16157) via [Google Agent2Agent](https://github.com/a2aproject/A2A) protocol.
16+
- **Strictly‑Typed Agents**: Build with [PydanticAI](https://ai.pydantic.dev) to enforce structured outputs across 200+ LLMs.
17+
- **Flare Protocol Integration**: [FTSO](https://dev.flare.network/ftso/overview), [FDC](https://dev.flare.network/fdc/overview), [FAssets](https://dev.flare.network/fassets/overview), plus ecosystem dApps like [Sceptre](http://sceptre.fi) and [SparkDEX](https://sparkdex.ai).
18+
- **Social Intelligence**: Analytics and connectors for X, Telegram, Farcaster.
1919

2020
## 🏗️ Architecture
2121

0 commit comments

Comments
 (0)