Prerequisites
- Python 3.11 or higher
- pip (Python package installer)
Installation
1
Install SmartGraph
First, let’s install SmartGraph and its dependencies. Open your terminal and run:
2
Set Up Your Environment
Create a new directory for your project and navigate into it:Create a new file called Replace
.env
in this directory and add your OpenAI API key:your_api_key_here
with your actual OpenAI API key.3
Create Your First SmartGraph Application
Create a new file called This script sets up a simple AI assistant that can answer questions and perform web searches when needed.
app.py
and add the following code:4
Run Your Application
Now, let’s run your SmartGraph application:You should see a prompt asking you to input a question. Try asking various questions, including some that might require a web search.Example interaction:
What’s Next?
Congratulations! You’ve just created your first SmartGraph application. This simple example demonstrates the power of SmartGraph in creating reactive, AI-powered applications. To learn more and expand your SmartGraph skills, check out these resources:Core Concepts
Understand the fundamental building blocks of SmartGraph
Pipelines and Branching
Learn how to create more complex workflows
AI Assistants
Dive deeper into creating sophisticated AI assistants
Custom Components
Extend SmartGraph’s functionality with your own components