TypeScript
Install the TypeScript/Node.js SDK and start building AI applications with semantic memory.
Build AI applications with TypeScript or JavaScript using the Graphlit SDK.
Installation
Install the Graphlit client with npm or yarn:
npm install graphlit-clientyarn add graphlit-clientpnpm add graphlit-clientRequirements:
Node.js 18 or higher
Graphlit account with API credentials
Quick Start
import { Graphlit } from 'graphlit-client';
async function main() {
const graphlit = new Graphlit();
const response = await graphlit.ingestText(
'Our AI agent needs persistent memory across sessions...',
'Product Requirements',
);
console.log(`β
Memory created: ${response.ingestText.id}`);
}
main().catch((error) => {
console.error(error);
process.exit(1);
});import { Graphlit } from 'graphlit-client';
async function main() {
const graphlit = new Graphlit();
const response = await graphlit.ingestText(
'Our AI agent needs persistent memory across sessions...',
'Product Requirements'
);
console.log(`β
Memory created: ${response.ingestText.id}`);
}
main().catch((error) => {
console.error(error);
process.exit(1);
});That's it! You now have semantic memory for your AI application.
Configuration Options
Environment Variables (Recommended)
Security: Never commit credentials to git. Use environment variables or secrets management in production.
Alternative: Explicit Configuration
Only use if you need to override environment variables:
Common Patterns
Ingest Content
Search Memory
Chat with Context
Next Steps
Quickstarts:
Quickstart: Your First Agent - Build a streaming agent in 7 minutes
AI Agents - Create agents with persistent memory
MCP Integration - Connect to your IDE
Examples:
Next.js Applications - Full-stack chat apps
MCP Server - Production MCP implementation
Resources:
Use Case Library - 100+ code examples
Ask Graphlit - AI code assistant
Join Discord - Get help from the community
Last updated
Was this helpful?