17 stable releases
| new 1.3.2 | Feb 5, 2026 |
|---|---|
| 1.3.1 | Jan 31, 2026 |
#228 in Development tools
2.5MB
57K
SLoC
ποΈ Chasm
Universal Chat Session Manager
Harvest, merge, and analyze your AI chat history
Chasm extracts and unifies chat sessions from AI coding assistants like GitHub Copilot, Cursor, and more. Never lose your AI conversations again.
β¨ Features
- π Harvest - Extract chat sessions from VS Code, Cursor, Windsurf, and other editors
- π Merge - Combine sessions across workspaces and time periods
- π Analyze - Get statistics on your AI assistant usage
- π API Server - REST API for building custom integrations
- π€ MCP Tools - Model Context Protocol support for AI agent integration
- ποΈ Universal Database - SQLite-based storage that normalizes all providers
π¦ Installation
From crates.io
cargo install chasm
From source
git clone https://github.com/nervosys/chasm.git
cd chasm
cargo install --path .
Pre-built binaries
Download from GitHub Releases:
| Platform | Download |
|---|---|
| Windows x64 | chasm-windows-x64.zip |
| macOS x64 | chasm-darwin-x64.tar.gz |
| macOS ARM | chasm-darwin-arm64.tar.gz |
| Linux x64 | chasm-linux-x64.tar.gz |
Docker
docker pull ghcr.io/nervosys/chasm:latest
docker run -v ~/.chasm:/data ghcr.io/nervosys/chasm list workspaces
π Quick Start
List discovered workspaces
chasm list workspaces
ββββββββββββββββββββββββββ¬βββββββββββββββββββ¬βββββββββββ¬βββββββββββββ
β Name β Provider β Sessions β Updated β
ββββββββββββββββββββββββββΌβββββββββββββββββββΌβββββββββββΌβββββββββββββ€
β my-project β GitHub Copilot β 15 β 2026-01-08 β
β another-project β Cursor β 8 β 2026-01-07 β
β open-source-contrib β GitHub Copilot β 23 β 2026-01-06 β
ββββββββββββββββββββββββββ΄βββββββββββββββββββ΄βββββββββββ΄βββββββββββββ
Show sessions for a project
chasm show path /path/to/your/project
Harvest sessions from VS Code
chasm harvest
Export a session to Markdown
chasm export session abc123 --format markdown --output chat.md
Start the API server
chasm api serve --port 8787
π CLI Reference
Core Commands
| Command | Description |
|---|---|
chasm list workspaces |
List all discovered workspaces |
chasm list sessions |
List sessions (optionally filtered by workspace) |
chasm list orphaned |
List unregistered sessions on disk |
chasm show session <id> |
Display full session content |
chasm show path <path> |
Show sessions for a project path |
chasm find workspace <pattern> |
Search workspaces by name |
chasm find session <pattern> |
Search sessions by content |
Data Management
| Command | Description |
|---|---|
chasm harvest scan |
Scan for available providers and sessions |
chasm harvest run |
Collect sessions from all providers |
chasm harvest status |
Show harvest database status |
chasm merge workspace <name> |
Merge sessions from a workspace |
chasm export session <id> |
Export session to file |
chasm import <file> |
Import sessions from file |
Session Recovery
| Command | Description |
|---|---|
chasm detect orphaned <path> |
Find orphaned sessions in old workspace hashes |
chasm detect orphaned -r <path> |
Recover orphaned sessions to active workspace |
chasm register all --path <path> |
Register on-disk sessions in VS Code's index |
Recovering Lost Chat History
When VS Code creates a new workspace hash (e.g., after reinstall or path change), your chat sessions may become "orphaned" in the old workspace folder. Use these commands to recover them:
# 1. Scan for orphaned sessions
chasm detect orphaned /path/to/project
# 2. Recover them (copy to active workspace)
chasm detect orphaned --recover /path/to/project
# 3. Register in VS Code's database
chasm register all --force --path /path/to/project
# 4. Reload VS Code (Ctrl+Shift+P -> Developer: Reload Window)
Server
| Command | Description |
|---|---|
chasm api serve |
Start the REST API server |
chasm mcp serve |
Start the MCP tool server |
Options
chasm --help # Show all commands
chasm <cmd> --help # Show help for a specific command
chasm --version # Show version
π API Server
Start the REST API server for integration with web/mobile apps:
chasm api serve --host 0.0.0.0 --port 8787
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health |
Health check |
| GET | /api/workspaces |
List workspaces |
| GET | /api/workspaces/:id |
Get workspace details |
| GET | /api/sessions |
List sessions |
| GET | /api/sessions/:id |
Get session with messages |
| GET | /api/sessions/search?q= |
Search sessions |
| GET | /api/stats |
Database statistics |
| GET | /api/providers |
List supported providers |
| GET | /api/agents |
List available agents |
| POST | /api/recording/events |
Send recording events |
| POST | /api/recording/snapshot |
Store session snapshot |
| GET | /api/recording/sessions |
List active recording sessions |
| GET | /api/recording/sessions/:id |
Get recorded session |
| GET | /api/recording/recovery |
Recover sessions after crash |
| GET | /api/recording/status |
Recording service status |
Example
curl http://localhost:8787/api/stats
{
"success": true,
"data": {
"totalSessions": 330,
"totalMessages": 19068,
"totalWorkspaces": 138,
"totalToolInvocations": 122712
}
}
π€ MCP Integration
Chasm provides Model Context Protocol tools for AI agent integration:
chasm mcp serve
Available Tools
chasm_list_workspaces- List all workspaceschasm_list_sessions- List sessions in a workspacechasm_get_session- Get full session contentchasm_search_sessions- Search across all sessionschasm_get_stats- Get database statistics
π’ Enterprise Features
Multi-Tenancy
Support for multiple isolated tenants with subscription tiers:
| Tier | Users | Storage | Features |
|---|---|---|---|
| Free | 5 | 1 GB | Basic harvest, local storage |
| Starter | 25 | 10 GB | Cloud sync, API access |
| Professional | 100 | 100 GB | SSO, advanced analytics, priority |
| Enterprise | Custom | Custom | Audit logs, compliance, white-label |
Compliance Frameworks
- SOC 2 Type II
- HIPAA
- GDPR
- CCPA
- ISO 27001
- FedRAMP
- PCI DSS
White-Labeling
Custom branding support including logos, themes, domains, and email templates.
π₯ Team Features
- Team Workspaces: Shared workspaces with role-based access
- RBAC: Owner, Admin, Member, Viewer roles with granular permissions
- Activity Feeds: Real-time team activity tracking
- Session Sharing: Share sessions with permissions (view, comment, edit)
π§ AI Intelligence
- Topic Extraction: Automatic categorization of session content
- Session Summarization: AI-powered conversation summaries
- Quality Scoring: Score sessions by depth, code ratio, tool usage
- Recommendations: Personalized session suggestions based on usage
- Similarity Detection: Find related sessions using Jaccard similarity
π Multi-Model Routing
Intelligent routing across AI providers:
use chasm::routing::{ModelRouter, TaskType, RoutingStrategy};
let router = ModelRouter::new(RoutingStrategy::Balanced);
// Automatic model selection based on task
let response = router.route(TaskType::Coding, "Fix this bug...").await?;
let response = router.route(TaskType::Creative, "Write a story...").await?;
Supported Task Types
Coding, CodeReview, Debugging, Writing, Creative, Math, Analysis, Research, Translation, Summarization, QuestionAnswering, Vision, Reasoning, Quick
π€ Agency (Agent Development Kit)
Agency is Chasm's Rust-native framework for building, orchestrating, and deploying AI agents. It provides a complete toolkit for creating autonomous agents that can reason, use tools, and collaborate in multi-agent workflows.
Key Capabilities
| Feature | Description |
|---|---|
| ποΈ Code-First Agents | Define agents in Rust with type safety and performance |
| π§ Tool Ecosystem | Built-in tools + custom function registration |
| π Multi-Agent Orchestration | Sequential, parallel, hierarchical, and swarm patterns |
| π§ Memory & RAG | Vector store, knowledge base, context window management |
| π‘ Streaming | Real-time response streaming via SSE |
| π Proactive Agents | Autonomous household and business agents |
| π Distributed Execution | Remote task monitoring across machines |
| π¨ Multimodal | VLM/VLA support for vision and robotics |
CLI Commands
# List available agents and roles
chasm agency list
chasm agency list --verbose
# Get detailed agent information
chasm agency info researcher
# Run an agent with a prompt
chasm agency run --agent researcher "What are the latest trends in AI?"
chasm agency run --agent coder --model gpt-4o "Write a REST API in Rust"
# Multi-agent orchestration
chasm agency run --orchestration sequential "Build and test a web scraper"
chasm agency run --orchestration parallel "Research AI, blockchain, and quantum computing"
chasm agency run --orchestration swarm "Design a microservices architecture"
# Create a custom agent
chasm agency create my-agent --role coder --instruction "You are a Rust expert"
# List available tools and templates
chasm agency tools
chasm agency templates
chasm agency modes
Agent Roles
| Role | Icon | Description |
|---|---|---|
coordinator |
[C] | Manages and delegates tasks to other agents |
researcher |
[R] | Gathers information and analyzes data |
coder |
[D] | Writes and modifies code |
reviewer |
[V] | Reviews code and provides feedback |
executor |
[E] | Executes commands and tools |
writer |
[W] | Creates documentation and content |
tester |
[T] | Writes and runs tests |
analyst |
[A] | Data analysis and insights |
household |
[H] | Home automation and management |
business |
[B] | Business process automation |
custom |
[X] | User-defined agent with custom behavior |
Orchestration Modes
| Mode | Pattern | Description |
|---|---|---|
single |
[1] |
Traditional single-agent response |
sequential |
[>] |
Agents execute one after another, passing results |
parallel |
[β] |
Multiple agents work simultaneously on subtasks |
loop |
[O] |
Agent repeats until a condition is met |
hierarchical |
[H] |
Lead agent delegates to specialized sub-agents |
swarm |
[S] |
Multiple agents collaborate with a coordinator |
π Agency Use Cases
1. Research Assistant
Build an agent that searches the web, analyzes sources, and synthesizes findings:
use chasm::agency::{AgentBuilder, Runtime, Tool};
let researcher = AgentBuilder::new("researcher")
.model("gemini-2.0-flash")
.instruction("You are a research assistant. Search for information,
analyze multiple sources, and provide comprehensive summaries
with citations.")
.tool(Tool::web_search())
.tool(Tool::file_write())
.temperature(0.5)
.build();
let runtime = Runtime::new();
let result = runtime.run(&researcher, "What are the latest breakthroughs in fusion energy?").await?;
CLI equivalent:
chasm agency run --agent researcher "What are the latest breakthroughs in fusion energy?"
2. Code Review Pipeline
Chain multiple agents for thorough code review:
use chasm::agency::{Pipeline, AgentBuilder, OrchestrationType};
// Security reviewer
let security = AgentBuilder::new("security-reviewer")
.role(AgentRole::Reviewer)
.instruction("Review code for security vulnerabilities: injection, XSS,
authentication issues, secrets exposure.")
.build();
// Performance reviewer
let performance = AgentBuilder::new("perf-reviewer")
.role(AgentRole::Reviewer)
.instruction("Analyze code for performance issues: N+1 queries,
memory leaks, inefficient algorithms.")
.build();
// Style reviewer
let style = AgentBuilder::new("style-reviewer")
.role(AgentRole::Reviewer)
.instruction("Check code style, naming conventions, and documentation.")
.build();
// Sequential pipeline: security β performance β style
let pipeline = Pipeline::sequential(vec![security, performance, style]);
let result = runtime.run_pipeline(&pipeline, code_to_review).await?;
CLI equivalent:
chasm agency run --orchestration sequential "Review this code: [paste code]"
3. Full-Stack Development Swarm
A coordinator delegates to specialized agents:
use chasm::agency::{Swarm, AgentBuilder, AgentRole};
// Coordinator
let coordinator = AgentBuilder::new("lead-dev")
.role(AgentRole::Coordinator)
.instruction("You are a tech lead. Break down tasks and delegate to:
- frontend-dev: React/TypeScript UI work
- backend-dev: Rust API development
- devops: Docker, CI/CD, deployment")
.build();
// Specialist agents
let frontend = AgentBuilder::new("frontend-dev")
.role(AgentRole::Coder)
.instruction("Expert in React, TypeScript, TailwindCSS")
.tool(Tool::file_read())
.tool(Tool::file_write())
.build();
let backend = AgentBuilder::new("backend-dev")
.role(AgentRole::Coder)
.instruction("Expert in Rust, Actix-web, SQLite")
.tool(Tool::file_read())
.tool(Tool::file_write())
.tool(Tool::terminal())
.build();
let devops = AgentBuilder::new("devops")
.role(AgentRole::Executor)
.instruction("Expert in Docker, GitHub Actions, cloud deployment")
.tool(Tool::terminal())
.build();
let swarm = Swarm::new(coordinator, vec![frontend, backend, devops]);
let result = runtime.run_swarm(&swarm, "Build a user authentication system").await?;
CLI equivalent:
chasm agency run --orchestration swarm "Build a user authentication system"
4. Automated Testing Agent
An agent that writes and runs tests:
use chasm::agency::{AgentBuilder, AgentRole, Tool};
let tester = AgentBuilder::new("test-writer")
.role(AgentRole::Tester)
.instruction("You write comprehensive tests. For each function:
1. Identify edge cases and boundary conditions
2. Write unit tests with clear assertions
3. Add integration tests where appropriate
4. Run tests and fix failures")
.tool(Tool::file_read())
.tool(Tool::file_write())
.tool(Tool::terminal()) // For running tests
.max_tool_calls(20)
.build();
let result = runtime.run(&tester, "Write tests for src/auth/login.rs").await?;
5. Proactive Household Agent
An autonomous agent that monitors and manages home tasks:
use chasm::agency::{ProactiveMonitor, household_agent_config, PermissionLevel};
let config = household_agent_config()
.permission_level(PermissionLevel::MediumRisk) // Can take moderate actions
.scan_interval(Duration::from_secs(3600)) // Check hourly
.notifications_enabled(true)
.integrations(vec!["google_calendar", "todoist", "smart_home"]);
let monitor = ProactiveMonitor::new(config);
// Monitor detects problems and takes action based on permission level:
// - NotifyOnly: Just alerts (bills due, maintenance needed)
// - LowRisk: Safe actions (add reminders, reorder supplies)
// - MediumRisk: Moderate actions (adjust thermostat, schedule services)
// - HighAutonomy: Full automation (pay bills, control devices)
monitor.start().await?;
6. RAG-Enhanced Agent
Agent with access to a knowledge base:
use chasm::agency::{AgentBuilder, KnowledgeBase, VectorStore, EmbeddingModel};
// Create knowledge base from documents
let mut kb = KnowledgeBase::new();
kb.add_documents_from_directory("./docs").await?;
// Vector store for semantic search
let store = VectorStore::new(VectorStoreConfig {
embedding_model: EmbeddingModel::TextEmbedding3Small,
similarity_metric: SimilarityMetric::Cosine,
..Default::default()
});
let expert = AgentBuilder::new("domain-expert")
.instruction("Answer questions using the provided knowledge base.
Always cite sources.")
.knowledge_base(kb)
.vector_store(store)
.build();
let result = runtime.run(&expert, "What is our refund policy?").await?;
7. Multimodal Vision Agent (VLM)
Agent that can understand images:
use chasm::agency::{AgentBuilder, MultimodalMessage, ImageContent, ModelCategory};
let vision_agent = AgentBuilder::new("vision-analyst")
.model("gemini-2.0-flash") // VLM model
.instruction("Analyze images and provide detailed descriptions.")
.modality(ModelCategory::VLM)
.build();
// Send image with text
let message = MultimodalMessage::new()
.text("What's in this image?")
.image(ImageContent::from_file("screenshot.png")?);
let result = runtime.run(&vision_agent, message).await?;
8. Distributed Task Monitoring
Track agent tasks across multiple machines:
use chasm::agency::{RemoteMonitor, RemoteTask, TaskPriority};
let monitor = RemoteMonitor::new(RemoteMonitorConfig {
heartbeat_interval: Duration::from_secs(30),
..Default::default()
});
// Register remote nodes
monitor.register_node("gpu-server-1", "192.168.1.100:8080").await?;
monitor.register_node("gpu-server-2", "192.168.1.101:8080").await?;
// Submit task to best available node
let task = RemoteTask::builder()
.title("Train classification model")
.agent("ml-trainer")
.priority(TaskPriority::High)
.build();
let task_id = monitor.submit_task(task).await?;
// Stream progress updates
let mut events = monitor.subscribe_task(task_id);
while let Some(event) = events.recv().await {
println!("Progress: {}% - {}", event.progress * 100.0, event.message);
}
π Agency REST API
The API server provides full CRUD operations for agents:
chasm api serve --port 3000
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/agents |
List all agents |
| POST | /api/v1/agents |
Create an agent |
| GET | /api/v1/agents/{id} |
Get agent details |
| PUT | /api/v1/agents/{id} |
Update an agent |
| DELETE | /api/v1/agents/{id} |
Delete an agent |
| POST | /api/v1/agents/{id}/clone |
Clone an agent |
| GET | /api/v1/swarms |
List all swarms |
| POST | /api/v1/swarms |
Create a swarm |
| POST | /api/v1/swarms/{id}/start |
Start swarm execution |
| POST | /api/v1/swarms/{id}/pause |
Pause swarm |
| POST | /api/v1/swarms/{id}/resume |
Resume swarm |
| POST | /api/v1/swarms/{id}/stop |
Stop swarm |
Example: Create an Agent via API
curl -X POST http://localhost:3000/api/v1/agents \
-H "Content-Type: application/json" \
-d '{
"name": "code-assistant",
"instruction": "You are a helpful coding assistant specializing in Rust.",
"role": "coder",
"model": "gemini-2.0-flash",
"temperature": 0.3,
"tools": ["file_read", "file_write", "terminal"]
}'
Example: Run a Swarm
# Create a swarm
curl -X POST http://localhost:3000/api/v1/swarms \
-H "Content-Type: application/json" \
-d '{
"name": "dev-team",
"coordinator": "tech-lead",
"workers": ["frontend-dev", "backend-dev", "tester"],
"description": "Full-stack development team"
}'
# Start the swarm with a task
curl -X POST http://localhost:3000/api/v1/swarms/{id}/start \
-H "Content-Type: application/json" \
-d '{"prompt": "Build a todo app with user authentication"}'
ποΈ Supported Providers
Editor-based
- β GitHub Copilot (VS Code)
- β Cursor
- β Windsurf
- β Continue.dev
- β ClaudeCode
- β OpenCode
- β OpenClaw
- β Antigravity
Local LLMs
- β Ollama
- β LM Studio
- β GPT4All
- β LocalAI
- β llama.cpp / llamafile
Cloud APIs
- β OpenAI / ChatGPT
- β Anthropic / Claude
- β Google / Gemini
- β Perplexity
π Database
Chasm stores all data in a local SQLite database:
| Platform | Location |
|---|---|
| Windows | %LOCALAPPDATA%\csm\csm.db |
| macOS | ~/Library/Application Support/csm/csm.db |
| Linux | ~/.local/share/csm/csm.db |
Schema
Workspaces ββ< Sessions ββ< Messages
β
βββ< Checkpoints
βββ< ShareLinks
π οΈ Development
Prerequisites
- Rust 1.75+
- Git
Building
git clone https://github.com/nervosys/chasm.git
cd chasm
cargo build --release
Running tests
cargo test
Running the TUI
cargo run -- tui
π License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE or http://opensource.org/licenses/MIT)
at your option.
π€ Contributing
Contributions are welcome! Please read our Contributing Guide and Code of Conduct.
π Security
For security issues, please see our Security Policy.
π Support
- π Documentation
- π¬ GitHub Discussions
- π Issue Tracker
Made with β€οΈ by Nervosys
Dependencies
~71β125MB
~2M SLoC