ai markdown llm retrieval
1.0.0
該項目使用Langchain,Chromadb和OpenAI的語言模型實現了AI驅動的文檔查詢系統。它使用戶能夠從Markdown文檔創建可搜索的數據庫,並使用自然語言查詢。

requirements.txt中列出的依賴項.txt python -m venv .venv
source .venv/bin/activate # On Windows, use `.venvScriptsactivate`
pip install -r requirements.txt
.env文件中設置OpenAI API密鑰: OPENAI_API_KEY=your_api_key_here
請按照以下步驟快速設置並使用基於RAG的VectordB-LLM查詢引擎:
從您的Markdown文檔創建數據庫:
python create_database.py --data_folder data/go-docs --chroma_db_path chroma_go_docs/
此命令將在數據/ GO-DOCS目錄中處理Markdown文件,並在Chroma_go_docs/文件夾中創建一個向量數據庫。
用自然語言問題查詢數據庫:
python query_data.py --query_text "Explain goroutines in go in a sentence" --chroma_db_path chroma_go_docs/ --prompt_model gpt-3.5-turbo
查看AI生成的響應:
Goroutines are lightweight, concurrent functions or methods in Go that run independently, managed by the Go runtime, allowing for efficient parallel execution and easy implementation of concurrent programming patterns.
有關更詳細的用法說明,請參閱以下各節:
創建數據庫
python create_database.py --data_folder path/to/your/markdown/files --chroma_db_path path/to/save/database
查詢數據庫
python query_data.py --query_text "Your question here" --chroma_db_path path/to/database --prompt_model gpt-3.5-turbo
create_database.py :數據庫創建腳本query_data.py :數據庫查詢腳本estimate_cost.py :成本估算模塊get_token_count.py :代幣計數實用程序data/ :Markdown Documents目錄chroma/ :Chromadb數據庫存儲(Gitignored) text-embedding-3-small用於嵌入和gpt-3.5-turbodata/或指定自定義路徑chroma/ (Gitignored)中該項目是根據MIT許可證的條款獲得許可的。有關更多信息,請參閱許可證文件。
有關問題或問題,請在GitHub存儲庫上打開一個問題。