This project demonstrates how to run the AgentQL Python SDK in a Docker container, using MongoDB for storing basic inputs and outputs. It showcases the power of AgentQL for painless data extraction and web automation.
- Project Overview
- What is AgentQL?
- Project Structure
- Prerequisites
- Getting Started
- Services
- Environment Variables
- API Endpoints
- Additional Resources
- Main Application: Runs the AgentQL Python SDK
- Database: MongoDB for storing inputs and outputs
- Admin Interface: MongoDB Express for database management
AgentQL is an AI-powered tool that allows you to extract data and automate web interactions using natural language queries instead of fragile XPath or DOM selectors. It's designed to be robust, adapting to changes in website structures automatically.
Key features of AgentQL include:
- Semantic selectors
- Natural language queries
- Controlled output
- Deterministic results
The project uses Docker Compose to orchestrate the following services:
app
: The main application service running AgentQL Python SDKmongodb
: The MongoDB database servicemongo-express
: A web-based MongoDB admin interface
- Docker
- Docker Compose
-
Clone the repository:
git clone <repository-url> cd <project-directory>
-
Set up environment variables:
cp .env.example .env
Open the
.env
file and update theAGENTQL_API_KEY
with your own API key:AGENTQL_API_KEY=your_actual_api_key_here
-
Build and start the services:
docker-compose up
-
Access the application at
http://localhost:8000
-
Access the MongoDB Express admin interface at
http://localhost:8081
- Username:
admin
- Password:
pass
- Username:
- Built from the Dockerfile in the project root
- Runs the AgentQL Python SDK
- Source code is mounted from
./app
directory - Runs on port 8000
- Uses the latest MongoDB image
- Stores basic inputs and outputs from the AgentQL SDK
- Data is persisted in a named volume
mongodb_data
- Runs on port 27017
- Web-based MongoDB admin interface
- Runs on port 8081
- Default login credentials:
- Username:
admin
- Password:
pass
- Username:
The project uses a .env
file for configuration. Make sure the following variables are set up:
AGENTQL_API_KEY
: Your AgentQL API keyMONGODB_URI
: Set automatically in the docker-compose file- Add any additional AgentQL SDK specific environment variables
Remember to never commit your .env
file with sensitive information to version control.
- Method: POST
- Description: Ingests a URL for processing
- Request body:
curl --location 'localhost:8000/ingest' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://centrifuge.mirror.xyz/wQGnnIo89V0C1jIWvUcGGEQixrou5BjcZijjxQPNBlo"
}'
/process
endpoint:
curl --location 'localhost:8000/process'
This project is licensed under the MIT License. See the LICENSE
file for more details.
Built with ❤️ by aeksco