Skip to content

Files

Latest commit

 

History

History

fancy-greeter

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

SubQuery AI App Example - Fancy Greeter

Start

  • Read the documentation to see what SubQuery AI can do
  • Install dependencies
    • deno
    • Ollama
    • subql-ai cli - deno install -g -f --allow-env --allow-sys --allow-net --allow-import --allow-read --allow-write --allow-ffi --allow-run --unstable-worker-options --no-prompt -n subql-ai jsr:@subql/ai-app-framework/cli

Editing your app

  • manifest.ts - This file defines key configuration options for your app. Note: This is converted to JSON when publishing.
  • project.ts - This is where the code for your app lives. It registers any tools and your system prompt.

Run your app

There are 2 ways to run your app locally. Both require you having access to an Ollama RPC, if you have a sufficiently powerful computer you can run Ollama locally.

CLI

To start your app: subql-ai -p ./manifest.ts

To chat with your app using a cli, in another terminal you can run subql-ai repl

Docker Compose

To run your project in docker there is a provided docker-compose.yml file. This will start your app as well as a simple chat web UI.

To start everything: docker compose up.

To use the web UI, head to http://localhost:8080 and create a new chat. From the list of models select subql-ai and begin chatting.

Publish your app

Once your app is ready you can publish it to IPFS to distribute it. This will bundle up the code and any vector data and upload it to IPFS. Then the app can be run from IPFS

subql-ai publish -p ./manifest.ts

Rebuilding the DB

Because the docs change regularly you can rebuild the db with the following command. You just need to update the input path to a locally checked out version of https://github.com/subquery/documentation

subql-ai embed-mdx -i /path/to/subql/documentation -o db -t subql-docs --overwrite=true