Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 RAG Memory Bot

A local-first RAG system with persistent memory, exact replay and interactive learning via web interface — no retraining required.

Learn new knowledge instantly by adding and verifying content directly in the UI.
Generate once, store forever, retrieve exactly — or refine and evolve your knowledge over time.


🚀 Key Idea

This system separates generation from memory:

  • The LLM generates content
  • The system stores and curates it
  • Future answers are retrieved — not hallucinated

👉 Knowledge improves over time through human feedback.


🚀 Overview

RAG Memory Bot is a local FastAPI-based prototype for a retrieval-augmented long-term memory system with focus on three core modes:

  • Generate: create new content
  • Replay: reproduce stored content exactly
  • RAG Answer / Variation: use stored knowledge for answers or variations

The system combines Markdown storage, SQLite metadata, full-text search (FTS5), embedding-based retrieval, and a lightweight web interface.


✨ Features

  • Persistent storage of generated content as Markdown artifacts
  • Metadata management via SQLite
  • Hybrid search combining:
    • Full-text search (FTS5)
    • Semantic search (embeddings)
    • Status / feedback ranking
  • Session-aware replay and variation
  • Review workflow with statuses:
    • draft, saved, favorite, fixed, verified, archived
  • Import of existing Markdown files
  • Web interface for:
    • Chat
    • Artifact management
    • Review and verification
    • Data import

🧱 Architecture

User → API (FastAPI) → Orchestrator

Orchestrator coordinates:

  • Retrieval (FTS + vector search)
  • Storage (Markdown + SQLite)
  • LLM (Ollama)

🖼️ Screenshots

(Add your screenshots here)


🎯 Use Cases

🧑‍🏫 Education

  • Course-specific assistants
  • FAQ systems
  • Knowledge-based tutoring

🏢 IT / Support

  • Internal knowledge systems
  • Policy-aware assistants
  • Local, privacy-friendly AI

✍️ Creative Systems

  • Story generation with memory
  • Replayable narratives
  • Interactive storytelling

🧠 Personal Knowledge Base

  • Persistent assistant memory
  • Retrieval of past answers
  • Knowledge refinement via feedback

⚙️ Installation

1. Clone repository

git clone https://github.com/YOUR_USERNAME/rag-memory-bot.git
cd rag-memory-bot

2. Setup environment

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

3. Install Ollama

https://ollama.com

Check installation:

ollama list

4. Initialize database

python3 scripts/init_db.py

5. Start server

uvicorn app.main:app --host 0.0.0.0 --port 8000

🌐 Web Interface

Open in browser:

http://localhost:8000


🧪 Example Workflow

  1. Generate content
    → "Tell me a story about a hedgehog in a storm"

  2. Verify content in the UI
    → Mark artifact as verified

  3. Replay
    → "Tell me the same story again"
    → Exact same output

  4. Ask a knowledge question
    → "What was the story about?"
    → Answer is generated via RAG using stored content


📂 Project Structure

app/
  api/
  core/
  storage/
  retrieval/
  llm/
  indexing/
  templates/
  static/

data/
  artifacts/
  db/

docs/
  Startanleitung.md

scripts/

🔐 License

This project is licensed under the MIT License.

Note: This project uses third-party models (e.g. via Ollama).
Their respective licenses apply separately.

About

Local RAG system with persistent memory, exact replay, hybrid search and human-in-the-loop learning via web interface.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages