✨ Bounty and developer recommendations
Website
·
Discord
·
Twitter
·
YouTube
·
Issues
Algora uses vector embeddings and LLMs to recommend bounty amounts for GitHub issues.
- System receives GitHub issue URL and fetches details
- Uses vector search to find 10 semantically similar issues with bounty data
- GPT-4o analyzes patterns and generates USD recommendation based on similar issues
- Embeddings
Issues are stored in PostgreSQL with their metadata, content and comments. Vector embeddings are automatically created and managed by pg_vectorize
.
-- priv/repo/migrations/20241107000612_create_issues.exs
SELECT vectorize.table(
job_name => 'issue_search',
"table" => 'issues',
primary_key => 'id',
columns => ARRAY['title', 'body', 'comments_text'],
transformer => 'openai/text-embedding-3-small',
schedule => 'realtime',
update_col => 'updated_at'
);
- Search
We use vector search to find semantically similar issues.
-- lib/algora/workspace.ex
SELECT *
FROM vectorize.search(
job_name => 'issue_search',
query => ?,
return_columns => ARRAY['id'],
num_results => 10
)
- Recommendation
The final recommendation is generated by an LLM that takes a bounty prompt as input.
-- lib/algora/ai.ex
SELECT vectorize.generate(
input => ?,
model => 'openai/gpt-4o'
)
To get a local copy up and running, follow these steps.
- Elixir and Erlang/OTP
- We recommend using asdf to install Elixir and Erlang/OTP.
- Keep in mind that each Elixir version supports specific Erlang/OTP versions.
- Make sure you have at least Elixir 1.12 installed to run Algora AI.
- PostgreSQL
-
Clone the repo and go to the project folder
git clone https://github.com/algora-io/ai.git; cd ai
-
Initialize your
.env
filecp .env.example .env
-
Create a Postgres database with
pg_vectorize
extension installed- Option 1: Use VectorDB Stack on Tembo Cloud
- Option 2: Install pg_vectorize on your own Postgres server
-
Paste your connection string into your
.env
fileDATABASE_URL="postgresql://user:pass@localhost:5432/db"
-
Open a psql shell and set the OpenAI API key
psql <DATABASE_URL>
ALTER SYSTEM SET vectorize.openai_key TO '<your api key>'; SELECT pg_reload_conf();
-
Fetch dependencies, run migrations and build assets
env $(cat .env | xargs -L 1) mix setup
Note: If you're using an Apple machine with an ARM-based chip, you might additionally need to install the Rust compiler and run
mix compile.rambo
-
Start your development server
env $(cat .env | xargs -L 1) iex -S mix phx.server
- Issue content chunking for improved search results
- Pull request data integration for improved recommendations
- Tech stack focused recommendations
- Issue recommendations for new bounties
- Developer recommendations
Distributed under the AGPLv3 License. See LICENSE
for more information.
Special thanks to these amazing projects which help power Algora AI: