| Crates.io | alfred-core |
| lib.rs | alfred-core |
| version | 0.1.9 |
| created_at | 2024-12-29 23:37:47.832809+00 |
| updated_at | 2025-01-03 16:47:09.490764+00 |
| description | Alfred Rust Library |
| homepage | |
| repository | https://github.com/PaoloPana/alfred-rs |
| max_upload_size | |
| id | 1498658 |
| size | 123,651 |
DISCLAIMER: This documentation is a work-in-progress.
Alfred is the simplest way to create your own AI agent with a modular structure!
If you need to install Alfred as typical user (no code changes needed), you have to follow this section. Instead, if you need to work on a specific module (or to help us to improve this library), follow this document.
IMPORTANT: if you already have a running installation, back-up the configuration files before running the following commands!
curl -L https://github.com/PaoloPana/alfred-rs/raw/refs/heads/main/scripts/install-alfred.sh | sh
https://github.com/PaoloPana/alfred-ai-callback
https://github.com/PaoloPana/alfred-audio-out
https://github.com/PaoloPana/alfred-console
https://github.com/PaoloPana/alfred-homeassistant
https://github.com/PaoloPana/alfred-idroid01
https://github.com/PaoloPana/alfred-ledmatrix
https://github.com/PaoloPana/alfred-mic
https://github.com/PaoloPana/alfred-openai
https://github.com/PaoloPana/alfred-telegram
https://github.com/PaoloPana/alfred-wake-word
The best way to explain this idea is with an example: there is the core daemon (LINK TO DAEMON) which creates the base connections between modules. Let's suppose to create a simple chat bot which replies to text questions. In this case, we will execute the following modules:
[[routing]]
from_topic = "event.telegram.new_incoming_message"
to_topic = "chat"
sequenceDiagram
actor u as User
participant t as telegram
participant r as Routing
participant c as OpenAI Chat
participant a as Alfred Core
Note over t,a: Starting phase
r-->>a: subscribe to "event.telegram.new_incoming_message"
t-->>a: subscribe to "telegram"
c-->>a: subscribe to "chat"
Note over u,a: User interaction
u->>t: Telegram message
t->>a: publish on topic "event.telegram.new_incoming_message"
a-->>r: receive on topic "event.telegram.new_incoming_message"
r->>a: publish on topic "chat"
a-->>c: receive on topic "chat"
activate c
c->>a: publish on topic "telegram"
deactivate c
a-->>t: receive on topic "telegram"
t->>u: Response
flowchart TB
user((User)) -- (1) says 'Alfred' --> wake-word
wake-word -- (2) send msg to topic 'mic' --> mic
mic -- (3) recording user request --> mic
user -- (4) ask the request --> mic
mic -- (5) send recorded audio to topic 'stt' --> stt
stt -- (6) analysing using openai API --> stt
stt -- (7) send user input as text to topic 'openai' --> openai
openai -- (8) replying using openai API --> openai
openai -- (9) send response text to topic 'tts' --> tts
tts -- (10) TTS using openai API --> tts
tts -- (11) send audio file to topic 'audio-out' --> audio-out
audio-out -- (12) playing audio --> user