Simple RAG on your knowledge bases. Only support Markdown Files.
Install the gem directly:
gem install simple-rag-zc-
Setup Config JSON *Required
- Copy
example_config.jsontoconfig.json, then edit the paths to absolute path. - All
run-*executables default to./config.json, then~/.config/simple-rag/config.jsonif no config path is provided.
- Copy
-
SQLite index is required
- Set per-path
dbassqlite_file_path@table_name
- Set per-path
-
Run
run-index config.json*Required- To generate embeddings for all files. It takes a while on the first time.
- To update embeddings whenever your files updated.
-
Run
run-server config.json- Open
http://localhost:4567/q.htmlto search/ask from your knowledge bases- Use Search for standard retrieval
- Use Search+ for agentic query expansion and fast text match
- Open
http://localhost:4567/duplicate.htmlto review duplicate clusters - Open
http://localhost:4567/random.htmlto explore notes randomly - Open
http://localhost:4567/graph.htmlto explore search results as a graph
- Open
-
Run
run-query "your question"for CLI retrieval (LLM-friendly)run-query --helpshows usage and all configuredpaths(name => dir)- Uses the same standard retrieval pipeline as the web UI Search action
- Default JSON output is a flat locator list with
path, roundedscore, anchorchunk, and brieftext - Use
--fullfor complete chunk text and retrieval debug details
To create a fancy map like the screenshot, complete these additional steps:
- Setup Python map generator
- Python 3.10+ is required for the faster map generator.
- From the repo root, install the Python package and dependencies:
python -m pip install -e python-
Update
config.jsononmap.pathfields. -
Run
run-index-map-v2 config.json.- It clusters indexed notes into mountains and writes the map data JSON.
- Optional include-only paths:
- set
map.includePathsin config.json (array ofpaths[].name) - or call
run-index-map-v2 config.json journal,learning
- set
- For faster iteration, run graph-only output first:
run-index-map-v2 config.json --stage graph- Or run the full pipeline:
run-index-map-v2 config.json --stage all- Label generation uses concurrent LLM requests. Tune it with either
map.labelWorkersinconfig.jsonor--label-workers:
run-index-map-v2 config.json --stage labels --label-workers 6- Open
http://localhost:4567/map-v2.htmlto explore knowledge mountains and click dots intoq.html
To release a new version to RubyGems, run:
gem build simple-rag.gemspec
gem push simple-rag-zc-$(ruby -Ilib -e 'require "simple_rag/version"; puts SimpleRag::VERSION').gemTo test the version as a local install:
gem install simple-rag-zc-$(ruby -Ilib -e 'require "simple_rag/version"; puts SimpleRag::VERSION').gem