sigoden / aichat

All-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI tools & agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more.
Apache License 2.0
4.38k stars 299 forks source link

automatic session creation and management using aichat's existing YAML infrastructure #997

Open garyblankenship opened 5 hours ago

garyblankenship commented 5 hours ago

Is your feature request related to a problem? Please describe. Currently in aichat:

Describe the solution you'd like

  1. Automatic Session Management:

    • Create sessions automatically for every chat interaction
    • Use meaningful default naming (e.g., YYYYMMDD_HHMMSS_context)
    • Preserve working directory context in session metadata
    • Allow session merging for related conversations
  2. Configuration in config.yaml:

    sessions:
    auto_create: true              # Enable automatic sessions (default: true)
    name_format: "{date}_{time}"   # Custom naming pattern
    base_path: ~/.config/aichat/sessions
    retention_days: 90             # Auto-cleanup old sessions
    context_capture:               # What context to include
    working_directory: true      # Include pwd in session name/metadata
    git_repo: true              # Include repo name if in git directory
  3. Enhanced CLI Commands:

    
    # List recent sessions
    aichat sessions list --last=24h

Search across sessions

aichat sessions search "kubernetes"

Merge related sessions

aichat sessions merge session1 session2

Clean up old sessions

aichat sessions cleanup --older-than=90d



4. Features:
- Zero-configuration session logging
- Intelligent session naming based on context
- Session search and management tools
- Automatic cleanup of old sessions
- Session merging for related conversations

**Describe alternatives you've considered**
1. Current manual session management: Requires explicit user action
2. Always-on single session: Would become too large
3. Time-based session rotation: Might split related conversations

**Additional context**
This would:
- Preserve all conversations by default
- Maintain existing YAML format for compatibility
- Require no change in normal usage
- Make session management invisible to users
- Enable easy access to chat history
sigoden commented 3 hours ago

You don't really understand how the current session works in aichat; you just want to copy the GUI setup into aichat. But is that really a good idea?

Create sessions automatically for every chat interaction

We provide a save_session config for auto-saving controls. set save_session: true for automaticlly saving.

Use meaningful default naming (e.g., YYYYMMDD_HHMMSS_context)

Explain in https://github.com/sigoden/aichat/issues/947#issuecomment-2433866565 Alternative in #805

Preserve working directory context in session metadata

There is currently no place where it can be used.

Allow session merging for related conversations

It's entirely nonsense.

The number of tokens that an LLM can handle is limited. Even though many large models can process over 100K tokens, your budget is also limited. This is why aichat provides session compression.

Session search and management tools

The best search and management tools are external file manager (like Yazi) and IDE (like VSCode). They are much more convenient than anything else.