- name
- personal-knowledge-base
- description
- >
- metadata
- openclaw
- requires
- env
Memora — Personal Knowledge Base (RAG)
A self-hosted Retrieval-Augmented Generation (RAG) personal knowledge base that lets your AI assistant search, query, and manage your private documents.
Tech Stack
- Backend: FastAPI (Python)
- Vector Database: Qdrant (dense + sparse vectors)
- Embedding: DashScope
text-embedding-v4/ OpenAI compatible - LLM: DeepSeek / OpenAI compatible
- Retrieval: Hybrid search (dense vectors + BM42 sparse vectors + Qwen3 Rerank)
- Metadata Store: MySQL
- Skill Client: Zero-dependency Python (stdlib only —
urllib,json)
Features
- Semantic Search — Find documents by meaning using vector similarity, not just keywords
- AI-Powered Q&A — Ask a question, get an LLM-generated answer grounded in your documents with source citations
- Hybrid Retrieval — Dense embedding + BM42 sparse vectors + reranking for optimal recall and precision
- Document Upload — Ingest PDF, DOCX, TXT, and Markdown files with automatic chunking and vectorization
- Document Creation — Create text documents directly from the agent
- Document Management — List, view details, and organize your knowledge base
When to Run
- User asks a question that may be answered by stored documents
- User wants to search the knowledge base
- User wants to list documents or view document details
- User wants to upload a file or create a new document
- User needs AI-organized answers on a topic from their personal knowledge
Workflow
Upload a File
- Get the file path and title from the user
- Run:
python scripts/kb_api.py upload "{absolute_file_path}" "{document_title}"- Supported formats:
.txt.pdf.docx.md - Returns upload result with
document_id
Create a Text Document
- Get the title and text content from the user
- Run:
python scripts/kb_api.py create "{title}" "{content}"- Returns creation result with
document_id
Search with AI Answer (RAG)
- Extract the user's query
- Run:
python scripts/kb_api.py search_answer "{query}"- Parse the returned JSON: extract
answerand source documents fromsources - Present the answer with source citations
Search Documents Only
- Extract the user's search keywords
- Run:
python scripts/kb_api.py search "{keywords}"- Parse and display the ranked search results
List All Documents
- Run:
python scripts/kb_api.py list- Display the document list
View Document Details
- Get the document ID
- Run:
python scripts/kb_api.py detail "{document_id}"- Display the document content
Output Format
Upload / Create:
Document "{title}" has been added to the knowledge base (ID: {document_id})
Search with AI Answer:
Knowledge Base Query Result
{AI-generated answer based on retrieved documents}
Sources:
- {document_title} (relevance: {score})
List Documents:
Documents ({n} total)
- {title} — {created_at}
- ...
Configuration
Set the environment variable KB_API_BASE to point to the Memora backend. Default: http://127.0.0.1:8080
Source code & setup guide: https://github.com/zzlzzlzzl15/Memora