本地大语言模型对话的持久记忆与回溯系统
Project description
JiXing
Local AI Model Assistant with Long-term Memory System.
A unified tool to run local AI models (Ollama, Moxing) with complete logging of all interactions for later retrieval.
Features
- Multi-Provider Support: Run models from Ollama and Moxing with unified interface
- Complete Logging: Records all prompts, responses, timestamps, system info, and performance metrics
- Long-term Memory: SQLite-based storage for searching through all past interactions
- Web Interface: Optional Flask-based web UI for browsing sessions and searching messages
- CLI Interface: Full-featured command-line tool with subcommands
- Python API: Programmatic access via ToolResult pattern
- OpenAI Function Calling: Integrate with OpenAI agents via function tool definitions
Requirements
- Python 3.10+
- Ollama (optional, for Ollama model support)
- Moxing (optional, for GGUF model support)
- Flask (optional, for web interface)
Installation
pip install -e .
Quick Start
CLI Usage
Run an Ollama model:
jixing ollama run gemma3:1b "Hello, how are you?"
Run in interactive mode:
jixing ollama run gemma3:1b -i
Run a Moxing (GGUF) model:
jixing moxing serve gguf-model-name "Your prompt here"
List all sessions:
jixing sessions list
Search through message history:
jixing search "previous conversation about Python"
Show statistics:
jixing stats
Start web interface:
jixing web --port 5000
Python API
from jixing import run_ollama, query_sessions, ToolResult
result = run_ollama(model="gemma3:1b", prompt="Hello!")
print(result.success) # True / False
print(result.data) # Response data
print(result.metadata) # Metadata including version
CLI Help
$ jixing --help
usage: jixing [-h] [-V] [-v] [-o OUTPUT] [--json] [-q] {ollama,moxing,sessions,search,stats,info,web} ...
positional arguments:
{ollama,moxing,sessions,search,stats,info,web}
ollama Run Ollama model
moxing Run Moxing model
sessions Manage sessions
search Search message history
stats Show statistics
info Show system information
web Start web interface
options:
-V, --version Show version
-v, --verbose Verbose output
-o, --output OUTPUT Output path
--json Output results as JSON
-q, --quiet Suppress non-essential output
Architecture
jixing/
├── jixing/
│ ├── __init__.py # Package exports
│ ├── __version__.py # Version info
│ ├── core.py # Core logic, Session, ModelRunner
│ ├── api.py # ToolResult API functions
│ ├── cli.py # CLI interface
│ ├── db.py # SQLite database
│ ├── models/ # Model adapters
│ ├── tools.py # OpenAI function definitions
│ └── web.py # Flask web interface
├── tests/
├── pyproject.toml
└── README.md
Agent Integration
Integrate JiXing with OpenAI function-calling agents:
from openai import OpenAI
from jixing.tools import TOOLS, dispatch
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Run Ollama model gemma3:1b with prompt 'Hello'"}],
tools=TOOLS,
)
for tool_call in response.choices[0].message.tool_calls:
result = dispatch(tool_call.function.name, tool_call.function.arguments)
# Feed result back to LLM...
License
GPL-3.0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jixing-1.0.2.tar.gz.
File metadata
- Download URL: jixing-1.0.2.tar.gz
- Upload date:
- Size: 47.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
286a1f54c6523bf442be547a71fd246b8f0013fb47c00c44da0fa21f3b752947
|
|
| MD5 |
70b27cc5cedfab650d972c37f5af944a
|
|
| BLAKE2b-256 |
967441afa6bbb3f805ea40afe7301260d3b67c686dd896ed6c6fcbb203a1536e
|
File details
Details for the file jixing-1.0.2-py3-none-any.whl.
File metadata
- Download URL: jixing-1.0.2-py3-none-any.whl
- Upload date:
- Size: 37.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9407d6eb79adc08b3fac73d62bdeb933b2a4e277c2ef6fdd861fe73aa344302
|
|
| MD5 |
10085ff3cf258d08cb3312be4ed0dfbf
|
|
| BLAKE2b-256 |
6759d93ff82c4b2f8d1b30ac9d83764b471ff92668bba5343d715ac2bbf0bf69
|