anuragsinghbhandari / anuragsinghbhandari/TopSecret-Agent

Implement session-based semantic memory and retrieval

Aperta
#1 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
enhancement good first issue memory
Lingua principale
Python
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

> Currently, TopSecret-Agent stores individual conversation turns in SQLite, but it does not have a mechanism for retrieving relevant information from previous sessions.
>
> Implement a session-based semantic memory system where each completed session is summarized and indexed using an embedding. When a new user query arrives, the system should retrieve relevant sessions using semantic similarity and then fetch the complete conversation for those sessions from SQLite.

### Proposed architecture

```text
User Query


Generate Query Embedding


Vector Search


Relevant Session IDs


SQLite


Full Session Conversations


Agent Prompt
```

### Session indexing

When a session ends:

```text
Conversation


Generate summary


Generate embedding


Store embedding + session_id
```

SQLite remains the source of truth for the actual conversation.

### Requirements

* [ ] Introduce an explicit session concept.
* [ ] Associate every conversation turn with a session ID.
* [ ] Generate a summary for a completed session.
* [ ] Generate an embedding from the session summary.
* [ ] Store the embedding together with the session ID.
* [ ] Generate an embedding for new user queries.
* [ ] Retrieve the most relevant session IDs.
* [ ] Fetch the corresponding conversations from SQLite.
* [ ] Provide retrieved sessions to the agent as additional context.
* [ ] Keep the existing user-profile mechanism separate from episodic memory.

### Design principle

The vector store should act as a **retrieval index**, not the source of truth.

```text
Vector Store

"Session 17 looks relevant"

SQLite

"Here is everything that happened in Session 17"
```

### Out of scope

For the first implementation:

* No message-level embeddings
* No automatic memory deletion
* No complex memory ranking
* No hybrid BM25 + vector retrieval
* No sophisticated long-term memory management

Those can be separate issues later.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.