npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yashu_jaat01/ai-persona

v0.3.0

Published

A fluent AI SDK and CLI for terminal chat, session memory, personalities, and local RAG support

Readme

@yashu_jaat01/ai-persona

A fluent AI SDK and CLI for terminal chat, session memory, personalities, local RAG, streaming answers, and document-aware workflows.

Features

  • Interactive setup wizard
  • Terminal chat mode
  • Streaming AI responses in the terminal
  • Colored output and spinner-based CLI UX
  • Named chat sessions with local memory
  • Memory commands: list, show, recent, summary, clear, delete
  • SDK-based AI usage in projects
  • Local RAG for .txt, .md, .pdf, and .docx files
  • Multi-provider support
  • Use-case based feature locking
  • Update notifications for newer versions

Installation

npm install @yashu_jaat01/ai-persona

For global CLI usage:

npm install -g @yashu_jaat01/ai-persona

Setup

Run the interactive setup wizard:

npx ai-persona init

The wizard asks for:

  • Use case
  • Provider
  • API key
  • AI personality

It creates:

  • .ai-persona/config.json
  • .env

Use Case Modes

Your selected use case unlocks only the features relevant to that mode.

cli

Unlocked:

  • npx ai-persona chat
  • Session-based local memory commands

Locked:

  • SDK usage
  • RAG indexing
  • RAG retrieval

sdk

Unlocked:

  • import { ai } from '@yashu_jaat01/ai-persona'
  • ai.chat(...)

Locked:

  • CLI chat
  • RAG indexing
  • RAG retrieval

rag

Unlocked:

  • npx ai-persona rag init ./docs
  • RAG-based SDK answers after indexing

Locked:

  • CLI chat
  • Non-RAG SDK mode

both

Unlocked:

  • CLI chat
  • SDK usage
  • RAG indexing
  • RAG retrieval

To change your mode later, re-run:

npx ai-persona init

CLI Usage

CLI chat is available in cli or both mode.

Start chat

npx ai-persona chat

Start chat with a named session

npx ai-persona chat project-alpha

Type exit to quit.

Memory Commands

Session memory commands are available for saved local chat sessions.

List sessions

npx ai-persona memory list

Show full session history

npx ai-persona memory show project-alpha

Show recent messages

npx ai-persona memory recent project-alpha 5

Show session summary

npx ai-persona memory summary project-alpha

Clear one session

npx ai-persona memory clear project-alpha

Clear all sessions

npx ai-persona memory clear all

Delete one session

npx ai-persona memory delete project-alpha

SDK Usage

SDK usage is available in sdk, rag, or both mode.

Basic chat

import { ai } from '@yashu_jaat01/ai-persona';

const reply = await ai
  .personality('Senior developer')
  .chat('Explain closures in simple words');

console.log(reply);

SDK chat with session memory

import { ai } from '@yashu_jaat01/ai-persona';

const reply = await ai.chat('Remember that my favorite language is JavaScript.', {
  sessionId: 'project-alpha'
});

console.log(reply);

Streaming Chat

Terminal chat now supports streaming responses for a smoother experience, along with colored output and a spinner while the model starts responding.

npx ai-persona chat

This is built into the CLI automatically, so no extra flags are required.

RAG Usage

RAG is available in rag or both mode.

RAG answers only work after you index your files first.

Step 1: Index your files

npx ai-persona rag init ./docs

Supported file types:

  • .txt
  • .md
  • .pdf
  • .docx

This creates:

.ai-persona/rag-store.json

Step 2: Ask RAG-based questions

import { ai } from '@yashu_jaat01/ai-persona';

const reply = await ai.chat('What does the documentation say about authentication?');
console.log(reply);

If a RAG index exists, the package retrieves relevant document chunks and uses them as context.

Chatbot Integration

In both mode, you can use the package to build chatbots in your own apps.

import { ai } from '@yashu_jaat01/ai-persona';

const reply = await ai.chat('Hello, how can you help me?');
console.log(reply);

If RAG is enabled and files are indexed first, chatbot responses can also be grounded in your local documents.

Provider Support

Chat providers

  • Google
  • OpenAI
  • Anthropic

Embedding providers for RAG

  • Google
  • OpenAI

Anthropic is not currently supported for embeddings in the RAG pipeline.

Version Updates

The CLI can notify users when a newer package version is available, so older installations can upgrade more easily.

Troubleshooting

Feature is locked

If you see a locked-feature error, your current use case does not allow that feature.

Re-run:

npx ai-persona init

and choose a different mode.

Memory is not showing expected results

Make sure:

  1. You are using the same session name
  2. You exited chat normally after sending messages
  3. You are checking the correct session with memory show or memory summary

RAG is not working

Make sure:

  1. You selected rag or both
  2. You indexed files first
  3. .ai-persona/rag-store.json exists
  4. Your files are in a supported format: .txt, .md, .pdf, or .docx

PDF parsing issues in ESM

If you are developing locally and hit ESM import issues with pdf-parse, make sure your installed package version matches your import style and rebuild before testing.

Publish errors

If you publish under your personal npm account, use your npm username as the package scope. Scoped public packages need to be published with the correct scope and package access settings [web:847].

Local Development

npm install
npm run build
node dist/cli.js init
node dist/cli.js chat
node dist/cli.js chat project-alpha
node dist/cli.js memory list
node dist/cli.js rag init ./docs

License

ISC