cognitive-demo
v0.1.0
Published
> Example chat application showing Kognitive integration.
Readme
Kognitive Demo
Example chat application showing Kognitive integration.
Setup
# Set environment variables
cp .env.example .env
# Edit .env with your COGNITIVE_API_KEY and COGNITIVE_API_URL
bun run dev # Start on port 3000How It Works
Uses createCognitiveLayer() from @kognitivedev/vercel-ai-provider to wrap the AI SDK with automatic memory injection, prompt resolution, and conversation logging.
const cl = createCognitiveLayer({
provider: createOpenAI({ apiKey: "gateway-managed" }).chat,
clConfig: { apiKey, baseUrl, logLevel: "debug" },
});
const model = cl("gpt-4o", { userId, projectId, sessionId });
const result = await cl.streamText({ prompt: { slug: "demo-agent" }, model, messages });