This is a demo application to show how to implement OpenAI's GPT API into a PHP Symfony application, training the AI with some documents via embeddings to give it some custom knowledge and context, and long-term memory.
This is a work-in-progress.
To start working,
- Clone this repo locally:
git clone [email protected]:obokaman-com/php-ai.git
- Copy
.env
into.env.local
and complete with your OpenAI API Key.
cd php-ai && cp .env .env.local
- Install all dependencies
composer install
- Put any required documents in
/public/docs_to_ingest
folder (now only works with PDFs) - Ingest them into memory:
bin/console memory:ingest
- Ask a question:
bin/console ai:question
For interactive question, or
bin/console ai:question --question "My question"
For direct questioning the AI.