Skip to content

汎用的な会話履歴・メモの保存と、ベクトル検索APIを提供するFastAPIアプリケーションです。

License

Notifications You must be signed in to change notification settings

tanep3/SemanticMemory

Repository files navigation

🇯🇵 日本語


SemanticMemory

A FastAPI application that provides conversation log / memo storage with vector search capabilities.

🌟 Features

  • Conversation Log Management: Save, update, and delete with SQLite + ChromaDB dual storage
  • Vector Search: Semantic search with SBERT embeddings
  • Auto Summarization: Summary generation via Ollama
  • Neural Dive UI: Web interface for managing memories from your browser
  • MCP Integration: AI tool integration via Model Context Protocol
  • RESTful API: Fast API server powered by FastAPI
  • Docker Ready: Easy deployment

🚀 Getting Started

1. Start with Docker

docker compose up -d

Default settings:

  • Data stored in ./datas directory (SQLite / ChromaDB)
  • Port: 6001

2. API Documentation

http://localhost:6001/docs

View the API documentation via FastAPI's Swagger UI.


🧠 Neural Dive UI (Admin Panel)

A web-based admin panel for browsing, editing, and deleting memories.

Access

http://localhost:6001/

Features

Feature Description
📋 Memory List Browse saved conversation logs by time or keyword search
✏️ Edit Edit main_text, sub_text, summary individually (auto-regenerates summary when main_text changes)
🗑️ Delete Delete unwanted memories
🔍 Orphan Detection Detect and fix inconsistencies between SQLite and ChromaDB

Authentication (Optional)

Configure Basic Auth in .env:

UI_USER=admin
UI_PASS=secret

🔗 MCP Integration (AI Tool Linking)

Use MCP (Model Context Protocol) to operate memories from AI assistants.

Available Tools

Tool Description
recall_memory Explicitly search and retrieve past memories
delete_memory Delete memories (with confirmation)

Configuration

See the following for details:


📁 Client Examples

File Description
examples/ai_sample.py Basic RAG client
examples/ai_mcp_sample.py MCP-integrated client (with HITL)
examples/open_webui_filter.py Filter for OpenWebUI

See examples/usage.md for details.


⚙️ Environment Variables

Configure via .env or docker-compose.yml:

Variable Default Description
SQLITE_PATH ./datas/semantic_memory.db SQLite file path
CHROMA_PATH ./datas/chroma/ ChromaDB directory
OLLAMA_URL http://localhost:11434 Ollama API URL
SBERT_MODEL cl-nagoya/ruri-small-v2 Embedding model
UI_USER / UI_PASS (empty) UI authentication (enabled when both set)
API_TIMEOUT 30 Client API timeout (seconds)

🔄 Update

./scripts/auto_update.sh

Automatically performs git pull, Docker build, and removes old images.


📚 Models & Licenses

This project uses the following external models:

Model licenses differ from this repository's license. Users are responsible for reviewing and complying with model license terms.


⚖️ License

This project is licensed under the MIT License. See LICENSE for details.

About

汎用的な会話履歴・メモの保存と、ベクトル検索APIを提供するFastAPIアプリケーションです。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published