Giter Club home page Giter Club logo

blockoli's Introduction

blockoli logo

blockoli πŸ₯¦πŸ”Ž

Blockoli is a high-performance tool for code indexing, embedding generation and semantic search tool for use with LLMs. blockoli is built in Rust and uses the ASTerisk crate for semantic code parsing. blockoli allows you to efficiently index, store, and search code blocks and their embeddings using vector similarity.

Features

  • Index code blocks from a codebase πŸ“‚πŸ”
  • Generate vector embeddings for code blocks using a pre-trained model πŸ€–πŸ§ 
  • Store code blocks and their embeddings in a SQLite database (Support for Qdrant soon!) πŸ’ΎπŸ—„οΈ
  • Perform efficient similarity search on code blocks using vector embeddings (k-d tree algorithm) πŸ”Žβš‘
  • REST API for easy integration with other tools and platforms πŸŒπŸ”—
  • Fast and memory-efficient implementation using Rust βš‘πŸ’»

Installation (from source)

  1. Ensure you have Rust installed on your system. You can install it from the official Rust website: https://www.rust-lang.org/tools/install

  2. Clone the blockoli repository:

git clone https://github.com/stitionai/blockoli.git
cd blockoli
  1. Download tree-sitter grammar files
mkdir grammars
chmod +x get-grammar.sh
./get-grammar.sh
  1. Build the project:
cargo build --release
  1. Run the server:
./target/release/blockoli <port>

Replace <port> with the desired port number for the server.

Usage

Blockoli provides a REST API for indexing and searching code blocks. Here are some example API endpoints:

  • POST /project: Create a new project
  • GET /project/{project_name}: Get information about a project
  • DELETE /project/{project_name}: Delete a project
  • POST /project/generate: Generate embeddings for code blocks in a project
  • POST /search/{code_block}: Search for similar code blocks in a project
  • POST /get_blocks/{project_name}: Get all function blocks in a project
  • POST /search_blocks/{function_block}: Search for function blocks in a project
  • POST /search_by_function/{function_name}: Search for blocks by function name in a project

Refer to the routes.rs file for detailed information about each API endpoint and its parameters.

Configuration

ASTerisk uses a configuration file named asterisk.toml for specifying indexing options. Modify this file to customize the behavior of the indexer according to your needs.

Contribution Guidelines

Contributions to Blockoli are welcome! If you find a bug, have a feature request, or want to contribute code improvements, please open an issue or submit a pull request on the GitHub repository.

When contributing code, please ensure that your changes are well-tested and follow the Rust coding conventions and style guidelines.

Contribution

Ways to contribute:

  • Suggest a feature
  • Report a bug
  • Fix something and open a pull request
  • Help document the code
  • Spread the word

License

Licensed under the MIT License, see LICENSE for more information.

Liked the project?

Support the project by starring the repository. ⭐


blockoli's People

Contributors

123vivekr avatar mufeedvh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.