Documentation Index
Fetch the complete documentation index at: https://icrl.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
Constructor
new TrajectoryDatabase(
storage: StorageAdapter,
embedder: Embedder,
options?: TrajectoryDatabaseOptions
)
TrajectoryDatabaseOptions includes:
maxEmbedChars (default: 2000) — maximum characters for embedding text
Load
Load trajectories and index from storage. Must be called before other operations.
Core Methods
await db.add(trajectory);
db.get(id);
db.getAll();
await db.remove(id);
db.size;
Search
db.search(query, (k = 3));
db.searchSteps(query, (k = 3));
search — trajectory-level retrieval by goal similarity
searchSteps — step-level retrieval for in-context examples
Retrieval Feedback
await db.recordRetrieval(trajectoryId, ledToSuccess);
db.getCurationMetadata(trajectoryId);
Storage Access
db.getStorage();
db.getEmbedder();