MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / readEpisodes

Function readEpisodes

src/context/episodic-memory.ts:58–66  ·  view source on GitHub ↗
(projectRoot: string, limit = 500)

Source from the content-addressed store, hash-verified

56
57/** Read this project's episodes (most recent `limit`). */
58export async function readEpisodes(projectRoot: string, limit = 500): Promise<Episode[]> {
59 try {
60 const raw = await fs.readFile(episodesPath(projectRoot), 'utf-8');
61 const lines = raw.split('\n').filter(l => l.trim()).slice(-limit);
62 return lines.map(l => { try { return JSON.parse(l) as Episode; } catch { return null; } }).filter(Boolean) as Episode[];
63 } catch {
64 return [];
65 }
66}
67
68export interface RankOptions {
69 topK?: number;

Callers 6

index.tsFile · 0.85
executeMethod · 0.85
loadEpisodeBlockFunction · 0.85
gatherDashboardDataFunction · 0.85
dispatchActionFunction · 0.85
listEpisodesMethod · 0.85

Calls 1

episodesPathFunction · 0.85

Tested by

no test coverage detected