Skip to content

Commit eaaeb6e

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents ff643dd + 27027ba commit eaaeb6e

File tree

129 files changed

+18608
-207
lines changed

Some content is hidden

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

129 files changed

+18608
-207
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
workspace.code-workspace
12
.vscode
23
crewai
34
.cache
@@ -66,4 +67,6 @@ agents/praisonaiagents/build
6667
agents/praisonaiagents/dist
6768
agents/praisonaiagents/praisonaiagents.egg-info
6869
.codegpt
69-
.praison
70+
.praison
71+
# Local Netlify folder
72+
.netlify

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM python:3.11-slim
22
WORKDIR /app
33
COPY . .
4-
RUN pip install flask praisonai==2.0.76 gunicorn markdown
4+
RUN pip install flask praisonai==2.0.81 gunicorn markdown
55
EXPOSE 8080
66
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]

docs/api/praisonai/deploy.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ <h2 id="raises">Raises</h2>
110110
file.write(&#34;FROM python:3.11-slim\n&#34;)
111111
file.write(&#34;WORKDIR /app\n&#34;)
112112
file.write(&#34;COPY . .\n&#34;)
113-
file.write(&#34;RUN pip install flask praisonai==2.0.76 gunicorn markdown\n&#34;)
113+
file.write(&#34;RUN pip install flask praisonai==2.0.81 gunicorn markdown\n&#34;)
114114
file.write(&#34;EXPOSE 8080\n&#34;)
115115
file.write(&#39;CMD [&#34;gunicorn&#34;, &#34;-b&#34;, &#34;0.0.0.0:8080&#34;, &#34;api:app&#34;]\n&#39;)
116116

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: "Introduction to AI Agents"
3+
description: "Welcome to the beginner's course on AI Agents"
4+
icon: "book-open"
5+
---
6+
7+
# Introduction to AI Agents
8+
9+
Welcome to the beginners' course on AI Agents! This course is designed to help you understand and build your own AI agents, even if you have little to no programming experience.
10+
11+
## What Are AI Agents?
12+
13+
An AI agent is a software program that can:
14+
- Understand information from its environment
15+
- Make decisions based on that information
16+
- Take actions to achieve specific goals
17+
18+
Think of an AI agent like a helpful assistant that can perform tasks for you automatically.
19+
20+
```mermaid
21+
graph TD
22+
A[Perceive Information] --> B[Make Decisions]
23+
B --> C[Take Actions]
24+
C --> A
25+
```
26+
27+
## Examples in Daily Life
28+
29+
You might already be using AI agents without realizing it:
30+
31+
- **Virtual Assistants**: Siri, Alexa, and Google Assistant are AI agents that respond to your voice commands
32+
- **Recommendation Systems**: Netflix, YouTube, and Amazon use AI agents to suggest content you might like
33+
- **Smart Home Devices**: Devices that adjust temperature or lighting based on your preferences
34+
35+
## What You'll Learn in This Course
36+
37+
Throughout this course, you will:
38+
39+
1. Understand the basic concepts of AI agents
40+
2. Learn about different types of AI agents
41+
3. Explore how AI agents make decisions
42+
4. Discover how to build simple AI agents without complex programming
43+
5. Create your own functional AI agents
44+
45+
## Who This Course Is For
46+
47+
This course is perfect for:
48+
- Complete beginners with no prior knowledge of AI
49+
- Non-technical professionals interested in how AI can solve problems
50+
- Students curious about artificial intelligence
51+
- Anyone who wants to understand and use AI agents in practical ways
52+
53+
Let's begin our journey into the fascinating world of AI agents!
54+
<iframe
55+
id="codeExecutionFrame"
56+
src="https://code-execution-server-praisonai.replit.app/?code=import%20openai%0A%0Aclient%20%3D%20openai.OpenAI()%0Aresult%20%3D%20client.chat.completions.create(%0A%20%20%20%20model%3D%22gpt-3.5-turbo%22%2C%0A%20%20%20%20messages%3D%5B%0A%20%20%20%20%20%20%20%20%7B%22role%22%3A%20%22user%22%2C%20%22content%22%3A%20%22Hello%20World%22%7D%0A%20%20%20%20%5D%0A)%0A%0Aprint(result.choices%5B0%5D.message.content)"
57+
width="100%"
58+
height="600px"
59+
frameborder="0"
60+
allow="clipboard-read; clipboard-write"
61+
scrolling="yes"
62+
onload="resizeIframe(this)"
63+
></iframe>
64+
65+
<IframeWithAutoHeight />
66+
67+
<CardGroup cols={1}>
68+
<Card title="Ready to Start?" icon="rocket">
69+
Continue to the next lesson to learn about the different types of AI agents.
70+
</Card>
71+
</CardGroup>
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: "Types of AI Agents"
3+
description: "Understanding the different categories of AI agents"
4+
icon: "sitemap"
5+
---
6+
7+
# Types of AI Agents
8+
9+
AI agents come in different forms, each designed for specific purposes and with varying levels of complexity. Understanding these types will help you choose the right approach for your needs.
10+
11+
## Simple Reflex Agents
12+
13+
These are the most basic type of AI agents that operate using simple if-then rules.
14+
15+
<CardGroup cols={1}>
16+
<Card title="Key Characteristics" icon="lightbulb">
17+
- React directly to current input only
18+
- No memory of past events
19+
- No prediction of future states
20+
- Use predefined rules to determine actions
21+
</Card>
22+
</CardGroup>
23+
24+
**Real-world example**: A basic thermostat that turns heating on when temperature drops below a set point.
25+
26+
```mermaid
27+
graph LR
28+
A[Sensor Input] --> B{If-Then Rules}
29+
B --> C[Action]
30+
```
31+
32+
## Model-Based Agents
33+
34+
These agents maintain an internal model of their environment to make better decisions.
35+
36+
<CardGroup cols={1}>
37+
<Card title="Key Characteristics" icon="brain">
38+
- Build and maintain an internal representation of the world
39+
- Can work with partial information
40+
- Can consider "what if" scenarios
41+
- Make decisions based on their understanding of how the world works
42+
</Card>
43+
</CardGroup>
44+
45+
**Real-world example**: A GPS navigation system that models roads and traffic conditions.
46+
47+
## Goal-Based Agents
48+
49+
These agents make decisions based on how their actions will help achieve specific goals.
50+
51+
<CardGroup cols={1}>
52+
<Card title="Key Characteristics" icon="bullseye">
53+
- Consider future consequences of actions
54+
- Evaluate which actions will lead toward goals
55+
- Can plan sequences of actions
56+
- Choose actions that maximize goal attainment
57+
</Card>
58+
</CardGroup>
59+
60+
**Real-world example**: A chess-playing AI that plans moves to achieve checkmate.
61+
62+
## Utility-Based Agents
63+
64+
These agents choose actions that maximize a specific utility (or happiness) function.
65+
66+
<CardGroup cols={1}>
67+
<Card title="Key Characteristics" icon="chart-line">
68+
- Assign a utility value to different possible outcomes
69+
- Consider probability and risk
70+
- Choose actions that maximize expected utility
71+
- Can balance competing objectives
72+
</Card>
73+
</CardGroup>
74+
75+
**Real-world example**: An investment robo-advisor that balances risk and return.
76+
77+
## Learning Agents
78+
79+
These agents improve their performance over time through experience.
80+
81+
<CardGroup cols={1}>
82+
<Card title="Key Characteristics" icon="graduation-cap">
83+
- Learn from past experiences
84+
- Adapt to changing environments
85+
- Improve decision-making over time
86+
- Can discover new strategies
87+
</Card>
88+
</CardGroup>
89+
90+
**Real-world example**: Recommendation systems that learn your preferences over time.
91+
92+
## Understanding Agent Complexity
93+
94+
<Tip>
95+
As you move from Simple Reflex Agents toward Learning Agents, both capability and complexity increase. For beginners, starting with simpler agent types is often best.
96+
</Tip>
97+
98+
## Which Agent Type Should You Build?
99+
100+
The best type of agent for your project depends on:
101+
102+
1. **The problem complexity**: Simple problems may only need reflex agents
103+
2. **Available data**: Learning agents need training data
104+
3. **Required adaptability**: Will your agent need to adapt to new situations?
105+
4. **Available resources**: More complex agents require more computational power
106+
107+
In this course, we'll focus primarily on goal-based and simple learning agents as they provide a good balance of capability and complexity for beginners.
108+
109+
<CardGroup cols={1}>
110+
<Card title="Next Steps" icon="arrow-right">
111+
In the next lesson, we'll explore how agents process information and make decisions.
112+
</Card>
113+
</CardGroup>
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
---
2+
title: "Agent Architecture"
3+
description: "Understanding how AI agents are structured"
4+
icon: "layer-group"
5+
---
6+
7+
# Agent Architecture
8+
9+
Understanding how AI agents are structured will help you build more effective agents. This lesson covers the fundamental components of an agent's architecture.
10+
11+
## Basic Components of an AI Agent
12+
13+
Every AI agent, regardless of complexity, has these basic components:
14+
15+
```mermaid
16+
graph TD
17+
A[Sensors/Input] --> B[Processing Unit]
18+
B --> C[Decision-Making]
19+
C --> D[Actions/Output]
20+
```
21+
22+
### 1. Input (Sensors)
23+
24+
This is how agents receive information from their environment.
25+
26+
<CardGroup cols={1}>
27+
<Card title="Examples of Input" icon="eye">
28+
- Text input from users
29+
- Data from databases
30+
- Image or audio input
31+
- API responses
32+
- Sensor readings (in physical agents)
33+
</Card>
34+
</CardGroup>
35+
36+
### 2. Processing Unit
37+
38+
This component processes information and converts it into a format the agent can understand.
39+
40+
<CardGroup cols={1}>
41+
<Card title="Processing Functions" icon="gears">
42+
- Data cleaning and transformation
43+
- Feature extraction
44+
- Context building
45+
- Information retrieval
46+
- Pattern recognition
47+
</Card>
48+
</CardGroup>
49+
50+
### 3. Decision-Making Core
51+
52+
The "brain" of the agent that determines what actions to take.
53+
54+
<CardGroup cols={1}>
55+
<Card title="Decision Components" icon="brain">
56+
- Language models (like GPT-4)
57+
- Rule systems
58+
- Planning algorithms
59+
- Knowledge base
60+
- Memory systems
61+
</Card>
62+
</CardGroup>
63+
64+
### 4. Output (Actions)
65+
66+
The actions the agent can perform to achieve its goals.
67+
68+
<CardGroup cols={1}>
69+
<Card title="Action Examples" icon="hand">
70+
- Generating text responses
71+
- Creating visual content
72+
- Making API calls
73+
- Controlling other systems
74+
- Updating databases
75+
</Card>
76+
</CardGroup>
77+
78+
## The Agent Loop
79+
80+
Agents operate in a continuous loop:
81+
82+
```mermaid
83+
graph LR
84+
A[Perceive] --> B[Process]
85+
B --> C[Decide]
86+
C --> D[Act]
87+
D --> A
88+
```
89+
90+
This cycle allows agents to continuously:
91+
1. Gather information
92+
2. Update their understanding
93+
3. Make new decisions
94+
4. Take appropriate actions
95+
96+
## PraisonAI Agent Architecture
97+
98+
In the PraisonAI framework, agents follow a specific architecture:
99+
100+
<CardGroup cols={1}>
101+
<Card title="PraisonAI Agent Components" icon="puzzle-piece">
102+
- **Instructions**: Defines the agent's purpose and behavior
103+
- **Language Model**: Powers the agent's intelligence (e.g., GPT-4)
104+
- **Memory**: Stores context and previous interactions
105+
- **Tools**: Specialized capabilities an agent can use
106+
</Card>
107+
</CardGroup>
108+
109+
### Simple Agent Structure
110+
111+
```python
112+
from praisonaiagents import Agent
113+
114+
# Create a simple agent
115+
research_agent = Agent(
116+
instructions="Research the latest developments in renewable energy",
117+
name="ResearchAgent"
118+
)
119+
120+
# Start the agent
121+
research_agent.start()
122+
```
123+
124+
## Understanding Agent Communication
125+
126+
Multi-agent systems allow agents to communicate with each other:
127+
128+
```mermaid
129+
graph LR
130+
A[Agent 1] --> B[Agent 2]
131+
B --> C[Agent 3]
132+
C --> A
133+
```
134+
135+
Each agent can:
136+
- Pass information to other agents
137+
- Request assistance from specialized agents
138+
- Collaborate on complex tasks
139+
140+
## Key Takeaways
141+
142+
<CardGroup cols={2}>
143+
<Card title="Component Importance" icon="check">
144+
Each component plays a vital role in the agent's functionality
145+
</Card>
146+
<Card title="Agent Customization" icon="gear">
147+
You can customize each component based on your specific needs
148+
</Card>
149+
<Card title="Component Balance" icon="scale-balanced">
150+
A well-designed agent balances all components effectively
151+
</Card>
152+
<Card title="Continuous Improvement" icon="arrow-trend-up">
153+
Agents can be improved by enhancing individual components
154+
</Card>
155+
</CardGroup>
156+
157+
In the next lesson, we'll explore how to define effective instructions for your AI agents.

0 commit comments

Comments
 (0)