ARYAN PANDIT

Software Developer

Read Resume

ConvoLayer

TypeScriptNode.jsMiddlewareChromaDBPostgreSQLSDK Design

A drop-in conversational middleware SDK that gives existing AI agents session memory, context compression, structured fact tracking, and clarification control.

ConvoLayer is a drop-in middleware SDK for AI applications that need real multi-turn conversational behavior. Instead of rebuilding memory and context logic around every new agent, teams can wrap an existing agent function and add the missing session layer around it.

The product manages sessions automatically, rebuilds the outbound context window before every request, compresses older conversation, carries forward confirmed facts as structured memory, and prevents the agent from asking the same clarification question repeatedly.

Inspiration Behind It

The project comes from a repeated engineering problem in AI applications: real users talk like a conversation persists, but most LLM APIs are stateless by design. That mismatch makes otherwise good agents feel forgetful, repetitive, and fragile in real product flows.

ConvoLayer was built to stop re-implementing the same infrastructure over and over. Session storage, context trimming, summarization, fact extraction, and clarification control are not one-off product features. They are a reusable conversational layer that most teams need but rarely package well.

System Architecture

Architecture Diagram

ConvoLayer

10 nodes

CONVERSATION EDGEMEMORY SYSTEMAGENT EXECUTIONhydratestate lookuprecent turnsslotsreadrelevant memoryassembled promptresponsepersistupdate factsClient AppEnd-user messagesConvoLayerMiddlewareDrop-in wrapperSession LoaderRecent turns and slotsContext BuilderPrompt assemblyFact andClarification...Confirmed statePostgres SessionStoreDurable historyChroma RetrievalAdapterSemantic recallWrapped AgentExisting LLM pipelineSession WriterPersist response stateUpdated SessionOutputReply plus memory

About The Flow / Architecture

ConvoLayer sits between the frontend and the agent backend as a pure middleware layer. That keeps it backend-agnostic: it can wrap a LangChain RAG pipeline, a CrewAI system, a raw API call, or a custom orchestration stack without forcing a rewrite of the downstream agent.

On each message, the middleware checks session state, reconstructs the relevant context window, injects recent raw turns plus compressed older history and structured slot memory, calls the wrapped agent, and then persists the new turn. The storage layer is adapter-based, with ChromaDB for semantic retrieval and PostgreSQL for durable, queryable session history.

ConvoLayer solves the part of AI product development that teams keep rebuilding: conversational memory. It wraps an existing agent, preserves session continuity, compresses older history, carries forward structured facts, and keeps the model from repeatedly asking the same clarifying questions.

The SDK is designed to be practical rather than framework-specific. Teams can integrate it in minutes, switch between semantic or durable storage adapters, and keep multi-turn token usage roughly flat even as sessions grow from a few turns to dozens.

View Project