Skip to content

Commit

Permalink
Merge pull request #303 from MervinPraison/develop
Browse files Browse the repository at this point in the history
Refactor documentation and enhance quickstart guide for PraisonAI
  • Loading branch information
MervinPraison authored Jan 16, 2025
2 parents a95f0c6 + ff16cfe commit f0afa7e
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 31 deletions.
2 changes: 1 addition & 1 deletion docs/concepts/knowledge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ flowchart LR
end
subgraph Router[Vector Store]
DB[(Chroma)]
DB[(Vector DB)]
end
subgraph Out[Agents]
Expand Down
39 changes: 13 additions & 26 deletions docs/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ icon: "book-open"

## What is PraisonAI?

<Note>
PraisonAI is a powerful Multi-Agent Framework for building and deploying AI agents that can understand, reason, and execute complex tasks autonomously.
</Note>
PraisonAI is a powerful Multi-Agent Framework for building and deploying AI agents that can understand, reason, and execute complex tasks autonomously.
<CardGroup cols={1}>
<Card title="Welcome to PraisonAI" icon="wand-magic-sparkles">
Build powerful autonomous agents that understand, decide, and execute with unprecedented capability.
Expand All @@ -26,45 +24,34 @@ graph LR
Agent2 --> Output([✓ Output])
Process -.-> Agent1
%% Styling for main elements
style Start fill:#2D3047,stroke:#7C90A0,color:#fff
style Output fill:#2D3047,stroke:#7C90A0,color:#fff
style Process fill:#5C80BC,stroke:#7C90A0,color:#fff
%% Define subgraphs for agents and their tasks
subgraph Agent1[" "]
subgraph Agent1[ ]
Task1[📋 Task]
AgentIcon1[🤖 AI Agent]
Tools1[🔧 Tools]
Task1 --- AgentIcon1
AgentIcon1 --- Tools1
style Task1 fill:#2D3047,stroke:#7C90A0,color:#fff
style AgentIcon1 fill:#5C80BC,stroke:#7C90A0,color:#fff
style Tools1 fill:#2D3047,stroke:#7C90A0,color:#fff
end
subgraph Agent2[" "]
subgraph Agent2[ ]
Task2[📋 Task]
AgentIcon2[🤖 AI Agent]
Tools2[🔧 Tools]
Task2 --- AgentIcon2
AgentIcon2 --- Tools2
style Task2 fill:#2D3047,stroke:#7C90A0,color:#fff
style AgentIcon2 fill:#5C80BC,stroke:#7C90A0,color:#fff
style Tools2 fill:#2D3047,stroke:#7C90A0,color:#fff
end
%% Style for agent containers
style Agent1 fill:#1B1F3B,stroke:#7C90A0,color:#fff
style Agent2 fill:#1B1F3B,stroke:#7C90A0,color:#fff
%% Global styles
classDef default fill:#2D3047,stroke:#7C90A0,color:#fff
linkStyle default stroke:#7C90A0,stroke-width:2px
classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
classDef tools fill:#2E8B57,stroke:#7C90A0,color:#fff
classDef transparent fill:none,stroke:none
class Start,Output,Task1,Task2 input
class Process,AgentIcon1,AgentIcon2 process
class Tools1,Tools2 tools
class Agent1,Agent2 transparent
```
<br />
<CardGroup cols={2}>
Expand Down
142 changes: 138 additions & 4 deletions docs/quickstart.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,143 @@
---
title: Quick Start
description: Build your first AI agent with PraisonAI
icon: bolt
title: "Quick Start"
description: "Create AI Agents and make them work for you in just a few lines of code."
icon: "bolt"
---

# Basic

<Tabs>
<Tab title="Code">
<Steps>
<Step title="Install Package">
Install the PraisonAI Agents package:
```bash
pip install praisonaiagents
```
</Step>

<Step title="Set API Key">
```bash
export OPENAI_API_KEY=your_openai_key
```
Generate your OpenAI API key from [OpenAI](https://platform.openai.com/api-keys).
Use other LLM providers like Ollama, Anthropic, Groq, Google, etc. Please refer to the [Models](/models) for more information.
</Step>

<Step title="Create Agents">
Create `app.py`:
<CodeGroup>
```python Single Agent
from praisonaiagents import Agent, PraisonAIAgents

# Create a simple agent
summarise_agent = Agent(instructions="Summarise Photosynthesis")

# Run the agent
agents = PraisonAIAgents(agents=[summarise_agent])
agents.start()
```

```python Multiple Agents
from praisonaiagents import Agent, PraisonAIAgents

# Create agents with specific roles
diet_agent = Agent(
instructions="Give me 5 healthy food recipes",
)

blog_agent = Agent(
instructions="Write a blog post about the food recipes",
)

# Run multiple agents
agents = PraisonAIAgents(agents=[diet_agent, blog_agent])
agents.start()
```
</CodeGroup>
</Step>

<Step title="Run Agents">
Execute your script:
```bash
python app.py
```

You'll see:
- Agent initialization
- Task execution progress
- Final results

<Tip>
You have successfully CreatedAI Agents and made them work for you!
</Tip>
</Step>
</Steps>
</Tab>
<Tab title="No Code">
<Steps>
<Step title="Install Package">
Install the No Code PraisonAI Package:
```bash
pip install praisonaiagents
```
</Step>

<Step title="Set API Key">
```bash
export OPENAI_API_KEY=your_openai_key
```
</Step>

<Step title="Create Config">
Create `agents.yaml`:

<CodeGroup>
```yaml Single Agent
roles:
summarise_agent:
instructions: Summarise Photosynthesis
```
```yaml Multiple Agents
roles:
diet_agent:
instructions: Give me 5 healthy food recipes
blog_agent:
instructions: Write a blog post about the food recipes
```
</CodeGroup>
<Note>
You can automatically create `agents.yaml` using:
```bash
praisonai --init "your task description"
```
</Note>

</Step>

<Step title="Run Agents">
Execute your config:
```bash
praisonai agents.yaml
```
</Step>
</Steps>
</Tab>
</Tabs>

<Note>
**Prerequisites**
- Python 3.10 or higher
- OpenAI API key (get it [here](https://platform.openai.com/api-keys))
- For other LLM providers, see [Models](/models)
</Note>

# Advanced

## Providing Detailed Tasks to Agents (Optional)

<Tabs>
<Tab title="Code">
<Steps>
Expand Down Expand Up @@ -180,7 +314,7 @@ praisonai --init create movie script about cat in mars
</Tabs>


## Creating Custom Tool for Agents
## Creating Custom Tool for Agents (Optional)

<Info>
Tools makes the Agent powerful.
Expand Down

0 comments on commit f0afa7e

Please sign in to comment.