What Programming Languages Are Used in Supermemory?
Supermemory is built primarily with TypeScript for its core web application and API infrastructure, while Python powers the project's SDKs for AI framework integrations.
The supermemoryai/supermemory repository is a multi-language codebase designed for modern knowledge management and AI integration. Understanding what programming languages are used in Supermemory is essential for developers looking to contribute to the project or integrate its capabilities into existing workflows.
TypeScript: The Core Application Stack
TypeScript serves as the foundational language for Supermemory's web application, API clients, and server-side logic. The majority of executable source code resides in .ts and .tsx files, implementing everything from React components to authentication handlers.
Key TypeScript implementations include:
packages/lib/api.ts– The central API client that handles document creation, retrieval, and management across the Supermemory ecosystempackages/lib/auth.ts– Authentication logic managing API keys and session handlingapps/web/tsconfig.json– Compiler configuration defining TypeScript settings for the main web application
The TypeScript codebase follows modern React patterns, utilizing .tsx components for the user interface while maintaining type safety across the entire application layer.
Python: SDK and Integration Layer
Python provides the interface layer for developers working with AI frameworks and Python-based backends. Supermemory maintains dedicated Python SDKs that wrap the core API functionality, enabling seamless integration with popular AI tools.
Primary Python implementations include:
packages/openai-sdk-python/src/supermemory_openai/tools.py– Implements an OpenAI-compatible interface for Python developers, allowing document creation and memory management through familiar patternspackages/pipecat-sdk-python/src/supermemory_pipecat/service.py– Provides integration with the Pipecat framework for conversational AI applicationspackages/openai-sdk-python/tests/andpackages/pipecat-sdk-python/tests/– Comprehensive test suites validating Python SDK functionality
These Python packages enable developers to interact with Supermemory's knowledge graph capabilities without leaving their Python environments.
Working with Supermemory APIs
TypeScript Implementation
The TypeScript API client in packages/lib/api.ts provides type-safe methods for document management:
import { createClient } from '@supermemory/api';
// Initialise the client with your API key
const client = createClient({ apiKey: 'YOUR_SUPERMEMORY_API_KEY' });
// Create a new document
async function addDocument() {
const response = await client.documents.create({
title: 'My Knowledge Base',
content: 'This is the content of the document.',
});
console.log('Created document ID:', response.id);
}
addDocument().catch(console.error);
Python Implementation
The OpenAI-style Python SDK in packages/openai-sdk-python/src/supermemory_openai/tools.py offers a familiar interface for Python developers:
from supermemory_openai import SupermemoryClient
# Initialise the client
client = SupermemoryClient(api_key="YOUR_SUPERMEMORY_API_KEY")
# Add a new memory
doc = client.documents.create(
title="My Knowledge Base",
content="This is the content of the document."
)
print(f"Created document ID: {doc.id}")
Summary
- TypeScript powers the core Supermemory application, including the web UI, API client (
packages/lib/api.ts), and authentication systems (packages/lib/auth.ts) - Python enables framework-specific integrations through dedicated SDKs located in
packages/openai-sdk-pythonandpackages/pipecat-sdk-python - The repository structure separates concerns clearly: TypeScript handles the platform infrastructure while Python focuses on developer SDK accessibility
- Both languages implement identical core functionality—document creation, retrieval, and knowledge management—tailored to their respective ecosystem conventions
Frequently Asked Questions
Is Supermemory built entirely in TypeScript?
No, while the core web application and API infrastructure are written in TypeScript, Supermemory maintains significant Python components. The Python SDKs in packages/openai-sdk-python and packages/pipecat-sdk-python provide essential integrations for AI developers working in Python environments.
What Python SDKs does Supermemory provide?
Supermemory offers two primary Python SDKs: an OpenAI-compatible wrapper (packages/openai-sdk-python/src/supermemory_openai/tools.py) that mimics the OpenAI client interface, and a Pipecat integration (packages/pipecat-sdk-python/src/supermemory_pipecat/service.py) for conversational AI pipelines. Both enable Python developers to create, update, and query documents in the Supermemory knowledge base.
Can I contribute to Supermemory if I only know TypeScript?
Yes, the majority of the supermemoryai/supermemory codebase—including the web frontend, API layer, and core business logic—is implemented in TypeScript. Files like packages/lib/api.ts and packages/lib/auth.ts contain the essential infrastructure, making TypeScript contributions highly valuable for platform development.
Where is the main API client implementation located?
The central API client is implemented in packages/lib/api.ts (TypeScript). This file defines the primary interface for document operations and serves as the foundation for both the web application and the Python SDKs, which wrap these core TypeScript functions for cross-language compatibility.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →