Vector embeddings, RAG, and connectors for AI applications.
npm install @phantom-pm/knowledgeimport { createKnowledgeEngine, GitHubConnector } from '@phantom-pm/knowledge';
const engine = await createKnowledgeEngine({
embeddings: { provider: 'ollama' },
vectorStore: { type: 'memory' }
});
// Add documents
await engine.addDocuments([
{ id: '1', content: 'My content', source: 'test' }
]);
// Query
const result = await engine.query('What is this about?');
console.log(result.answer);
console.log(result.citations);- Vector embeddings (OpenAI, Ollama)
- RAG with citations
- Connectors (GitHub, more coming)
- In-memory & file storage
phantom-knowledge init
phantom-knowledge search "query"
phantom-knowledge sync githubSee README.md for full documentation.