> For the complete documentation index, see [llms.txt](https://docs.billybets.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.billybets.ai/technical-architecture.md).

# Technical Architecture

## Architecture

<figure><img src="/files/XMGsMUcWMrbgBiyao3Bt" alt=""><figcaption></figcaption></figure>

Billy Bets has been built utilizing a combination of the [Eliza framework](https://elizaos.github.io/eliza/) and proprietary coding. This allows Billy Bets to operates as a fully autonomous agent which leverages advanced AI models, bespoke sports datasets, and intelligent social interaction capabilities. This technical overview details the core components and their interactions.

## Character

The Billy Bets character has been hand crafted to replicate the personality of top sports betting personalities, both real and fictional. The agent is able to pull from a number of pop-culture and sports references to provide a geniunely entertaining personality with sacrastic wit, allthewhile providing deep sports analysis.&#x20;

## Model

Billy Bets leverages multiple state-of-the-art AI models including Anthropic’s Claude 3.5, OpenAI’s ChatGPT 4o, Meta's LLaMA 3.2, and Perplexity for different specialized functions. Each model serves specific purposes within the system, from content generation to complex decision-making processes.

This has been fine-tuned using a combination of Reinforcement Learning from Human Feedback (RLHF) and supervised training techniques.

**Supervised Fine-Tuning**: Manually curated conversations and replies, emphasizing Billy’s tone and character, is used to train the model. This step is important to ensure that our agent maintains its funny and degenerate style across various interaction scenarios.

**Reinforcement Learning:** A reward-based feedback loop is implemented, where responses are scored based on engagement metrics from X (likes, retweets, comments) to optimize for more engaging content.

## Data

Billy Bets implements a multi-layered data processing system pulling from relevant sources that ensure it to respond in real time with context, relevance and historical knowledge allowing for it to create organic engagement with users.&#x20;

Key integrations include:

* **Sports Data Integration** through Sportsdata.io API with real-time websocket connections
* **Blockchain Oracle Integration** via Polymarket's on-chain APIs
* **Persistent Storage Layer** utilizing Supabase for distributed memory management to support RAG processing.&#x20;
* **Deployment Infrastructure** through Render for scalable service management
* **Daily Betting Intelligence** via the SportsTensor API

## Memory Managment

A sophisticated RAG-based memory architecture has been implmented that allows for:

* Vector-based conversation storage for efficient context retrieval
* Hierarchical user profile management system
* Distributed sports knowledge base with real-time updates
* Context-aware memory pruning and optimization


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.billybets.ai/technical-architecture.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
