docs.rs failed to build miyabi-knowledge-1.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
miyabi-knowledge
Knowledge management system for Miyabi - Vector database, embeddings, and search
📋 概要
Miyabiの実行履歴(ログファイル、成果物、Agent実行情報、ツール使用状況)をベクトルデータベース化し、ナレッジ検索可能な状態にします。
🚀 Features
- ✅ ログ収集:
.ai/logs/, Worktree実行ログ、LDDLogを自動収集 - ✅ ベクトル化: テキストを384次元ベクトルに変換(Ollama統合)
- ✅ 検索: 類似性検索 + メタデータフィルタリング
- ✅ 階層管理: プロジェクト > Worktree > Agent
- ✅ CLI統合:
miyabi knowledgeコマンド(計画中) - ✅ MCP統合: Claude Code自動参照(計画中)
📦 Installation
[]
= { = "1.0.0", = "../miyabi-knowledge" }
🔧 Quick Start
use ;
async
📚 Architecture
システム構成
miyabi-agents (実行)
↓ ログ出力
.ai/logs/ (ログファイル)
↓ 収集
KnowledgeCollector (構造化)
↓ ベクトル化
KnowledgeIndexer (Qdrant挿入)
↓ 検索
KnowledgeSearcher (類似性検索)
↓ 結果
ユーザー
コンポーネント
- KnowledgeCollector: ログ収集・構造化
- KnowledgeIndexer: ベクトル化・DB挿入
- KnowledgeSearcher: 類似性検索
- KnowledgeManager: ファサードクラス(統合管理)
🔍 Usage Examples
ログ収集
use ;
let config = default;
let collector = new?;
// ディレクトリから収集
let entries = collector.collect.await?;
// Worktreeから収集
let entries = collector.collect_worktree.await?;
// Agentから収集
let entries = collector.collect_agent.await?;
インデックス化
use ;
let config = default;
let indexer = new.await?;
// 単一エントリをインデックス化
let id = indexer.index.await?;
// バッチインデックス化
let stats = indexer.index_batch.await?;
println!;
// ワークスペース全体をインデックス化
let stats = indexer.index_workspace.await?;
検索
use ;
let config = default;
let searcher = new.await?;
// 基本検索
let results = searcher.search.await?;
// フィルタ付き検索
let filter = new
.with_agent
.with_task_type;
let results = searcher.search_filtered.await?;
// 類似エントリ検索
let results = searcher.find_similar.await?;
⚙️ Configuration
.miyabi.yml:
knowledge:
vector_db:
type: "qdrant"
host: "localhost"
port: 6333
collection: "miyabi-knowledge"
embeddings:
provider: "ollama"
model: "all-MiniLM-L6-v2"
dimension: 384
workspace:
name: "miyabi-private"
hierarchy: "project > worktree > agent"
collection:
log_dir: ".ai/logs"
worktree_dir: ".worktrees"
auto_index: true
batch_size: 100
search:
default_limit: 10
min_score: 0.7
🧪 Testing
# テスト実行
# 詳細出力
# 特定のテスト実行
🌐 Web UI Dashboard
miyabi-knowledge includes a built-in web dashboard for knowledge base visualization, search, and statistics.
Running the Server
# Start Qdrant (required)
# Run the server
# Or with custom port
PORT=3000
Accessing the Dashboard
Open your browser to: http://localhost:8080
API Endpoints
- GET /api/search?q=query - Search knowledge base
- Query params:
q,agent,workspace,issue,task_type,outcome,limit
- Query params:
- GET /api/stats - Get dashboard statistics
- GET /api/agents - List all agents
- GET /api/timeline?days=30 - Get timeline data
- WS /ws - WebSocket for real-time updates
- GET /health - Health check
Example API Usage
# Search
# Get stats
# List agents
# Timeline
🚧 Development Status
✅ Completed
- Core trait definitions
- Type definitions (KnowledgeEntry, KnowledgeMetadata, etc.)
- Error types
- Configuration management
- Log collector implementation (Markdown parsing)
- Indexer skeleton (placeholder)
- Searcher skeleton (placeholder)
- Web UI Dashboard (Issue #423) ✨
- Axum HTTP Server
- API endpoints (search, stats, agents, timeline)
- WebSocket real-time updates
- HTML/CSS/JS dashboard UI
🔄 In Progress
- Qdrant client integration
- miyabi-llm embeddings integration
- Full indexer implementation
- Full searcher implementation
📅 Planned
- CLI integration (
miyabi knowledgecommand) - MCP integration (Claude Code)
- Performance optimization
- Comprehensive documentation
📖 Documentation
- Design Document: docs/KNOWLEDGE_MANAGEMENT_SYSTEM.md
- API Reference: (TBD)
- User Guide: (TBD)
🤝 Dependencies
- miyabi-types: Core type definitions
- miyabi-core: Common utilities
- miyabi-llm: LLM integration for embeddings
- qdrant-client: Vector database client
- tokio: Async runtime
- serde: Serialization
- pulldown-cmark: Markdown parsing
- regex: Pattern matching
- walkdir: Directory traversal
🔗 Related Crates
- miyabi-agents: Agent implementations
- miyabi-llm: LLM integration
- miyabi-knowledge/potpie: Potpie AI integration (Neo4j knowledge graph) - Integrated in v0.1.1
- miyabi-cli: CLI tool
📦 Potpie Integration (v0.1.1+)
The Potpie AI integration is now part of this crate as a submodule:
use ;
let config = default;
let client = new?;
// Use 8 Potpie tools: search_nodes, get_code_graph, detect_changes, etc.
let nodes = client.search_nodes.await?;
See potpie module documentation for details.
📄 License
Apache-2.0
🙏 Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Status: Phase 3 Implementation Complete ✅ → Phase 4 (Vectorization) Next 🚀