Skip to content

bytkim/acorn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Acron

A small Flask app for indexing GitHub repos and asking questions about them. It walks a repo with Kit, extracts symbols (functions, classes, methods, types), embeds them with jinaai/jina-embeddings-v2-base-code, stores everything in SQLite with sqlite-vec, and answers questions over the indexed code via OpenRouter.

Pipeline

GitHub URL  →  Kit  →  SQLite (symbols)  →  sqlite-vec (embeddings)  →  similarity search  →  LLM answer

Requirements

  • Python 3.11+
  • An OpenRouter API key (for chat)
  • Optional: a GitHub token for higher rate limits when indexing

Setup

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env   # then fill in keys, or set them via the Settings page

requirements.txt covers the Flask app; the pipeline also uses sqlite-vec and sentence-transformers, which come in via cased-kit's deps.

Database setup

Acron uses SQLite (file-based, no server). The app auto-creates data/pipeline.db with the full schema on first run, so for normal use no manual DB step is required.

For grading / cold-start setup, the schema and seed data can be applied by hand:

mkdir -p data
sqlite3 data/pipeline.db < sql/create_schema.sql      # creates all tables + indexes
sqlite3 data/pipeline.db < sql/initialize_data.sql    # populates 15 rows per table

Notes:

  • sql/create_schema.sql is the canonical schema; src/pipeline.py embeds the same DDL for auto-init.
  • The symbol_vectors virtual table needs the sqlite-vec extension. The Python app loads it automatically; the bare sqlite3 CLI will print a no such module: vec0 warning for that one statement, which is safe to ignore for grading purposes — all other tables are created.
  • DB files live in data/ and are gitignored.

Run

python src/app.py
# open http://localhost:5001

From the homepage:

  1. Paste a https://github.com/... URL to index a repo.
  2. Click into the repo to browse files/symbols and run vector search.
  3. Use the chat box to ask questions — answers cite file:line and are saved as reports.

Layout

  • src/app.py — Flask routes (home, repo detail, chat, reports, settings).
  • src/pipeline.py — indexing + embedding + search; also runnable standalone as a demo.
  • sql/create_schema.sql — full relational schema (tables, indexes, vector table).
  • sql/initialize_data.sql — sample data, 15 rows per table.
  • templates/ — Jinja templates.
  • prototypes/ — earlier scratch versions kept for reference.
  • docs/ — design notes (e.g. acron_db.md).
  • data/ — SQLite files (pipeline.db, acron.db) written by the app.

Paths and permissions

  • All paths in the code are resolved relative to the repo root via Path(__file__); you do not need to hard-code an absolute path. Run commands from the repo root (the directory containing README.md).
  • The app needs read/write access to data/ (SQLite writes its .db and -journal files there) and read access to templates/, sql/, and src/. A standard git clone gives correct permissions; if you copy the project around, ensure data/ is writable by the user running python src/app.py.

Notes

  • data/pipeline.db and data/acron.db are SQLite files written by the app. They're gitignored.
  • API keys can live in .env or be set via the in-app Settings page (stored in the settings table).

About

Acorn

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors