Add AI Assistant (Chatbot + Agent) to IPED - #2924
Open
gibi177 wants to merge 168 commits into
Open
Conversation
- Enables local model initialization with MCP tools in agent mode - Resolves incorrect working directory preventing opencode.json loading
- Add --format json flag to extract structured output from opencode - Parse session ID from JSON stream using regex pattern matching - Extract text content and tool calls using GSON JSON parser - Store session ID in AgentConversation and persist to disk
…rsation - Add sessionId parameter to OpenCodeAgentService.askAgentQuestion() - Pass --session flag to opencode when session ID is available - Extract session ID from AgentConversation before each request - Maintain conversation context across IPED restarts - Translate comments to english
fix: enhance search functionality with auto-escaping for IPED fields refactor: improve metadata formatting in document properties
…ltiple documents in a single call
…es, and development journey
…o use relative paths
…st commit additions
Member
|
Thank you very much @gibi177! This looks awesome! But could you please base this PR on master branch? I see hundreds of commits here already merged on master, seems you based the PR on an outdated branch. |
Author
|
Thank you, @lfcnassif! I've changed the base to master as requested. Hope it helps Sepinf in the future. It's been a pleasure to work on this project! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add AI Assistant (Chatbot + Agent) to IPED
Summary
This PR introduces a full-featured AI assistant module into IPED, enabling forensic investigators to interact with their cases using natural language. It encompasses ** ~160+ non-merge commits** across 98 files, contributed by 2 developers. The work builds on the upstream
#2812_ai_assistant/#2641foundations and extends them with a complete chatbot UI and an autonomous agent mode.Features
1. AI Chatbot (Chatbot Mode)
A conversational AI assistant integrated into IPED's UI that allows investigators to select WhatsApp chat exports and ask natural-language questions. The LLM returns answers with clickable citations that navigate directly to referenced items in IPED's viewer.
ChatStreamAnimator)AIMarkdownRenderer(supports code blocks, bold, italic, lists, links)2. AI Agent (Agent Mode)
An autonomous AI agent that communicates with an external
opencodeCLI process via JSON-Lines over stdin/stdout. The agent has autonomous access to the IPED case through a MCP (Model Context Protocol).Key differences from chatbot mode:
iped-app/resources/scripts/mcp/iped-mcp-server/) exposes IPED case data as callable tools:list_sources,search,search_by_type,search_by_nameget_searchable_fields,get_document,get_document_text,read,read_batchlist_bookmarks,get_bookmarkArchitecture
The new
iped.app.ui.aipackage follows a clean layered architecture:Minimal footprint on existing code: ~95% of changes are within the
ai/package. Existing files touched:App.java: AI assistant toolbar button + Ctrl+Shift+A shortcutMenuClass.java: "Add highlighted/checked to AI context" right-click menu itemsViewerController.java: AI assistant button initializationUICaseDataLoader.java: AI task registrationUiUtil.java: HTML utility enhancements for empty-view messagesSummaryViewer.java: New viewer for AI summariesSimpleFilterNode.java: Support for AI summary filter iconsExtraProperties.java: NewSUMMARYconstantConfiguration
IPEDConfig.txt:enableAISummarization = true/falseAISummarizationConfig.txt: Remote service address, timeouts, chat analysis questionsAIFiltersConfig.json: Added "Analyzed Chats" and "Summarized Chats" filter entriesiped-mcp-server/.env: JVM heap size, JAVA_HOME overrideopencode.json: LLM provider configuration for agent mode (example provided)Localization
All new strings localized in 6 languages:
Documentation
5 comprehensive HTML documentation files included:
Chatbot Complete Technical Documentation.html- Full technical referenceChatbot Broader Project Report.html- Architecture, changes, and development journeyChatbot sequence diagrams.html- Mermaid sequence diagramsAgent Complete Technical Documentation.html- Full technical referenceAgent sequence diagrams.html- Mermaid sequence diagramsFile Changes Summary
Dependencies
AISummarizationConfig.txtopencodeinstalled and accessible in PATHTesting
Notes for Reviewers
ai/filters package move (AIFiltersLoader, etc. fromai/toai/filters/) is a pure refactor with import updatesopencode.json.examplefile should be copied toopencode.jsonby users configuring agent mode