nothingworry commited on
Commit
5bf8ced
Β·
1 Parent(s): b13e570

update the readme file

Browse files
Files changed (2) hide show
  1. README.md +37 -2
  2. backend/README.md +13 -0
README.md CHANGED
@@ -76,7 +76,8 @@ Then access:
76
 
77
  ### Core Capabilities
78
 
79
- - πŸ€– **Autonomous Multi-Step MCP Agents** – Intelligent tool-aware agent that plans and executes multi-step workflows across RAG, Web, Admin, and LLM tools with memory of previous tool outputs
 
80
  - πŸ“š **Enhanced Knowledge Base Management** – Upload raw text, URLs, or documents (PDF/DOCX/TXT/MD) with rich metadata (source URL, timestamp, document type) and optimized chunking (400-600 tokens)
81
  - πŸ” **Optimized RAG Search** – Semantic search with configurable similarity threshold (default 0.3) for better recall, with fallback to return top results even if below threshold
82
  - πŸ—‘οΈ **Document Management** – Delete individual documents or bulk delete all documents for a tenant with confirmation dialogs
@@ -114,6 +115,32 @@ Then access:
114
  - πŸ’Ύ **Persistent Analytics Storage** – Supabase-backed analytics store (with automatic SQLite fallback) for fast, multi-tenant queries
115
  - πŸ—„οΈ **Supabase Integration** – Production-ready Supabase support for admin rules with automatic table creation
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  ---
118
 
119
  ## Installation & Setup
@@ -383,7 +410,7 @@ IntegraChat follows a modular architecture with clear separation of concerns:
383
 
384
  ### Enterprise-Grade Features
385
 
386
- 1. **Autonomous Multi-Step Planning**: LLM-powered planning determines optimal tool sequences with memory of previous tool outputs in multi-step workflows.
387
 
388
  2. **Regex-Based Governance**: Admin rules support regex patterns with fallback to keyword matching and semantic similarity scoring for flexible policy enforcement.
389
 
@@ -642,6 +669,14 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
642
  - **Supabase Integration**: Production-ready Supabase support with automatic table creation
643
  - **Streaming Responses**: Word-by-word streaming for chat responses using Server-Sent Events (SSE)
644
 
 
 
 
 
 
 
 
 
645
  ### UI Improvements
646
  - **Modern Drag-and-Drop**: Intuitive file upload with visual feedback
647
  - **Enhanced Status Messages**: Clear success/error messages with icons
 
76
 
77
  ### Core Capabilities
78
 
79
+ - πŸ€– **Autonomous Multi-Step MCP Agents** – Intelligent tool-aware agent that plans and executes multi-step workflows across RAG, Web, Admin, and LLM tools with short-term conversation memory
80
+ - πŸ’­ **Short-Term Conversation Memory** – Automatic memory system that stores the last N tool outputs per session with configurable expiration (default: 10 outputs, 15 minutes TTL). Memory is keyed by session_id (not tenant_id) for safety, enabling better context awareness in multi-step workflows. Memory is automatically injected into tool payloads and cleared on session end.
81
  - πŸ“š **Enhanced Knowledge Base Management** – Upload raw text, URLs, or documents (PDF/DOCX/TXT/MD) with rich metadata (source URL, timestamp, document type) and optimized chunking (400-600 tokens)
82
  - πŸ” **Optimized RAG Search** – Semantic search with configurable similarity threshold (default 0.3) for better recall, with fallback to return top results even if below threshold
83
  - πŸ—‘οΈ **Document Management** – Delete individual documents or bulk delete all documents for a tenant with confirmation dialogs
 
115
  - πŸ’Ύ **Persistent Analytics Storage** – Supabase-backed analytics store (with automatic SQLite fallback) for fast, multi-tenant queries
116
  - πŸ—„οΈ **Supabase Integration** – Production-ready Supabase support for admin rules with automatic table creation
117
 
118
+ ### Conversation Memory System
119
+
120
+ IntegraChat includes a **short-term conversation memory** system that enhances multi-step workflows by maintaining context across tool calls:
121
+
122
+ - **Automatic Storage**: Every tool output is automatically stored in memory for the session
123
+ - **Bounded Size**: Keeps only the last N tool outputs (configurable via `MCP_MEMORY_MAX_ITEMS`, default: 10)
124
+ - **Auto-Expiration**: Entries automatically expire after a configurable TTL (via `MCP_MEMORY_TTL_SECONDS`, default: 900 seconds / 15 minutes)
125
+ - **Session-Based**: Memory is keyed by `session_id` (not `tenant_id`) for safety and isolation
126
+ - **Automatic Injection**: Recent memory is automatically injected into tool payloads as a `memory` field for multi-step workflows
127
+ - **Session Clearing**: Memory can be explicitly cleared by sending `end_session: true` or `endSession: true` in the payload
128
+
129
+ **Usage Example:**
130
+ ```json
131
+ {
132
+ "tenant_id": "acme",
133
+ "session_id": "chat-abc-123",
134
+ "query": "Search for X"
135
+ }
136
+ ```
137
+
138
+ Subsequent tool calls with the same `session_id` will receive a `memory` field containing recent tool outputs, enabling tools to make context-aware decisions in multi-step workflows.
139
+
140
+ **Configuration:**
141
+ - `MCP_MEMORY_MAX_ITEMS`: Maximum number of tool outputs to keep per session (default: 10)
142
+ - `MCP_MEMORY_TTL_SECONDS`: Time-to-live for memory entries in seconds (default: 900)
143
+
144
  ---
145
 
146
  ## Installation & Setup
 
410
 
411
  ### Enterprise-Grade Features
412
 
413
+ 1. **Autonomous Multi-Step Planning**: LLM-powered planning determines optimal tool sequences with short-term conversation memory that stores and injects previous tool outputs into subsequent tool calls for better context awareness.
414
 
415
  2. **Regex-Based Governance**: Admin rules support regex patterns with fallback to keyword matching and semantic similarity scoring for flexible policy enforcement.
416
 
 
669
  - **Supabase Integration**: Production-ready Supabase support with automatic table creation
670
  - **Streaming Responses**: Word-by-word streaming for chat responses using Server-Sent Events (SSE)
671
 
672
+ ### Conversation Memory System (Latest)
673
+ - **Short-Term Memory**: Automatic storage of tool outputs per session with configurable size limits and TTL
674
+ - **Session-Based Isolation**: Memory keyed by session_id (not tenant_id) for safety
675
+ - **Automatic Injection**: Recent memory automatically injected into tool payloads for multi-step workflows
676
+ - **Auto-Expiration**: Memory entries expire after configurable TTL (default: 15 minutes)
677
+ - **Session Management**: Memory can be explicitly cleared via `end_session` flag
678
+ - **Comprehensive Testing**: Full test suite covering memory storage, retrieval, expiration, and multi-step workflows
679
+
680
  ### UI Improvements
681
  - **Modern Drag-and-Drop**: Intuitive file upload with visual feedback
682
  - **Enhanced Status Messages**: Clear success/error messages with icons
backend/README.md CHANGED
@@ -122,6 +122,16 @@ Use the helper scripts in the repo root when validating backend changes:
122
  - **Enhanced tool selection** automatically triggers RAG for admin questions, fact lookups ("who is", "what is"), and internal knowledge queries
123
  - **Response unwrapping** in MCP client ensures orchestrator receives properly formatted results for tool scoring and prompt building
124
 
 
 
 
 
 
 
 
 
 
 
125
  ### UI Enhancements (app.py)
126
  - **Knowledge Base Library Tab**:
127
  - Statistics cards showing document counts by type
@@ -159,6 +169,8 @@ Defined in `env.example`:
159
  - If not set, the system automatically falls back to SQLite in `data/` directory
160
  - See `SUPABASE_SETUP.md` in the root directory for detailed setup instructions
161
  - `GOOGLE_SEARCH_API_KEY`, `GOOGLE_SEARCH_CX_ID` - Credentials for Google Programmable Search used by `web.search`
 
 
162
  - `APP_ENV`, `LOG_LEVEL`, `API_PORT`
163
 
164
  Update these before starting the servers to ensure the agent can reach every MCP endpoint and LLM runtime.
@@ -230,6 +242,7 @@ Agents that speak the Model Context Protocol should connect to the `integrachat`
230
  - All endpoints support both POST (with JSON payload) and direct HTTP methods (GET for list, DELETE for delete operations)
231
  - Tenant ID normalization handles whitespace and ensures documents can be listed and deleted consistently
232
  - RAG search uses a default threshold of 0.3 for better recall; adjust via `threshold` parameter if needed
 
233
 
234
  ## Troubleshooting
235
 
 
122
  - **Enhanced tool selection** automatically triggers RAG for admin questions, fact lookups ("who is", "what is"), and internal knowledge queries
123
  - **Response unwrapping** in MCP client ensures orchestrator receives properly formatted results for tool scoring and prompt building
124
 
125
+ ### Conversation Memory System
126
+ - **Short-Term Memory**: Automatic storage of tool outputs per session with configurable size limits (default: 10 outputs) and TTL (default: 900 seconds / 15 minutes)
127
+ - **Session-Based Isolation**: Memory is keyed by `session_id` (not `tenant_id`) for safety, ensuring no cross-tenant data mixing
128
+ - **Automatic Injection**: Recent memory is automatically injected into tool payloads as a `memory` field, enabling tools to make context-aware decisions in multi-step workflows
129
+ - **Auto-Expiration**: Memory entries automatically expire after TTL or can be explicitly cleared via `end_session`/`endSession` flag
130
+ - **Configuration**: Tune behavior via environment variables:
131
+ - `MCP_MEMORY_MAX_ITEMS`: Maximum number of tool outputs to keep per session (default: 10)
132
+ - `MCP_MEMORY_TTL_SECONDS`: Time-to-live for memory entries in seconds (default: 900)
133
+ - **Comprehensive Testing**: Full test suite in `backend/tests/test_conversation_memory.py` covering storage, retrieval, expiration, and multi-step workflows
134
+
135
  ### UI Enhancements (app.py)
136
  - **Knowledge Base Library Tab**:
137
  - Statistics cards showing document counts by type
 
169
  - If not set, the system automatically falls back to SQLite in `data/` directory
170
  - See `SUPABASE_SETUP.md` in the root directory for detailed setup instructions
171
  - `GOOGLE_SEARCH_API_KEY`, `GOOGLE_SEARCH_CX_ID` - Credentials for Google Programmable Search used by `web.search`
172
+ - `MCP_MEMORY_MAX_ITEMS` - Maximum number of tool outputs to keep per session (default: 10)
173
+ - `MCP_MEMORY_TTL_SECONDS` - Time-to-live for memory entries in seconds (default: 900)
174
  - `APP_ENV`, `LOG_LEVEL`, `API_PORT`
175
 
176
  Update these before starting the servers to ensure the agent can reach every MCP endpoint and LLM runtime.
 
242
  - All endpoints support both POST (with JSON payload) and direct HTTP methods (GET for list, DELETE for delete operations)
243
  - Tenant ID normalization handles whitespace and ensures documents can be listed and deleted consistently
244
  - RAG search uses a default threshold of 0.3 for better recall; adjust via `threshold` parameter if needed
245
+ - **Conversation Memory**: Send `session_id` (or `sessionId`/`conversation_id`/`conversationId`) in tool payloads to enable short-term memory. Recent tool outputs are automatically stored and injected into subsequent tool calls as a `memory` field. Send `end_session: true` to clear memory for a session.
246
 
247
  ## Troubleshooting
248