Kinda like JARVIS, but just for coding.
yarn
to install dependencies.
The you can run 3 CLI tabs: (or just do yarn start
- don't forget to do yarn stop
when you're done)
mongod --dbpath=data
node server.js
# https://www.tutorialspoint.com/mongodb/mongodb_query_document.htm
mongo
use takeaways
db.takeaways.insert({'some-key':'some-data'})
db.takeaways.insert({'some-key':'some-other-data'})
db.takeaways.find({'some-key':'some-data'})
db.takeaways.find()
db.takeaways.update({'some-key':'some-other-data'},{$set:{'some-key':'new data'}})
db.takeaways.find()
db.takeaways.remove({'some-key':'new data'})
db.takeaways.remove({'some-key':{$regex:/some-data/}})
db.takeaways.find()
deps
# for example:
# Enter max depth:
# Enter src folder (or folder or file you'd like to inspect): public/index.js
For now, most critical are 1, 2, 5, 8, 11: (goal, nearest, ask, report/show)
- get goal
- get embeddings of props/actions
- store these embeddings for faster access later if repeated
- (use ANNOY to get stored index and recreate index with updated data)
- BONUS: get embeddings so it can get ideas of combos to try:
- get embeddings of docs sentences that are associated with API props/actions
- get code examples from docs API to generate example inputs
- get embeddings of any error logs (compare to props/actions/docs embeddings)
- get embeddings of any google suggestion sentence (compare to props/actions/docs embeddings)
- BONUS: check if any action combos get the goal result already (key: result, value: action combo)
- choose closest embeddings to goal
- check nearness of embeddings of single actions (try shallow API first)
- BONUS: choose closest embeddings to error log:
- check nearness of embeddings of single actions (try shallow API first)
- check nearness of embeddings of combos suggested by docs/google/error logs
- BONUS: get different ways to make combos:
- sequence functions (doSomething(); doSomethingElseAfter();)
- within/chained functions, conceptually includes "=" (doSomethingAfter(doSomethingFirst()))
- ask/suggest before trying (for security)
- BONUS: try combos/single actions:
- with delay between things tried
- in either codepen or new sandboxed browser instances (for safety and to isolate variables)
- BONUS: get and store results and results frequencies for what tried:
- how use this to check if achieved goal?
- report/show findings from results of actions tried (variable value + UI, which may be in a CodePen if possible)
This process is different from semantic code search because it also proactively checks error logs, tries combinations, and checks results (at least tries to, in a sandbox).
https://github.com/tensorflow/tfjs-models/tree/master/universal-sentence-encoder
https://github.com/hchiam/text-similarity-test
For an efficient Approximate Nearest Neighbors search of nearest embeddings (instead of checking every single embedding stored in memory every time):
https://github.com/spotify/annoy
https://github.com/jimkang/annoy-node
# for python:
pip install --user annoy