Skip to content

Lajdre/rtfm-rag

Repository files navigation

{Read The Friendly Manual} RAG Assistant with MCP

Is your friendly neighbourhood LLM missing up-to-date context about a library or tool you're using in your project?

Preview

project_preview.mp4
  1. Paste a link to the library or tool documentation — the system will fetch, index, and embed it into the assistant’s knowledge base.
  2. Dynamically select which indexed documentation to activate for your session, then ask your questions and have conversations that leverage the chosen context.

(UI is at - repo)

Example Embeddings Visualization

embeddings_visualization

Setup Locally

  1. Make sure you have nix and devenv on your system.
  2. Enter shell.
devenv shell
  • Or setup an automatic shell by creating .envrc based on .envrc.example. Then run direnv allow (requires direnv).
  1. Spin up the PostgreSQL database.
devenv up # devenv up -d to do it in the background
  • If running for the first time, run:
    psql -h localhost -U $USER -d rtfm-rag -f scripts/init_db.sql
  • Then:
    flyway migrate
  1. Launch the api.
run
  • or
    run-prod
  • or
    uvicorn src.main:app --port 8032
  • or
    uv run -m src.main
  • or
    python -m src.main # assuming virtual env is activated

MCP

To start the MCP server:

  1. Ensure the database is up (devenv up)
  2. run:
uv run -m src.mcp.mcp_server

To test the server run (standalone script):

uv run -m scripts.test_mcp_server

Using a local model via Ollama

  1. Set Ollama as the generator model backend in .env:
  • GENERATOR_MODEL_PROVIDER=ollama
  1. Optionally override the default Ollama settings:
  • OLLAMA_BASE_URL="http://localhost:11434"
  • OLLAMA_MODEL="gemma3:270m"
  1. Make sure Ollama is running and the chosen model is available:
ollama serve
ollama pull gemma3:270m

Local Processing

  • Process links and store data locally:
uv run -m scripts.scrape_data <url> <desired_index_name> [--debug] [--max-depth N] [--max-pages N]
  • Ingest locally scraped data:
uv run -m scripts.manual_ingest <index_name> [--debug] [--max-chunks N]
  • Send scraped data to S3:
uv run -m scripts.send_to_s3 <target_dir>

About

If you would please consult the docs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors